/** * Converts a <code>Geometry</code> to its Well-known Text representation. * *@param geometry a <code>Geometry</code> to process */ private void writeFormatted(Geometry geometry, boolean useFormatting, Writer writer, PrecisionModel precisionModel) throws IOException { // ensure we have a precision model if (precisionModel == null) precisionModel = geometry.getPrecisionModel(); // create the formatter DecimalFormat formatter = createFormatter(precisionModel); // append the WKT appendGeometryTaggedText(geometry, useFormatting, writer, formatter); }
level2 = level + 1; appendGeometryTaggedText(geometryCollection.getGeometryN(i), outputOrdinates, useFormatting, level2, writer, formatter);
/** * Converts a <code>Geometry</code> to <Geometry Tagged Text> format, * then appends it to the writer. * * @param geometry the <code>Geometry</code> to process * @param useFormatting flag indicating that the output should be formatted * @param writer the output writer to append to * @param formatter the <code>DecimalFormatter</code> to use to convert * from a precise coordinate to an external coordinate */ private void appendGeometryTaggedText(Geometry geometry, boolean useFormatting, Writer writer, DecimalFormat formatter) throws IOException { // evaluate the ordinates actually present in the geometry CheckOrdinatesFilter cof = new CheckOrdinatesFilter(this.outputOrdinates); geometry.apply(cof); // Append the WKT appendGeometryTaggedText(geometry, cof.getOutputOrdinates(), useFormatting, 0, writer, formatter); } /**