Class Feature
- java.lang.Object
-
- org.openstreetmap.josm.data.imagery.vectortile.mapbox.Feature
-
-
Field Summary
Fields Modifier and Type Field Description private List<CommandInteger>
geometry
The geometry of the feature.private static byte
GEOMETRY_FIELD
private static byte
GEOMETRY_TYPE_FIELD
private Geometry
geometryObject
private GeometryTypes
geometryType
The geometry type of the feature.private long
id
The id of the feature.private static byte
ID_FIELD
private static byte
TAG_FIELD
private TagMap
tags
The tags of the feature.
-
Constructor Summary
Constructors Constructor Description Feature(Layer layer, ProtobufRecord record)
Create a new Feature
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CommandInteger>
getGeometry()
Get the geometry instructionsGeometry
getGeometryObject()
Get the an object with shapes for the geometryGeometryTypes
getGeometryType()
Get the geometry typelong
getId()
Get the id of the objectTagMap
getTags()
Get the tagsprivate String
parseTagValue(String key, Layer layer, Number number)
Parse a tag valueString
toString()
-
-
-
Field Detail
-
ID_FIELD
private static final byte ID_FIELD
- See Also:
- Constant Field Values
-
TAG_FIELD
private static final byte TAG_FIELD
- See Also:
- Constant Field Values
-
GEOMETRY_TYPE_FIELD
private static final byte GEOMETRY_TYPE_FIELD
- See Also:
- Constant Field Values
-
GEOMETRY_FIELD
private static final byte GEOMETRY_FIELD
- See Also:
- Constant Field Values
-
geometry
private final List<CommandInteger> geometry
The geometry of the feature. Required.
-
geometryType
private final GeometryTypes geometryType
The geometry type of the feature. Required.
-
id
private final long id
The id of the feature. Optional.
-
geometryObject
private Geometry geometryObject
-
-
Constructor Detail
-
Feature
public Feature(Layer layer, ProtobufRecord record) throws IOException
Create a new Feature- Parameters:
layer
- The layer the feature is part of (required for tags)record
- The record to create the feature from- Throws:
IOException
- - if an IO error occurs
-
-
Method Detail
-
parseTagValue
private String parseTagValue(String key, Layer layer, Number number)
Parse a tag value- Parameters:
key
- The current key (ornull
, ifnull
, the returned value will be the new key)layer
- The layer with key/value informationnumber
- The number to get the value from- Returns:
- The new key (if
null
, then a value was parsed and added to tags)
-
getGeometry
public List<CommandInteger> getGeometry()
Get the geometry instructions- Returns:
- The geometry
-
getGeometryType
public GeometryTypes getGeometryType()
Get the geometry type- Returns:
- The
GeometryTypes
-
getId
public long getId()
Get the id of the object- Returns:
- The unique id in the layer, or 0.
-
getGeometryObject
public Geometry getGeometryObject()
Get the an object with shapes for the geometry- Returns:
- An object with usable geometry information
- Throws:
IllegalArgumentException
- if the geometry object cannot be created because arguments are not understood or the shoelace formula returns 0 for a polygon ring.
-
-