Package io.jmix.maps.utils
Class GeometryUtils
java.lang.Object
io.jmix.maps.utils.GeometryUtils
Utility class containing methods connected with JTS library.
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.LineStringcreateLineString(org.locationtech.jts.geom.Coordinate[] coordinates) Creates aLineStringusing the given coordinates.static org.locationtech.jts.geom.MultiLineStringcreateMultiLineString(org.locationtech.jts.geom.LineString[] lineStrings) Creates aMultiLineStringusing the givenLineStrings.static org.locationtech.jts.geom.MultiPointcreateMultiPoint(org.locationtech.jts.geom.Point[] points) Creates aMultiPointusing the givenPoints.static org.locationtech.jts.geom.MultiPolygoncreateMultiPolygon(org.locationtech.jts.geom.Polygon[] polygons) Creates aMultiPolygonusing the givenPolygons.static org.locationtech.jts.geom.PointcreatePoint(double x, double y) Creates a point with the given coordinates.static org.locationtech.jts.geom.PolygoncreatePolygon(org.locationtech.jts.geom.Coordinate[] shell) Creates aPolygonwith the given exterior boundary.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 EPSG:4326 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 multilinestring to aMultiLineStringobject.static org.locationtech.jts.geom.MultiPointwktStringToMultiPoint(String wktString) Converts WKT representation of a multipoint to aMultiPointobject.static org.locationtech.jts.geom.MultiPolygonwktStringToMultiPolygon(String wktString) Converts WKT representation of a multipolygon 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.
- 
Field Details- 
EPSG_4326public static final int EPSG_4326- See Also:
 
 
- 
- 
Method Details- 
getLatitudeReturns double value of the latitude of the JTS'sCoordinate.- Parameters:
- c- JTS's- Coordinate
- Returns:
- Double value of the latitude
 
- 
getLongitudeReturns double value of the longitude of the JTS'sCoordinate.- Parameters:
- c- JTS's- Coordinate
- Returns:
- Double value of the longitude
 
- 
getAltitudeReturns double value of the altitude of the JTS'sCoordinate.- Parameters:
- c- JTS's- Coordinate
- Returns:
- Double value of the altitude
 
- 
wktStringToPointConverts WKT representation of a point to aPointobject.- Parameters:
- wktString- WKT representation of a point
- Returns:
- Point object
 
- 
wktStringToLineStringConverts WKT representation of a polyline to aLineStringobject.- Parameters:
- wktString- WKT representation of a linestring
- Returns:
- LineString object
 
- 
wktStringToPolygonConverts WKT representation of a polygon to aPolygonobject.- Parameters:
- wktString- WKT representation of a polygon
- Returns:
- Polygon object
 
- 
wktStringToMultiPointConverts WKT representation of a multipoint to aMultiPointobject.- Parameters:
- wktString- WKT representation of a multipoint
- Returns:
- MultiPoint object
 
- 
wktStringToMultiLineStringpublic static org.locationtech.jts.geom.MultiLineString wktStringToMultiLineString(String wktString) Converts WKT representation of a multilinestring to aMultiLineStringobject.- Parameters:
- wktString- WKT representation of a multi polyline
- Returns:
- MultiLineString object
 
- 
wktStringToMultiPolygonConverts WKT representation of a multipolygon to aMultiPolygonobject.- Parameters:
- wktString- WKT representation of a multi polygon
- Returns:
- MultiPolygon object
 
- 
getGeometryFactorypublic static org.locationtech.jts.geom.GeometryFactory getGeometryFactory()Creates aGeometryFactoryhaving EPSG:4326 spatial-reference ID.- Returns:
- GeometryFactory
 
- 
createPointpublic static org.locationtech.jts.geom.Point createPoint(double x, double y) Creates a point with the given coordinates.Delegates creating PointtoGeometryFactoryinitialized with EPSG:4326.- Parameters:
- x- the x-value
- y- the y-value
- Returns:
- Point object
 
- 
createLineStringpublic static org.locationtech.jts.geom.LineString createLineString(org.locationtech.jts.geom.Coordinate[] coordinates) Creates aLineStringusing the given coordinates.Delegates creating LineStringtoGeometryFactoryinitialized with EPSG:4326.- Parameters:
- coordinates- an array without null elements
- Returns:
- linestring object
 
- 
createPolygonpublic static org.locationtech.jts.geom.Polygon createPolygon(org.locationtech.jts.geom.Coordinate[] shell) Creates aPolygonwith the given exterior boundary.Delegates creating PolygontoGeometryFactoryinitialized with EPSG:4326.- Parameters:
- shell- the outer boundary of the new Polygon
- Returns:
- a polygon object
 
- 
createMultiPointpublic static org.locationtech.jts.geom.MultiPoint createMultiPoint(org.locationtech.jts.geom.Point[] points) Creates aMultiPointusing the givenPoints.Delegates creating MultiPointtoGeometryFactoryinitialized with EPSG:4326.- Parameters:
- points- an array of Points (without null elements)
- Returns:
- a multipoint
 
- 
createMultiLineStringpublic static org.locationtech.jts.geom.MultiLineString createMultiLineString(org.locationtech.jts.geom.LineString[] lineStrings) Creates aMultiLineStringusing the givenLineStrings.Delegates creating MultiLineStringtoGeometryFactoryinitialized with EPSG:4326.- Parameters:
- lineStrings- array of linestrings
- Returns:
- a multilinestring
 
- 
createMultiPolygonpublic static org.locationtech.jts.geom.MultiPolygon createMultiPolygon(org.locationtech.jts.geom.Polygon[] polygons) Creates aMultiPolygonusing the givenPolygons.Delegates creating MultiPolygontoGeometryFactoryinitialized with EPSG:4326.- Parameters:
- polygons- array of polygons
- Returns:
- a multipolygon
 
 
-