Class MapPonctualElement

    • Constructor Detail

      • MapPonctualElement

        public MapPonctualElement​(UUID id,
                                  double geoX,
                                  double geoY)
        Create a new map element.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        geoX - is a location component of the point in the geo-referenced space.
        geoY - is a location component of the point in the geo-referenced space.
        Since:
        4.0
      • MapPonctualElement

        public MapPonctualElement​(UUID id,
                                  Point2D<?,​?> geo_location)
        Create a new map element.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        geo_location - is a location component of the point in the geo-referenced space.
        Since:
        4.0
      • MapPonctualElement

        public MapPonctualElement​(UUID id,
                                  AttributeCollection attributeSource,
                                  double geoX,
                                  double geoY)
        Create a new map element.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeSource - is the provider of the attributes for this element.
        geoX - is a location component of the point in the geo-referenced space.
        geoY - is a location component of the point in the geo-referenced space.
        Since:
        4.0
      • MapPonctualElement

        public MapPonctualElement​(UUID id,
                                  AttributeCollection attributeSource,
                                  Point2D<?,​?> geo_location)
        Create a new map element.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeSource - is the provider of the attributes for this element.
        geo_location - is a location component of the point in the geo-referenced space.
        Since:
        4.0
    • Method Detail

      • equals

        @Pure
        public boolean equals​(MapElement element)
        Description copied from class: MapElement
        Replies if the specified objects is the same as this one.
        Specified by:
        equals in class MapElement
        Parameters:
        element - the element to compare to.
        Returns:
        true if the given element is equal to this object, otherwise false
      • getGeoLocation

        @Pure
        public GeoLocation getGeoLocation()
        Description copied from interface: GISPrimitive
        Replies the geo-location.

        A GeoLocation 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 equal GeoLocations.

        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()) );
         
        Returns:
        a location
        See Also:
        GISPrimitive.getGeoId(), GISPrimitive.getGeoLocation()
      • getPoint

        @Pure
        public Point2d getPoint()
        Replies the point coordinates.
        Returns:
        the point
      • getX

        @Pure
        public double getX()
        Replies the x coordinate of the point.
        Returns:
        x
      • getY

        @Pure
        public double getY()
        Replies the y coordinate of the point.
        Returns:
        y
      • setLocation

        public void setLocation​(double x,
                                double y)
        Set the position of this point.
        Parameters:
        x - x coordinate
        y - y coordinate
      • setLocation

        public void setLocation​(Point2D<?,​?> location)
        Set the position of this point.
        Parameters:
        location - the point.
      • distance

        @Pure
        public <OT extends MapPonctualElement> double distance​(OT another_point)
        Replies the distance between this MapPoint and another_point.

        Equivalent to:

         return another_point.distance(getX(),getY());
         
        Type Parameters:
        OT - is the type of the given point.
        Parameters:
        another_point - another point.
        Returns:
        the distance between the given point and this point.
      • getDistance

        @Pure
        public double getDistance​(Point2D<?,​?> point)
        Description copied from class: MapElement
        Replies the distance between this MapElement and point.
        Specified by:
        getDistance in class MapElement
        Parameters:
        point - the point to compute the distance to.
        Returns:
        the distance. Should be negative depending of the MapElement type.
      • contains

        @Pure
        public boolean contains​(Point2D<?,​?> point,
                                double delta)
        Replies if the specified point (x,y) was inside the figure of this MapElement.
        Specified by:
        contains in class MapElement
        Parameters:
        point - is a geo-referenced coordinate
        delta - is the geo-referenced distance that corresponds to a approximation distance in the screen coordinate system
        Returns:
        true if the specified point has a distance nearest than delta to this element, otherwise false