public final class JtsAdapter extends Object
Geometry to 'Mapbox Vector Tile' objects.| Constructor and Description |
|---|
JtsAdapter() |
| Modifier and Type | Method and Description |
|---|---|
static TileGeomResult |
createTileGeom(org.locationtech.jts.geom.Geometry g,
org.locationtech.jts.geom.Envelope tileEnvelope,
org.locationtech.jts.geom.GeometryFactory geomFactory,
MvtLayerParams mvtLayerParams,
IGeometryFilter filter)
Create geometry clipped and then converted to MVT 'extent' coordinates.
|
static TileGeomResult |
createTileGeom(List<org.locationtech.jts.geom.Geometry> g,
org.locationtech.jts.geom.Envelope tileEnvelope,
org.locationtech.jts.geom.Envelope clipEnvelope,
org.locationtech.jts.geom.GeometryFactory geomFactory,
MvtLayerParams mvtLayerParams,
IGeometryFilter filter)
Create geometry clipped and then converted to MVT 'extent' coordinates.
|
static TileGeomResult |
createTileGeom(List<org.locationtech.jts.geom.Geometry> g,
org.locationtech.jts.geom.Envelope tileEnvelope,
org.locationtech.jts.geom.GeometryFactory geomFactory,
MvtLayerParams mvtLayerParams,
IGeometryFilter filter)
Create geometry clipped and then converted to MVT 'extent' coordinates.
|
static List<org.locationtech.jts.geom.Geometry> |
flatFeatureList(org.locationtech.jts.geom.Geometry geom)
Recursively convert a
Geometry, which may be an instance of GeometryCollection with mixed
element types, into a flat list containing only the following Geometry types: |
static List<VectorTile.Tile.Feature> |
toFeatures(Collection<org.locationtech.jts.geom.Geometry> flatGeoms,
MvtLayerProps layerProps,
IUserDataConverter userDataConverter)
Convert a flat list of JTS
Geometry to a list of vector tile features. |
static List<VectorTile.Tile.Feature> |
toFeatures(org.locationtech.jts.geom.Geometry geometry,
MvtLayerProps layerProps,
IUserDataConverter userDataConverter)
Convert JTS
Geometry to a list of vector tile features. |
static VectorTile.Tile.GeomType |
toGeomType(org.locationtech.jts.geom.Geometry geometry)
Get the MVT type mapping for the provided JTS Geometry.
|
public static TileGeomResult createTileGeom(org.locationtech.jts.geom.Geometry g, org.locationtech.jts.geom.Envelope tileEnvelope, org.locationtech.jts.geom.GeometryFactory geomFactory, MvtLayerParams mvtLayerParams, IGeometryFilter filter)
Uses the same tile and clipping coordinates. May cause rendering issues on boundaries for polygons or line geometry depending on styling.
g - original 'source' geometrytileEnvelope - world coordinate bounds for tilegeomFactory - creates a geometry for the tile envelopemvtLayerParams - specifies vector tile propertiesfilter - geometry values that fail filter after transforms are removedTileGeomResultpublic static TileGeomResult createTileGeom(List<org.locationtech.jts.geom.Geometry> g, org.locationtech.jts.geom.Envelope tileEnvelope, org.locationtech.jts.geom.GeometryFactory geomFactory, MvtLayerParams mvtLayerParams, IGeometryFilter filter)
Create geometry clipped and then converted to MVT 'extent' coordinates. Result contains both clipped geometry (intersection) and transformed geometry for encoding to MVT.
Uses the same tile and clipping coordinates. May cause rendering issues on boundaries for polygons or line geometry depending on styling.
g - original 'source' geometry, passed through flatFeatureList(Geometry)tileEnvelope - world coordinate bounds for tilegeomFactory - creates a geometry for the tile envelopemvtLayerParams - specifies vector tile propertiesfilter - geometry values that fail filter after transforms are removedTileGeomResultpublic static TileGeomResult createTileGeom(List<org.locationtech.jts.geom.Geometry> g, org.locationtech.jts.geom.Envelope tileEnvelope, org.locationtech.jts.geom.Envelope clipEnvelope, org.locationtech.jts.geom.GeometryFactory geomFactory, MvtLayerParams mvtLayerParams, IGeometryFilter filter)
Create geometry clipped and then converted to MVT 'extent' coordinates. Result contains both clipped geometry (intersection) and transformed geometry for encoding to MVT.
Allows specifying separate tile and clipping coordinates. clipEnvelope can be bigger than
tileEnvelope to have geometry exist outside the MVT tile extent.
g - original 'source' geometry, passed through flatFeatureList(Geometry)tileEnvelope - world coordinate bounds for tile, used for transformsclipEnvelope - world coordinates to clip tile bygeomFactory - creates a geometry for the tile envelopemvtLayerParams - specifies vector tile propertiesfilter - geometry values that fail filter after transforms are removedTileGeomResultpublic static VectorTile.Tile.GeomType toGeomType(org.locationtech.jts.geom.Geometry geometry)
geometry - JTS Geometry to get MVT type forVectorTile.Tile.GeomType#UNKNOWNpublic static List<org.locationtech.jts.geom.Geometry> flatFeatureList(org.locationtech.jts.geom.Geometry geom)
Recursively convert a Geometry, which may be an instance of GeometryCollection with mixed
element types, into a flat list containing only the following Geometry types:
PointLineStringPolygonMultiPointMultiLineStringMultiPolygonWARNING: Any other Geometry types that were not mentioned in the list above will be discarded!
Useful for converting a generic geometry into a list of simple MVT-feature-ready geometries.
geom - geometry to flattenpublic static List<VectorTile.Tile.Feature> toFeatures(org.locationtech.jts.geom.Geometry geometry, MvtLayerProps layerProps, IUserDataConverter userDataConverter)
Convert JTS Geometry to a list of vector tile features.
The Geometry should be in MVT coordinates.
Each geometry will have its own ID.
geometry - JTS geometry to convertlayerProps - layer properties for tagging featuresuserDataConverter - convert Geometry.getUserData() to MVT feature tagsflatFeatureList(Geometry),
createTileGeom(Geometry, Envelope, GeometryFactory, MvtLayerParams, IGeometryFilter)public static List<VectorTile.Tile.Feature> toFeatures(Collection<org.locationtech.jts.geom.Geometry> flatGeoms, MvtLayerProps layerProps, IUserDataConverter userDataConverter)
Convert a flat list of JTS Geometry to a list of vector tile features.
The Geometry should be in MVT coordinates.
Each geometry will have its own ID.
flatGeoms - flat list of JTS geometry (in MVT coordinates) to convertlayerProps - layer properties for tagging featuresuserDataConverter - convert Geometry.getUserData() to MVT feature tagsflatFeatureList(Geometry),
createTileGeom(Geometry, Envelope, GeometryFactory, MvtLayerParams, IGeometryFilter)Copyright © 2022. All rights reserved.