Class GeoId

  • All Implemented Interfaces:
    Serializable, Comparable<GeoId>

    public final class GeoId
    extends Object
    implements Serializable, Comparable<GeoId>
    An unique identifier of a Geo-referenced element.

    A geoId is an identifier from which the localization could be extracted. The location is here restricted to the bounds of the primitives.

    A Geo-Id is unique according to the geo-location of the element. If two elements have the same points in the same order, or if two elements have the same points in a reverse order, they must have the same Geo-Id.

    This class calls GeoLocation.GeoLocation.toGeoId().

    The following code is always true (where the arguments of the constructors are the list of points of the polyline). It illustrates that for two elements with the same geo-localized points, they have the same geo-location identifier (Geo-Id) and they have different unique ientifier (Uid):

    
     GISElement obj1 = new MapPolyline(100,10,200,30,300,4);
     GISElement obj2 = new MapPolyline(100,10,200,30,300,4);
     assert( obj1.getGeoId().equals(obj2.getGeoId()) );
     assert( obj2.getGeoId().equals(obj1.getGeoId()) );
     assert( ! obj1.getUid().equals(obj2.getUid()) );
     assert( ! obj2.getUid().equals(obj1.getUid()) );
     
    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:53
    Author:
    Stéphane GALLAND
    See Also:
    Serialized Form
    Maven Group Id:
    org.arakhne.afc.gis
    Maven Artifact Id:
    giscore
    • Constructor Detail

      • GeoId

        GeoId​(String id)
        Constructor.
        Parameters:
        id - is a unique identifier.
      • GeoId

        GeoId​(double lowerx,
              double lowery,
              double upperx,
              double uppery,
              String id)
        Constructor.
        Parameters:
        lowerx - is the lowest x-coordinate of the bounds.
        lowery - is the lowest y-coordinate of the bounds.
        upperx - is the uppest x-coordinate of the bounds.
        uppery - is the uppest y-coordinate of the bounds.
        id - is a unique identifier.
    • Method Detail

      • valueOf

        @Pure
        public static GeoId valueOf​(String geoId)
        Parse the given string to extract a GeoId.

        This function never fails but may replied a geoid without bounds.

        Parameters:
        geoId - the identifier.
        Returns:
        a geoid instance.
      • toUUID

        @Pure
        public UUID toUUID()
        Replies the UUID representation of the geo-reference identifier.
        Returns:
        the UUID representation of the geo-reference identifier.
      • equals

        @Pure
        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode()
        Overrides:
        hashCode in class Object
      • toBounds2D

        @Pure
        public Rectangle2d toBounds2D()
        Extract the primitive bounds from this geoId.

        A geoId is an identifier from which the localization could be extracted. The location is here restricted to the bounds of the primitives.

        Returns:
        a rectangle or null if invalid geoid.
      • getInternalId

        @Pure
        public String getInternalId()
        Extract the unique identifier stored in this geoId.
        Returns:
        the internal identifier or null if this geoid has invalid format.