Package de.dlr.proseo.geotools.rest
Klasse GeotoolsUtil
java.lang.Object
de.dlr.proseo.geotools.rest.GeotoolsUtil
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).
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibung(Package privat) GeotoolsConfiguration
Geotools configuration -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetInfo()
Retrieves information about the loaded shapesisPointInside
(Double latitude, Double longitude, ShpFile shpFile) Checks whether the geographical point defined by latitude and longitude is contained in the region described by the provided shpFileisPointInside
(Double latitude, Double longitude, String[] types) Checks whether the geographical point defined by latitude and longitude is inside of at least one of the provided regionsisPolyInside
(RestPolygon poly, String[] types) Checks whether the geographical area defined by the RestPolygon is contained in one or more of the region types.isPolyOverlap
(RestPolygon poly, String[] types) Check whether the geographical area defined by the RestPolygon overlaps one or more of the region types.
-
Felddetails
-
geotoolsConfig
Geotools configuration
-
-
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 givenIllegalArgumentException
- if an invalid file type was givenIOException
- 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 coordinatelongitude
- a Double describing the longitude of the coordinatetypes
- 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 givenIllegalArgumentException
- if an invalid file type was givenIOException
- 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 coordinatelongitude
- a Double describing the longitude of the coordinateshpFile
- 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 givenIllegalArgumentException
- if an invalid file type was given or either input is missingIOException
- if the shape file could not be opened created successfully
-
isPolyInside
public Boolean isPolyInside(RestPolygon poly, String[] types) throws UnsupportedOperationException, IllegalArgumentException, IOException 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 RestPolygontypes
- 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 givenIllegalArgumentException
- if an invalid file type was givenIOException
- if the shape file could not be opened created successfully
-
isPolyOverlap
public Boolean isPolyOverlap(RestPolygon poly, String[] types) throws UnsupportedOperationException, IllegalArgumentException, IOException 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 RestPolygontypes
- 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 givenIllegalArgumentException
- if an invalid file type was givenIOException
- if the shape file could not be opened created successfully
-