Class Feature


  • public class Feature
    extends java.lang.Object
    A Feature for a Layer
    Since:
    17862
    • Constructor Detail

      • Feature

        public Feature​(Layer layer,
                       ProtobufRecord protobufRecord)
                throws java.io.IOException
        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:
        java.io.IOException - - if an IO error occurs
    • Method Detail

      • parseTagValue

        private static java.lang.String parseTagValue​(java.lang.String key,
                                                      Layer layer,
                                                      int number,
                                                      java.util.List<java.lang.String> tagList)
        Parse a tag value
        Parameters:
        key - The current key (or null, if null, the returned value will be the new key)
        layer - The layer with key/value information
        number - The number to get the value from
        tagList - The list to add the new value to
        Returns:
        The new key (if null, then a value was parsed and added to tags)
      • getId

        public long getId()
        Get the id of the object
        Returns:
        The unique id in the layer, or 0.
      • getTags

        public TagMap getTags()
        Get the tags
        Returns:
        A tag map
      • getGeometryObject

        public Geometry getGeometryObject()
        Get the an object with shapes for the geometry
        Returns:
        An object with usable geometry information
        Throws:
        java.lang.IllegalArgumentException - if the geometry object cannot be created because arguments are not understood or the shoelace formula returns 0 for a polygon ring.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object