/** * Coordinates of LineString are an array of positions : * * { "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * * @param geom * @param gen * @throws IOException */ private void write(LineString geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "LineString"); gen.writeFieldName("coordinates"); writeCoordinates(geom.getCoordinates(), gen); }
/** * Coordinates of a MultiPoint are an array of positions: * * { "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * * * @param points * @param gen * @throws IOException */ private void write(MultiPoint points, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiPoint"); gen.writeFieldName("coordinates"); writeCoordinates(points.getCoordinates(), gen); }
/** * Coordinates of LineString are an array of positions : * * { "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * * @param geom * @param gen * @throws IOException */ private void write(LineString geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "LineString"); gen.writeFieldName("coordinates"); writeCoordinates(geom.getCoordinates(), gen); }
/** * Coordinates of LineString are an array of positions : * * { "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * * @param geom * @param gen * @throws IOException */ private void write(LineString geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "LineString"); gen.writeFieldName("coordinates"); writeCoordinates(geom.getCoordinates(), gen); }
/** * Coordinates of a MultiPoint are an array of positions: * * { "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * * * @param points * @param gen * @throws IOException */ private void write(MultiPoint points, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiPoint"); gen.writeFieldName("coordinates"); writeCoordinates(points.getCoordinates(), gen); }
/** * Coordinates of a MultiPoint are an array of positions: * * { "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * * * @param points * @param gen * @throws IOException */ private void write(MultiPoint points, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiPoint"); gen.writeFieldName("coordinates"); writeCoordinates(points.getCoordinates(), gen); }
/** * Coordinates of a MultiLineString are an array of LineString coordinate * arrays: * * { "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0, * 1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] } * * @param geom * @param gen * @throws IOException */ private void write(MultiLineString geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiLineString"); gen.writeFieldName("coordinates"); gen.writeStartArray(); for (int i = 0; i < geom.getNumGeometries(); ++i) { writeCoordinates(geom.getGeometryN(i).getCoordinates(), gen); } gen.writeEndArray(); }
/** * Coordinates of a MultiLineString are an array of LineString coordinate * arrays: * * { "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0, * 1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] } * * @param geom * @param gen * @throws IOException */ private void write(MultiLineString geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiLineString"); gen.writeFieldName("coordinates"); gen.writeStartArray(); for (int i = 0; i < geom.getNumGeometries(); ++i) { writeCoordinates(geom.getGeometryN(i).getCoordinates(), gen); } gen.writeEndArray(); }
/** * Coordinates of a MultiLineString are an array of LineString coordinate * arrays: * * { "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0, * 1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] } * * @param geom * @param gen * @throws IOException */ private void write(MultiLineString geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiLineString"); gen.writeFieldName("coordinates"); gen.writeStartArray(); for (int i = 0; i < geom.getNumGeometries(); ++i) { writeCoordinates(geom.getGeometryN(i).getCoordinates(), gen); } gen.writeEndArray(); }
/** * Coordinates of a Polygon are an array of LinearRing coordinate arrays. * The first element in the array represents the exterior ring. Any * subsequent elements represent interior rings (or holes). * * No holes: * * { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ] } * * With holes: * * { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], [ [100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ] ] } * * @param geom * @param gen * @throws IOException */ private void write(Polygon geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "Polygon"); gen.writeFieldName("coordinates"); gen.writeStartArray(); writeCoordinates(geom.getExteriorRing().getCoordinates(), gen); for (int i = 0; i < geom.getNumInteriorRing(); ++i) { writeCoordinates(geom.getInteriorRingN(i).getCoordinates(), gen); } gen.writeEndArray(); }
/** * Coordinates of a Polygon are an array of LinearRing coordinate arrays. * The first element in the array represents the exterior ring. Any * subsequent elements represent interior rings (or holes). * * No holes: * * { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ] } * * With holes: * * { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], [ [100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ] ] } * * @param geom * @param gen * @throws IOException */ private void write(Polygon geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "Polygon"); gen.writeFieldName("coordinates"); gen.writeStartArray(); writeCoordinates(geom.getExteriorRing().getCoordinates(), gen); for (int i = 0; i < geom.getNumInteriorRing(); ++i) { writeCoordinates(geom.getInteriorRingN(i).getCoordinates(), gen); } gen.writeEndArray(); }
/** * Coordinates of a Polygon are an array of LinearRing coordinate arrays. * The first element in the array represents the exterior ring. Any * subsequent elements represent interior rings (or holes). * * No holes: * * { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ] } * * With holes: * * { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], [ [100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ] ] } * * @param geom * @param gen * @throws IOException */ private void write(Polygon geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "Polygon"); gen.writeFieldName("coordinates"); gen.writeStartArray(); writeCoordinates(geom.getExteriorRing().getCoordinates(), gen); for (int i = 0; i < geom.getNumInteriorRing(); ++i) { writeCoordinates(geom.getInteriorRingN(i).getCoordinates(), gen); } gen.writeEndArray(); }
/** * * * Coordinates of a MultiPolygon are an array of Polygon coordinate arrays: * * { "type": "MultiPolygon", "coordinates": [ [[[102.0, 2.0], [103.0, 2.0], * [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]], [[[100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]] ] } * * @param geom * @param gen * @throws IOException */ private void write(MultiPolygon geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiPolygon"); gen.writeFieldName("coordinates"); gen.writeStartArray(); for (int i = 0; i < geom.getNumGeometries(); ++i) { Polygon p = (Polygon) geom.getGeometryN(i); gen.writeStartArray(); writeCoordinates(p.getExteriorRing().getCoordinates(), gen); for (int j = 0; j < p.getNumInteriorRing(); ++j) { writeCoordinates(p.getInteriorRingN(j).getCoordinates(), gen); } gen.writeEndArray(); } gen.writeEndArray(); }
/** * * * Coordinates of a MultiPolygon are an array of Polygon coordinate arrays: * * { "type": "MultiPolygon", "coordinates": [ [[[102.0, 2.0], [103.0, 2.0], * [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]], [[[100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]] ] } * * @param geom * @param gen * @throws IOException */ private void write(MultiPolygon geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiPolygon"); gen.writeFieldName("coordinates"); gen.writeStartArray(); for (int i = 0; i < geom.getNumGeometries(); ++i) { Polygon p = (Polygon) geom.getGeometryN(i); gen.writeStartArray(); writeCoordinates(p.getExteriorRing().getCoordinates(), gen); for (int j = 0; j < p.getNumInteriorRing(); ++j) { writeCoordinates(p.getInteriorRingN(j).getCoordinates(), gen); } gen.writeEndArray(); } gen.writeEndArray(); }
/** * * * Coordinates of a MultiPolygon are an array of Polygon coordinate arrays: * * { "type": "MultiPolygon", "coordinates": [ [[[102.0, 2.0], [103.0, 2.0], * [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]], [[[100.0, 0.0], [101.0, 0.0], * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]] ] } * * @param geom * @param gen * @throws IOException */ private void write(MultiPolygon geom, JsonGenerator gen) throws IOException { gen.writeStringField("type", "MultiPolygon"); gen.writeFieldName("coordinates"); gen.writeStartArray(); for (int i = 0; i < geom.getNumGeometries(); ++i) { Polygon p = (Polygon) geom.getGeometryN(i); gen.writeStartArray(); writeCoordinates(p.getExteriorRing().getCoordinates(), gen); for (int j = 0; j < p.getNumInteriorRing(); ++j) { writeCoordinates(p.getInteriorRingN(j).getCoordinates(), gen); } gen.writeEndArray(); } gen.writeEndArray(); }