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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BoundsgetBounds(org.locationtech.jts.geom.Geometry geometry) static BoundstoBounds(org.locationtech.jts.geom.Coordinate... coordinates) static BoundstoBounds(org.locationtech.jts.geom.Point topLeft, org.locationtech.jts.geom.Point bottomRight) static LeafletLayerstatic LeafletLayertoLayer(org.locationtech.jts.geom.Geometry geom) Translates a JTSGeometryto aLeafletLayer.static Collection<LeafletLayer>toLayers(org.locationtech.jts.geom.Geometry geom) Translates between a JTSGeometryand one or moreLeafletLayersstatic PointtoLeafletPoint(org.locationtech.jts.geom.Point location) static Point[]toLeafletPointArray(org.locationtech.jts.geom.LineString path) static org.locationtech.jts.geom.LinearRingtoLinearRing(LPolyline polyline) static org.locationtech.jts.geom.LineStringtoLineString(LPolyline polyline) static org.locationtech.jts.geom.LineStringtoLineString(Point[] points) static LMarkertoLMarker(org.locationtech.jts.geom.Point point) Translates between aPointand aLMarkerstatic org.locationtech.jts.geom.Pointstatic org.locationtech.jts.geom.Pointstatic Point[]toPointArray(org.locationtech.jts.geom.Coordinate[] coords) Translates between an array of v-leafletPoints and JTSCoordinatesstatic org.locationtech.jts.geom.Polygonstatic LPolygontoPolygon(org.locationtech.jts.geom.LinearRing linearRing) Translates between a JTSLinearRingand a v-leafletLPolygonstatic LPolygontoPolygon(org.locationtech.jts.geom.Polygon polygon) Translates between a JTSPolygonand a v-leafletLPolygonstatic LPolylinetoPolyline(org.locationtech.jts.geom.LineString lineString) Translates between a JTSLineStringand a v-leafletPolyline
-
Constructor Details
-
JTSUtil
public JTSUtil()
-
-
Method Details
-
toLayer
Translates a JTSGeometryto 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 JTSGeometryand one or moreLeafletLayers- Parameters:
geom-Geometry- Returns:
- a collection of layers built from JTS
Geometry
-
toLMarker
Translates between aPointand aLMarker- Parameters:
point- the point to be translated into marker- Returns:
- LMarker in given JTS Point
-
toPolyline
Translates between a JTSLineStringand a v-leafletPolyline- Parameters:
lineString- the linestring to be converted into polyline- Returns:
- LPolyline with points form given
LineString
-
toPolygon
Translates between a JTSPolygonand 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 JTSLinearRingand 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-leafletPoints and JTSCoordinates- Parameters:
coords- the coordinate array to be translated into v-leaflet projects internal Point data type- Returns:
- point array from given JTS
Coordinates
-
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
-