public final class VectorFeature
- Object
- VectorFeature
A single decoded feature of a Mapbox Vector Tile: its geometry type, its
attribute map, and its geometry as one or more parts in tile-local
coordinates (0..VectorLayer.getExtent, origin top-left).
For GEOM_POINT each part is a flat run of x,y points; for
GEOM_LINESTRING each part is a polyline; for GEOM_POLYGON each part
is a closed ring (exterior rings wind one way, holes the other, per the
MVT spec).
Fields
public static final int GEOM_UNKNOWN = 0 | Unknown / empty geometry. |
public static final int GEOM_POINT = 1 | One or more points. |
public static final int GEOM_LINESTRING = 2 | One or more polylines. |
public static final int GEOM_POLYGON = 3 | One or more polygon rings. |
Methods
public long getId() | The feature id (0 when absent). |
public int getGeometryType() | One of the GEOM_* constants. |
public Map getAttributes() | The feature attributes as a Map<String,Object> (string/number/bool). |
public Object getAttribute(String key) | Convenience accessor for a single attribute, or null. |
public List getParts() | The geometry parts, each an int[] of interleaved x,y tile-local coordinates. |
Inherited methods
Field details
GEOM_UNKNOWN
public static final int GEOM_UNKNOWN = 0Unknown / empty geometry.
GEOM_POINT
public static final int GEOM_POINT = 1One or more points.
GEOM_LINESTRING
public static final int GEOM_LINESTRING = 2One or more polylines.
GEOM_POLYGON
public static final int GEOM_POLYGON = 3One or more polygon rings.
Method details
getId
public long getId()The feature id (0 when absent).
getGeometryType
public int getGeometryType()One of the
GEOM_* constants.getAttributes
public Map getAttributes()The feature attributes as a
Map<String,Object> (string/number/bool).getAttribute
public Object getAttribute(String key)Convenience accessor for a single attribute, or
null.getParts
public List getParts()The geometry parts, each an
int[] of interleaved x,y tile-local
coordinates.