use of org.locationtech.jts.geom.GeometryCollection in project yyl_example by Relucent.
the class JtsGeometryExample1 method createGeoCollect.
/**
* create GeometryCollection contain point or multiPoint or line or multiLine or polygon or multiPolygon
* @return 图形集
* @throws ParseException
*/
public static GeometryCollection createGeoCollect() throws ParseException {
LineString line = createLine();
Polygon poly = createPolygonByWKT();
Geometry g1 = GEOMETRY_FACTORY.createGeometry(line);
Geometry g2 = GEOMETRY_FACTORY.createGeometry(poly);
Geometry[] garray = new Geometry[] { g1, g2 };
GeometryCollection gc = GEOMETRY_FACTORY.createGeometryCollection(garray);
return gc;
}
use of org.locationtech.jts.geom.GeometryCollection in project arctic-sea by 52North.
the class GeoJSONTest method testGeometryCollectionWithZCoordinate.
@Test
public void testGeometryCollectionWithZCoordinate() throws GeoJSONDecodingException, IOException {
GeometryCollection geometry = geometryFactory.createGeometryCollection(new Geometry[] { randomGeometryCollection(EPSG_4326), randomGeometryCollection(2000) });
geometry.apply(new RandomZCoordinateFilter());
geometry.geometryChanged();
readWriteTest(geometry);
}
use of org.locationtech.jts.geom.GeometryCollection in project arctic-sea by 52North.
the class GeoJSONTest method testCrs.
private void testCrs(int parent, int child) {
final GeometryCollection col = geometryFactory.createGeometryCollection(new Geometry[] { randomPoint(child) });
col.setSRID(parent);
readWriteTest(col);
}
Aggregations