Klasse GeotoolsUtil

java.lang.Object
de.dlr.proseo.geotools.rest.GeotoolsUtil

@Component public class GeotoolsUtil extends Object
A utility class for working with geospatial data. It provides methods for checking if a point or polygon is inside or overlaps with certain regions defined by shape files (provided in application.yml).
  • Felddetails

  • Konstruktordetails

    • GeotoolsUtil

      public GeotoolsUtil()
  • Methodendetails

    • getInfo

      Retrieves information about the loaded shapes
      Gibt zurück:
      information about the loaded shapes
      Löst aus:
      UnsupportedOperationException - if a valid, but not yet handled file type was given
      IllegalArgumentException - if an invalid file type was given
      IOException - if the shape file could not be opened created successfully
    • isPointInside

      public Boolean isPointInside(Double latitude, Double longitude, String[] types) throws UnsupportedOperationException, IllegalArgumentException, IOException
      Checks whether the geographical point defined by latitude and longitude is inside of at least one of the provided regions
      Parameter:
      latitude - a Double describing the latitude of the coordinate
      longitude - a Double describing the longitude of the coordinate
      types - the types parameter is used to determine which region types to check if a given point is inside. If the types parameter is null or empty, it will consider all available region types stored in the shapeMap. Otherwise, it will only check the specified region types.
      Gibt zurück:
      true if the coordinate is contained in at least one of the provided regions (or all known regions if none were provided)
      Löst aus:
      UnsupportedOperationException - if a valid, but not yet handled file type was given
      IllegalArgumentException - if an invalid file type was given
      IOException - if the shape file could not be opened created successfully
    • isPointInside

      public Boolean isPointInside(Double latitude, Double longitude, ShpFile shpFile) throws UnsupportedOperationException, IllegalArgumentException, IOException
      Checks whether the geographical point defined by latitude and longitude is contained in the region described by the provided shpFile
      Parameter:
      latitude - a Double describing the latitude of the coordinate
      longitude - a Double describing the longitude of the coordinate
      shpFile - the shape file against which to compare the coordinate
      Gibt zurück:
      true if the geographical point defined by latitude and longitude is contained in the region described by the provided shpFile
      Löst aus:
      UnsupportedOperationException - if a valid, but not yet handled file type was given
      IllegalArgumentException - if an invalid file type was given or either input is missing
      IOException - if the shape file could not be opened created successfully
    • isPolyInside

      Checks whether the geographical area defined by the RestPolygon is contained in one or more of the region types. All available region types will be checked if none were specified.
      Parameter:
      poly - a RestPolygon
      types - the types parameter is used to determine which region types to check if a given point is inside. If the types parameter is null or empty, it will consider all available region types stored in the shapeMap. Otherwise, it will only check the specified region types.
      Gibt zurück:
      true if poly is inside
      Löst aus:
      UnsupportedOperationException - if a valid, but not yet handled file type was given
      IllegalArgumentException - if an invalid file type was given
      IOException - if the shape file could not be opened created successfully
    • isPolyOverlap

      Check whether the geographical area defined by the RestPolygon overlaps one or more of the region types. All available region types will be checked if none were specified.
      Parameter:
      poly - a RestPolygon
      types - the types parameter is used to determine which region types to check if a given point is inside. If the types parameter is null or empty, it will consider all available region types stored in the shapeMap. Otherwise, it will only check the specified region types.
      Gibt zurück:
      true if poly overlaps one or more of the regions, false otherwise
      Löst aus:
      UnsupportedOperationException - if a valid, but not yet handled file type was given
      IllegalArgumentException - if an invalid file type was given
      IOException - if the shape file could not be opened created successfully