Package org.opencms.util
Class CmsGeoUtil
java.lang.Object
org.opencms.util.CmsGeoUtil
Utility methods for processing geo coordinates.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringparseCoordinates(String coordinates) Parses coordinates, either from a lat,lon pair or from the JSON generated by the location picker.static StringparseLocationPickerCoordinates(String jsonValue) Parses a location picker JSON value and returns the coordinates contained therein.static booleanvalidateCoordinates(String coordinates) Validates a coordinates string and returns the validation result.static booleanvalidateLatitude(String latitude) Validates a latitude string.static booleanvalidateLocationPickerCoordinates(JSONObject jsonObject) Validates the coordinates contained in a given location picker JSON value.static booleanvalidateLongitude(String longitude) Validates a longitude string.static booleanvalidateRadius(String radius) Validates a radius string.static booleanvalidateUnits(String units) Validates a units string.
-
Constructor Details
-
CmsGeoUtil
public CmsGeoUtil()
-
-
Method Details
-
parseCoordinates
Parses coordinates, either from a lat,lon pair or from the JSON generated by the location picker.- Parameters:
coordinates- the coordinates string- Returns:
- the parsed coordinates
-
parseLocationPickerCoordinates
Parses a location picker JSON value and returns the coordinates contained therein.- Parameters:
jsonValue- the JSON value as string- Returns:
- the coordinates string or null if there are no valid location picker coordinates
-
validateCoordinates
Validates a coordinates string and returns the validation result.- Parameters:
coordinates- the coordinates string to validate- Returns:
- whether the coordinates are valid (true) or invalid (false)
-
validateLatitude
Validates a latitude string.- Parameters:
latitude- the latitude string to validate- Returns:
- whether the string is a valid latitude value (true) or not (false)
-
validateLocationPickerCoordinates
Validates the coordinates contained in a given location picker JSON value.- Parameters:
jsonObject- the JSON value- Returns:
- whether JSON contains valid coordinates (true) or not (false)
-
validateLongitude
Validates a longitude string.- Parameters:
longitude- the longitude string to validate- Returns:
- whether the string is a valid longitude value (true) or not (false)
-
validateRadius
Validates a radius string.- Parameters:
radius- the radius- Returns:
- whether a valid radius string or not
-
validateUnits
Validates a units string.- Parameters:
units- the units string- Returns:
- whether a valid units string or not
-