Class VectorFeature

java.lang.Object
com.codename1.maps.vector.VectorFeature

public final class VectorFeature extends Object

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).

  • Field Details

    • GEOM_UNKNOWN

      public static final int GEOM_UNKNOWN
      Unknown / empty geometry.
      See Also:
    • GEOM_POINT

      public static final int GEOM_POINT
      One or more points.
      See Also:
    • GEOM_LINESTRING

      public static final int GEOM_LINESTRING
      One or more polylines.
      See Also:
    • GEOM_POLYGON

      public static final int GEOM_POLYGON
      One or more polygon rings.
      See Also:
  • 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.