public final class GeoUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MIN_COORDINATES_POLYGON
The minimum amount of coordinates (lat/lon counted separately) required for a valid closed polygon.
|
static int |
MIN_NODES_POLYGON
The minimum amount of nodes required for a valid closed polygon.
|
| Modifier and Type | Method and Description |
|---|---|
static com.vividsolutions.jts.geom.Geometry |
clipToTile(TDWay way,
com.vividsolutions.jts.geom.Geometry geometry,
TileCoordinate tileCoordinate,
int enlargementInMeters)
Clips a geometry to a tile.
|
static short |
computeBitmask(com.vividsolutions.jts.geom.Geometry geometry,
TileCoordinate tile,
int enlargementInMeter)
A tile on zoom level z has exactly 16 sub tiles on zoom level z+2.
|
static org.mapsforge.core.model.LatLong |
computeCentroid(com.vividsolutions.jts.geom.Geometry geometry) |
static boolean |
coveredByTile(com.vividsolutions.jts.geom.Geometry geometry,
TileCoordinate tile,
int enlargementInMeter) |
static org.mapsforge.core.model.BoundingBox |
mapWayToBoundingBox(TDWay way) |
static com.vividsolutions.jts.geom.Polygon |
mapWayToPolygon(TDWay way) |
static java.util.Set<TileCoordinate> |
mapWayToTiles(TDWay way,
byte baseZoomLevel,
int enlargementInMeter)
Computes which tiles on the given base zoom level need to include the given way (which may be a polygon).
|
static boolean |
pointInTile(org.mapsforge.core.model.LatLong latLong,
TileCoordinate tile) |
static com.vividsolutions.jts.geom.Geometry |
simplifyGeometry(TDWay way,
com.vividsolutions.jts.geom.Geometry geometry,
byte zoomlevel,
int tileSize,
double simplificationFactor)
Simplifies a geometry using the Douglas Peucker algorithm.
|
static java.util.List<WayDataBlock> |
toWayDataBlockList(com.vividsolutions.jts.geom.Geometry geometry)
Convert a JTS Geometry to a WayDataBlock list.
|
public static final int MIN_COORDINATES_POLYGON
public static final int MIN_NODES_POLYGON
public static com.vividsolutions.jts.geom.Geometry clipToTile(TDWay way, com.vividsolutions.jts.geom.Geometry geometry, TileCoordinate tileCoordinate, int enlargementInMeters)
way - the waygeometry - the geometrytileCoordinate - the tile coordinateenlargementInMeters - the bounding box bufferpublic static short computeBitmask(com.vividsolutions.jts.geom.Geometry geometry,
TileCoordinate tile,
int enlargementInMeter)
geometry - the geometry which is analyzedtile - the tile which is split into 16 sub tilesenlargementInMeter - amount of pixels that is used to enlarge the bounding box of the way and the tiles in the mapping
processpublic static org.mapsforge.core.model.LatLong computeCentroid(com.vividsolutions.jts.geom.Geometry geometry)
geometry - the JTS Geometry objectpublic static boolean coveredByTile(com.vividsolutions.jts.geom.Geometry geometry,
TileCoordinate tile,
int enlargementInMeter)
geometry - a JTS Geometry object representing the OSM entitytile - the tileenlargementInMeter - the enlargement of the tile in meterspublic static org.mapsforge.core.model.BoundingBox mapWayToBoundingBox(TDWay way)
way - the TDWaypublic static com.vividsolutions.jts.geom.Polygon mapWayToPolygon(TDWay way)
way - the TDWaypublic static java.util.Set<TileCoordinate> mapWayToTiles(TDWay way, byte baseZoomLevel, int enlargementInMeter)
way - the way that is mapped to tilesbaseZoomLevel - the base zoom level which is used in the mappingenlargementInMeter - amount of pixels that is used to enlarge the bounding box of the way and the tiles in the mapping
processpublic static boolean pointInTile(org.mapsforge.core.model.LatLong latLong,
TileCoordinate tile)
latLong - the pointtile - the tilepublic static com.vividsolutions.jts.geom.Geometry simplifyGeometry(TDWay way, com.vividsolutions.jts.geom.Geometry geometry, byte zoomlevel, int tileSize, double simplificationFactor)
way - the waygeometry - the geometryzoomlevel - the zoom levelsimplificationFactor - the simplification factorpublic static java.util.List<WayDataBlock> toWayDataBlockList(com.vividsolutions.jts.geom.Geometry geometry)
geometry - a geometry object which should be converted