use of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter in project OpenTripPlanner by opentripplanner.
the class ConcaveHull method transformIntoPointGeometryCollection.
/**
* Transform into GeometryCollection.
*
* @param geom
* input geometry
* @return
* a geometry collection
*/
private static GeometryCollection transformIntoPointGeometryCollection(Geometry geom) {
UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
geom.apply(filter);
Coordinate[] coord = filter.getCoordinates();
Geometry[] geometries = new Geometry[coord.length];
for (int i = 0; i < coord.length; i++) {
Coordinate[] c = new Coordinate[] { coord[i] };
CoordinateArraySequence cs = new CoordinateArraySequence(c);
geometries[i] = new Point(cs, geom.getFactory());
}
return new GeometryCollection(geometries, geom.getFactory());
}
use of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter in project OpenTripPlanner by opentripplanner.
the class ConcaveHull method transformIntoPointGeometryCollection.
/**
* Transform into GeometryCollection.
*
* @param geom
* input geometry
* @return
* a geometry collection
*/
private static GeometryCollection transformIntoPointGeometryCollection(GeometryCollection gc) {
UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
gc.apply(filter);
Coordinate[] coord = filter.getCoordinates();
Geometry[] geometries = new Geometry[coord.length];
for (int i = 0; i < coord.length; i++) {
Coordinate[] c = new Coordinate[] { coord[i] };
CoordinateArraySequence cs = new CoordinateArraySequence(c);
geometries[i] = new Point(cs, gc.getFactory());
}
return new GeometryCollection(geometries, gc.getFactory());
}
Aggregations