@@ -296,7 +296,7 @@ private void executeFunctionOverA(FunctionInvoker fun) {
296296 String header = "" ;
297297 for (int i = 0 ; i < numGeom ; i ++) {
298298 Geometry comp = geomA == null ? null : geomA .get (i );
299- String hdr = GeometryOutput .writeGeometrySummary (SYM_A + "[" + i + "]" , comp );
299+ String hdr = GeometryOutput .writeSummary (SYM_A + "[" + i + "]" , comp );
300300 if (geomB == null ) {
301301 executeFunction (comp , fun , hdr );
302302 }
@@ -311,7 +311,7 @@ private void executeFunctionOverB(Geometry geomA, FunctionInvoker fun, String he
311311 List <Integer > targetB = geomIndexB .query (geomA );
312312 for (int index : targetB ) {
313313 Geometry gb = geomB .get (index );
314- String hdr = header + ", " + GeometryOutput .writeGeometrySummary (symGeom2 + "[" + index + "]" , gb );
314+ String hdr = header + ", " + GeometryOutput .writeSummary (symGeom2 + "[" + index + "]" , gb );
315315 fun .setB (gb );
316316 executeFunction (geomA , fun , hdr );
317317 }
@@ -382,7 +382,7 @@ private Object executeFunctionOnce(Geometry geomA, GeometryFunction func, Object
382382 return result ;
383383 }
384384
385- private String errorMsg (Throwable ex ) {
385+ private static String errorMsg (Throwable ex ) {
386386 String msg = "ERROR excuting function: " + ex .getMessage () + "\n " ;
387387 msg += toStackString (ex );
388388 if (ex .getCause () != null ) {
@@ -392,7 +392,7 @@ private String errorMsg(Throwable ex) {
392392 return msg ;
393393 }
394394
395- private String toStackString (Throwable ex ) {
395+ private static String toStackString (Throwable ex ) {
396396 StringWriter sw = new StringWriter ();
397397 PrintWriter pw = new PrintWriter (sw );
398398 ex .printStackTrace (pw );
@@ -498,13 +498,14 @@ private void outputResult(Object result, boolean isExplode, String outputFormat)
498498 Geometry geom = (Geometry ) result ;
499499 if (isExplode && geom instanceof GeometryCollection ) {
500500 for (int i = 0 ; i < geom .getNumGeometries (); i ++) {
501- printGeometry (geom .getGeometryN (i ), param .srid , outputFormat );
501+ writeGeometry (geom .getGeometryN (i ), param .srid , outputFormat );
502502 }
503503 }
504504 else {
505- printGeometry (geom , param .srid , outputFormat );
505+ writeGeometry (geom , param .srid , outputFormat );
506506 }
507507 }
508+
508509 private void outputList (List <Geometry > geoms , String outputFormat ) {
509510 if (geoms == null ) return ;
510511 if (outputFormat == null ) return ;
@@ -514,14 +515,11 @@ private void outputList(List<Geometry> geoms, String outputFormat) {
514515 }
515516 }
516517
517- private void printGeometry (Geometry geom , int srid , String outputFormat ) {
518- if (geom == null ) return ;
519- if (outputFormat == null ) return ;
520-
518+ private void writeGeometry (Geometry geom , int srid , String outputFormat ) {
521519 if (captureGeometry ) {
522520 resultGeoms .add ((Geometry ) geom );
523521 }
524- geomOut .printGeometry ((Geometry ) geom , srid , outputFormat );
522+ geomOut .write ((Geometry ) geom , srid , outputFormat );
525523 }
526524
527525 private void printlnInfo (String s ) {
@@ -535,13 +533,13 @@ private void printGeometrySummary(String label, List<Geometry> geom, String sour
535533
536534 String srcname = "" ;
537535 if (source != null ) srcname = " -- " + source ;
538- printlnInfo ( GeometryOutput .writeGeometrySummary (label , geom ) + srcname );
536+ printlnInfo ( GeometryOutput .writeSummary (label , geom ) + srcname );
539537 }
540538
541539 private void printGeometrySummary (String label , Geometry geom ) {
542540 // short-circuit to avoid cost
543541 if (! isVerbose ) return ;
544- printlnInfo ( GeometryOutput .writeGeometrySummary (label , geom ));
542+ printlnInfo ( GeometryOutput .writeSummary (label , geom ));
545543 }
546544
547545 private static String fileInfo (String filename , int limit , int offset ) {
0 commit comments