Package io.jmix.maps.utils
Class GeometryUtils
java.lang.Object
io.jmix.maps.utils.GeometryUtils
Utility class containing methods connected with JTS library.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.MultiPointcreateMultiPoint(org.locationtech.jts.geom.Point[] points) static org.locationtech.jts.geom.MultiPolygoncreateMultiPolygon(org.locationtech.jts.geom.Polygon[] polygons) static org.locationtech.jts.geom.MultiLineStringcreateMultiPolyline(org.locationtech.jts.geom.LineString[] polylines) static org.locationtech.jts.geom.PointcreatePoint(double x, double y) Creates a point with the given coordinates.static DoublegetAltitude(org.locationtech.jts.geom.Coordinate c) Returns double value of the altitude of the JTS'sCoordinate.static org.locationtech.jts.geom.GeometryFactoryCreates aGeometryFactoryhaving EPSG4326 spatial-reference ID.static DoublegetLatitude(org.locationtech.jts.geom.Coordinate c) Returns double value of the latitude of the JTS'sCoordinate.static DoublegetLongitude(org.locationtech.jts.geom.Coordinate c) Returns double value of the longitude of the JTS'sCoordinate.static org.locationtech.jts.geom.LineStringwktStringToLineString(String wktString) Converts WKT representation of a polyline to aLineStringobject.static org.locationtech.jts.geom.MultiLineStringwktStringToMultiLineString(String wktString) Converts WKT representation of a multi polyline to aMultiLineStringobject.static org.locationtech.jts.geom.MultiPointwktStringToMultiPoint(String wktString) Converts WKT representation of a multi point to aMultiPointobject.static org.locationtech.jts.geom.MultiPolygonwktStringToMultiPolygon(String wktString) Converts WKT representation of a multi polygon to aMultiPolygonobject.static org.locationtech.jts.geom.PointwktStringToPoint(String wktString) Converts WKT representation of a point to aPointobject.static org.locationtech.jts.geom.PolygonwktStringToPolygon(String wktString) Converts WKT representation of a polygon to aPolygonobject.
-
Method Details
-
getLatitude
Returns double value of the latitude of the JTS'sCoordinate.- Parameters:
c- JTS'sCoordinate- Returns:
- Double value of the latitude
-
getLongitude
Returns double value of the longitude of the JTS'sCoordinate.- Parameters:
c- JTS'sCoordinate- Returns:
- Double value of the longitude
-
getAltitude
Returns double value of the altitude of the JTS'sCoordinate.- Parameters:
c- JTS'sCoordinate- Returns:
- Double value of the altitude
-
wktStringToPoint
Converts WKT representation of a point to aPointobject.- Parameters:
wktString- WKT representation of a point- Returns:
- Point object
-
wktStringToLineString
Converts WKT representation of a polyline to aLineStringobject.- Parameters:
wktString- WKT representation of a linestring- Returns:
- LineString object
-
wktStringToPolygon
Converts WKT representation of a polygon to aPolygonobject.- Parameters:
wktString- WKT representation of a polygon- Returns:
- Polygon object
-
wktStringToMultiPoint
Converts WKT representation of a multi point to aMultiPointobject.- Parameters:
wktString- WKT representation of a multi point- Returns:
- MultiPoint object
-
wktStringToMultiLineString
public static org.locationtech.jts.geom.MultiLineString wktStringToMultiLineString(String wktString) Converts WKT representation of a multi polyline to aMultiLineStringobject.- Parameters:
wktString- WKT representation of a multi polyline- Returns:
- MultiLineString object
-
wktStringToMultiPolygon
Converts WKT representation of a multi polygon to aMultiPolygonobject.- Parameters:
wktString- WKT representation of a multi polygon- Returns:
- MultiPolygon object
-
getGeometryFactory
public static org.locationtech.jts.geom.GeometryFactory getGeometryFactory()Creates aGeometryFactoryhaving EPSG4326 spatial-reference ID.- Returns:
- GeometryFactory
-
createPoint
public static org.locationtech.jts.geom.Point createPoint(double x, double y) Creates a point with the given coordinates.- Parameters:
x- the x-valuey- the y-value- Returns:
- Point object
-
createMultiPoint
public static org.locationtech.jts.geom.MultiPoint createMultiPoint(org.locationtech.jts.geom.Point[] points) -
createMultiPolyline
public static org.locationtech.jts.geom.MultiLineString createMultiPolyline(org.locationtech.jts.geom.LineString[] polylines) -
createMultiPolygon
public static org.locationtech.jts.geom.MultiPolygon createMultiPolygon(org.locationtech.jts.geom.Polygon[] polygons)
-