Class GeometryBuilder
java.lang.Object
org.heigit.ohsome.ohsomeapi.inputprocessing.GeometryBuilder
Includes methods to create and manipulate geometries derived from the boundary input parameters.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.locationtech.jts.geom.Geometry
createBboxes
(String[] bboxes) Creates a unifiedGeometry
object out of the content of the givenString
array.org.locationtech.jts.geom.Geometry
createBpolys
(String[] bpolys) Creates aPolygon
out of the coordinates in the given array.org.locationtech.jts.geom.Geometry
createCircularPolygons
(String[] bpoints) Creates aGeometry
object around the coordinates of the givenString
array.org.locationtech.jts.geom.Geometry
createGeometryFromGeoJson
(String geoJson, InputProcessor inputProcessor) Creates a Geometry object from the given GeoJSON String.void
createGeometryFromMetadataGeoJson
(String geoJson) Creates a Geometry object from the given GeoJSON String, which is derived from the metadata.
-
Constructor Details
-
GeometryBuilder
public GeometryBuilder() -
GeometryBuilder
-
-
Method Details
-
createBboxes
Creates a unifiedGeometry
object out of the content of the givenString
array.- Parameters:
bboxes
-String
array containing the lon/lat coordinates of the bounding boxes. Each bounding box must consist of 2 lon/lat coordinate pairs (bottom-left and top-right).- Returns:
Geometry
object representing the unified bounding boxes.- Throws:
BadRequestException
- if bboxes coordinates are invalid
-
createCircularPolygons
Creates aGeometry
object around the coordinates of the givenString
array.- Parameters:
bpoints
-String
array containing the lon/lat coordinates of the point at [0] and [1] and the size of the buffer at [2].- Returns:
Geometry
object representing (a) circular polygon(s) around the given bounding point(s).- Throws:
BadRequestException
- if bcircle coordinates or radius are invalid
-
createBpolys
Creates aPolygon
out of the coordinates in the given array. If more polygons are given, a union of the polygons is applied and aMultiPolygon
is created.- Parameters:
bpolys
-String
array containing the lon/lat coordinates of the bounding polygon(s).- Returns:
Geometry
object representing aPolygon
object, if only one polygon was given or aMultiPolygon
object, if more than one were given.- Throws:
BadRequestException
- if bpolys coordinates are invalid
-
createGeometryFromMetadataGeoJson
Creates a Geometry object from the given GeoJSON String, which is derived from the metadata.- Throws:
RuntimeException
- if the derived GeoJSON cannot be converted to a Geometry
-
createGeometryFromGeoJson
public org.locationtech.jts.geom.Geometry createGeometryFromGeoJson(String geoJson, InputProcessor inputProcessor) Creates a Geometry object from the given GeoJSON String. It must be of type 'FeatureCollection' and its features must be of type 'Polygon' or 'Multipolygon'.- Throws:
BadRequestException
- if the given GeoJSON String cannot be converted to a Geometry, it is not of the type 'FeatureCollection', or if the provided custom id(s) cannot be parsed
-
getprocessingData
-