Class NFERTreeSpatialModel

  • All Implemented Interfaces:
    NFESpatialModel

    public class NFERTreeSpatialModel
    extends java.lang.Object
    implements NFESpatialModel
    An implementation of NFESpatialModel that uses R-tree indices
    • Constructor Detail

      • NFERTreeSpatialModel

        public NFERTreeSpatialModel​(NFEModel model)
        Allocates a new spatial model associated to the given NFE model
        Parameters:
        model - the current NFE model
    • Method Detail

      • addNetworkElementIndex

        public boolean addNetworkElementIndex​(NFENetworkElement netElem)
        Description copied from interface: NFESpatialModel
        Spatially-indexes a network element
        Specified by:
        addNetworkElementIndex in interface NFESpatialModel
        Parameters:
        netElem - a network element instance
        Returns:
        true if the element could be indexed
      • refreshNetworkElementIndex

        public boolean refreshNetworkElementIndex​(NFENetworkElement netElem)
        Description copied from interface: NFESpatialModel
        Refreshes the spatial index of the network element to reflect its actual geometry. It should be called whenever the element's geometry changes.
        Specified by:
        refreshNetworkElementIndex in interface NFESpatialModel
        Parameters:
        netElem - a network element instance
        Returns:
        true if the index could be refreshed.
      • getNetworkElements

        public java.util.Collection<NFENetworkElement> getNetworkElements​(java.awt.geom.Point2D point,
                                                                          double tolerance)
        Description copied from interface: NFESpatialModel
        Gets all the network elements interacting with the given point.
        Specified by:
        getNetworkElements in interface NFESpatialModel
        Parameters:
        point - a spatial point in moodel's coordinate system
        tolerance - the maximum distance an element can be from the target geometry to be considered in the result.
        Returns:
        a collection containing all the network elements interacting with the point
      • getNetworkElements

        public java.util.Collection<NFENetworkElement> getNetworkElements​(java.awt.geom.Rectangle2D rect)
        Description copied from interface: NFESpatialModel
        Gets all the network elements interacting with the given rectangle.
        Specified by:
        getNetworkElements in interface NFESpatialModel
        Parameters:
        rect - a rectangle in model's coordinate system
        Returns:
        a collection containing all the network elements interacting with the rectangle
      • getNetworkElements

        public java.util.Collection<NFENetworkElement> getNetworkElements​(java.awt.geom.Area area)
        Description copied from interface: NFESpatialModel
        Gets all the network elements interacting with the given area.
        Specified by:
        getNetworkElements in interface NFESpatialModel
        Parameters:
        area - an area in model's coordinate system
        Returns:
        a collection containing all the network elements interacting with the area
      • getFeatureElements

        public java.util.Collection<NFEFeatureElement> getFeatureElements​(java.awt.geom.Point2D point,
                                                                          double tolerance)
        Description copied from interface: NFESpatialModel
        Gets all the feature elements interacting with the given point.
        Specified by:
        getFeatureElements in interface NFESpatialModel
        Parameters:
        point - a spatial point in moodel's coordinate system
        tolerance - the maximum distance an element can be from the target geometry to be considered in the result.
        Returns:
        a collection containing all the feature elements interacting with the point
      • getFeatureElements

        public java.util.Collection<NFEFeatureElement> getFeatureElements​(java.awt.geom.Rectangle2D rect)
        Description copied from interface: NFESpatialModel
        Gets all the feature elements interacting with the given rectangle.
        Specified by:
        getFeatureElements in interface NFESpatialModel
        Parameters:
        rect - a rectangle in model's coordinate system
        Returns:
        a collection containing all the feature elements interacting with the rectangle
      • getFeatureElements

        public java.util.Collection<NFEFeatureElement> getFeatureElements​(java.awt.geom.Area area)
        Description copied from interface: NFESpatialModel
        Gets all the feature elements interacting with the given area.
        Specified by:
        getFeatureElements in interface NFESpatialModel
        Parameters:
        area - an area in model's coordinate system
        Returns:
        a collection containing all the feature elements interacting with the area
      • getFeatureElements

        public java.util.Collection<NFEFeatureElement> getFeatureElements​(java.awt.geom.Point2D point,
                                                                          double tolerance,
                                                                          long featLayerId)
        Description copied from interface: NFESpatialModel
        Gets all the feature elements interacting with the given point. Only the elements that belong to the given feature layer are retrieved.
        Specified by:
        getFeatureElements in interface NFESpatialModel
        Parameters:
        point - a spatial point in moodel's coordinate system
        tolerance - the maximum distance an element can be from the target geometry to be considered in the result.
        featLayerId - only feature elements from this feature layer are returned.
        Returns:
        a collection containing all the feature elements interacting with the point
      • getFeatureElements

        public java.util.Collection<NFEFeatureElement> getFeatureElements​(java.awt.geom.Rectangle2D rect,
                                                                          long featLayerId)
        Description copied from interface: NFESpatialModel
        Gets all the feature elements interacting with the given rectangle. Only the elements that belong to the given feature layer are retrieved.
        Specified by:
        getFeatureElements in interface NFESpatialModel
        Parameters:
        rect - a rectangle in model's coordinate system
        featLayerId - only feature elements from this feature layer are returned.
        Returns:
        a collection containing all the feature elements interacting with the rectangle
      • getFeatureElements

        public java.util.Collection<NFEFeatureElement> getFeatureElements​(java.awt.geom.Area area,
                                                                          long featLayerId)
        Description copied from interface: NFESpatialModel
        Gets all the feature elements interacting with the given area. Only the elements that belong to the given feature layer are retrieved.
        Specified by:
        getFeatureElements in interface NFESpatialModel
        Parameters:
        area - an area in model's coordinate system
        featLayerId - only feature elements from this feature layer are returned.
        Returns:
        a collection containing all the feature elements interacting with the area