Class JTSUtil
java.lang.Object
io.jmix.mapsui.widget.leaflet.util.JTSUtil
Helper methods to convert between JTS geometry types and v-leaflet objects.
The CRF is expected to be WGS84 (~EPSG:4326 ~ GPS coordinates) in both directions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Bounds
getBounds
(org.locationtech.jts.geom.Geometry geometry) static Bounds
toBounds
(org.locationtech.jts.geom.Coordinate... coordinates) static Bounds
toBounds
(org.locationtech.jts.geom.Point topLeft, org.locationtech.jts.geom.Point bottomRight) static LeafletLayer
static LeafletLayer
toLayer
(org.locationtech.jts.geom.Geometry geom) Translates a JTSGeometry
to aLeafletLayer
.static Collection<LeafletLayer>
toLayers
(org.locationtech.jts.geom.Geometry geom) Translates between a JTSGeometry
and one or moreLeafletLayer
sstatic Point
toLeafletPoint
(org.locationtech.jts.geom.Point location) static Point[]
toLeafletPointArray
(org.locationtech.jts.geom.LineString path) static org.locationtech.jts.geom.LinearRing
toLinearRing
(LPolyline polyline) static org.locationtech.jts.geom.LineString
toLineString
(LPolyline polyline) static org.locationtech.jts.geom.LineString
toLineString
(Point[] points) static LMarker
toLMarker
(org.locationtech.jts.geom.Point point) Translates between aPoint
and aLMarker
static org.locationtech.jts.geom.Point
static org.locationtech.jts.geom.Point
static Point[]
toPointArray
(org.locationtech.jts.geom.Coordinate[] coords) Translates between an array of v-leafletPoint
s and JTSCoordinate
sstatic org.locationtech.jts.geom.Polygon
static LPolygon
toPolygon
(org.locationtech.jts.geom.LinearRing linearRing) Translates between a JTSLinearRing
and a v-leafletLPolygon
static LPolygon
toPolygon
(org.locationtech.jts.geom.Polygon polygon) Translates between a JTSPolygon
and a v-leafletLPolygon
static LPolyline
toPolyline
(org.locationtech.jts.geom.LineString lineString) Translates between a JTSLineString
and a v-leafletPolyline
-
Constructor Details
-
JTSUtil
public JTSUtil()
-
-
Method Details
-
toLayer
Translates a JTSGeometry
to aLeafletLayer
. If given geometry maps to multiple LeafletLayers they are returned in a LLayerGroup.- Parameters:
geom
-Geometry
- Returns:
- the layer built based on JTS
Geometry
-
toLayers
Translates between a JTSGeometry
and one or moreLeafletLayer
s- Parameters:
geom
-Geometry
- Returns:
- a collection of layers built from JTS
Geometry
-
toLMarker
Translates between aPoint
and aLMarker
- Parameters:
point
- the point to be translated into marker- Returns:
- LMarker in given JTS Point
-
toPolyline
Translates between a JTSLineString
and a v-leafletPolyline
- Parameters:
lineString
- the linestring to be converted into polyline- Returns:
- LPolyline with points form given
LineString
-
toPolygon
Translates between a JTSPolygon
and a v-leafletLPolygon
- Parameters:
polygon
- the JTS polygon to be translated into polygon layer- Returns:
- LPolygon with points form given
Polygon
-
toPolygon
Translates between a JTSLinearRing
and a v-leafletLPolygon
- Parameters:
linearRing
- the JTS linearring to be translated to polygon layer- Returns:
- LPolygon with points form given
LinearRing
-
toPointArray
Translates between an array of v-leafletPoint
s and JTSCoordinate
s- Parameters:
coords
- the coordinate array to be translated into v-leaflet projects internal Point data type- Returns:
- point array from given JTS
Coordinate
s
-
toLeafletPointArray
-
toLineString
-
toLinearRing
-
toPolygon
-
toPoint
-
toLeafletPoint
-
getBounds
-
toBounds
-
toBounds
public static Bounds toBounds(org.locationtech.jts.geom.Point topLeft, org.locationtech.jts.geom.Point bottomRight) -
toLayer
public static LeafletLayer toLayer(String wellKnownText) throws org.locationtech.jts.io.ParseException - Throws:
org.locationtech.jts.io.ParseException
-