Class Feature
java.lang.Object
org.openstreetmap.josm.data.imagery.vectortile.mapbox.Feature
A Feature for a
Layer- Since:
- 17862
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]private final List<CommandInteger>The geometry of the feature.private static final byteprivate static final byteprivate Geometryprivate final GeometryTypesThe geometry type of the feature.private final longThe id of the feature.private static final byteprivate static final NumberFormatThe number format instance to use (using a static instance gets rid of quite o few allocations) Doing this reduced the allocations ofparseTagValue(String, Layer, int, List)from 22.79% of parent to 12.2% of parent.private static final byteprivate final TagMapThe tags of the feature. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the geometry instructionsGet the an object with shapes for the geometryGet the geometry typelonggetId()Get the id of the objectgetTags()Get the tagsprivate static StringparseTagValue(String key, Layer layer, int number, List<String> tagList) Parse a tag valuetoString()
-
Field Details
-
ID_FIELD
- See Also:
-
TAG_FIELD
- See Also:
-
GEOMETRY_TYPE_FIELD
- See Also:
-
GEOMETRY_FIELD
- See Also:
-
NUMBER_FORMAT
The number format instance to use (using a static instance gets rid of quite o few allocations) Doing this reduced the allocations ofparseTagValue(String, Layer, int, List)from 22.79% of parent to 12.2% of parent. -
EMPTY_STRING_ARRAY
-
geometry
The geometry of the feature. Required. -
geometryType
The geometry type of the feature. Required. -
id
The id of the feature. Optional. -
tags
The tags of the feature. Optional. -
geometryObject
-
-
Constructor Details
-
Feature
Create a new Feature- Parameters:
layer- The layer the feature is part of (required for tags)protobufRecord- The record to create the feature from- Throws:
IOException- - if an IO error occurs
-
-
Method Details
-
parseTagValue
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 fromtagList- The list to add the new value to- Returns:
- The new key (if
null, then a value was parsed and added to tags)
-
getGeometry
Get the geometry instructions- Returns:
- The geometry
-
getGeometryType
Get the geometry type- Returns:
- The
GeometryTypes
-
getId
Get the id of the object- Returns:
- The unique id in the layer, or 0.
-
getTags
Get the tags- Returns:
- A tag map
-
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.
-
toString
-