Class GeometryBuilder


  • public class GeometryBuilder
    extends Object
    Includes methods to create and manipulate geometries derived from the boundary input parameters.
    • Constructor Detail

      • GeometryBuilder

        public GeometryBuilder()
      • GeometryBuilder

        public GeometryBuilder​(ProcessingData processingData)
    • Method Detail

      • createBboxes

        public org.locationtech.jts.geom.Geometry createBboxes​(String[] bboxes)
        Creates a unified Geometry object out of the content of the given String 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

        public org.locationtech.jts.geom.Geometry createCircularPolygons​(String[] bpoints)
        Creates a Geometry object around the coordinates of the given String 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

        public org.locationtech.jts.geom.Geometry createBpolys​(String[] bpolys)
        Creates a Polygon out of the coordinates in the given array. If more polygons are given, a union of the polygons is applied and a MultiPolygon is created.
        Parameters:
        bpolys - String array containing the lon/lat coordinates of the bounding polygon(s).
        Returns:
        Geometry object representing a Polygon object, if only one polygon was given or a MultiPolygon object, if more than one were given.
        Throws:
        BadRequestException - if bpolys coordinates are invalid
      • createGeometryFromMetadataGeoJson

        public void createGeometryFromMetadataGeoJson​(String geoJson)
        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