use of org.locationtech.jts.geom.LineString in project arctic-sea by 52North.
the class GeoJSONTest method testLineStringWithZCoordinate.
@Test
public void testLineStringWithZCoordinate() {
LineString geometry = randomLineString(EPSG_4326);
geometry.apply(new RandomZCoordinateFilter());
geometry.geometryChanged();
readWriteTest(geometry);
}
use of org.locationtech.jts.geom.LineString in project arctic-sea by 52North.
the class GeoJSONTest method randomLineString.
private LineString randomLineString(int srid) {
LineString geometry = geometryFactory.createLineString(new Coordinate[] { randomCoordinate(), randomCoordinate(), randomCoordinate() });
geometry.setSRID(srid);
return geometry;
}
use of org.locationtech.jts.geom.LineString in project arctic-sea by 52North.
the class GeoJSONEncoder method encode.
protected ObjectNode encode(MultiLineString geometry, int parentSrid) {
Preconditions.checkNotNull(geometry);
ObjectNode json = jsonFactory.objectNode();
ArrayNode list = json.put(JSONConstants.TYPE, JSONConstants.MULTI_LINE_STRING).putArray(JSONConstants.COORDINATES);
for (int i = 0; i < geometry.getNumGeometries(); ++i) {
list.add(encodeCoordinates((LineString) geometry.getGeometryN(i)));
}
encodeCRS(json, geometry, parentSrid);
return json;
}
Aggregations