Class MapPolylineGridSet<P extends MapPolyline>

    • Constructor Detail

      • MapPolylineGridSet

        public MapPolylineGridSet​(int nRows,
                                  int nColumns,
                                  double boundsX,
                                  double boundsY,
                                  double boundsWidth,
                                  double boundsHeight)
        Constructor.
        Parameters:
        nRows - numbers of rows in the grid
        nColumns - numbers of columns in the grid
        boundsX - is the bounds of the scene.
        boundsY - is the bounds of the scene.
        boundsWidth - is the bounds of the scene.
        boundsHeight - is the bounds of the scene.
      • MapPolylineGridSet

        public MapPolylineGridSet​(int nRows,
                                  int nColumns,
                                  Rectangle2d bounds)
        Constructor.
        Parameters:
        nRows - numbers of rows in the grid
        nColumns - numbers of columns in the grid
        bounds - are the bounds of the scene stored inside this tree.
    • Method Detail

      • add

        public boolean add​(P polyline,
                           double precision,
                           OutputParameter<P> firstNeighbour,
                           OutputParameter<P> secondNeighbour)
        Description copied from interface: GISPolylineSet
        Add the selected polyline inside the tree and replies the two nearest polylines that are already inside the tree.
        Specified by:
        add in interface GISPolylineSet<P extends MapPolyline>
        Parameters:
        polyline - is the polyline to add
        precision - is the precision (in meters) used to detect the neighbours.
        firstNeighbour - is one of the two nearest polylines that could be connected to the new segment.
        secondNeighbour - is one of the two nearest polylines that could be connected to the new segment.
        Returns:
        true if successfully added, false otherwise
      • getNearestEnd

        @Pure
        public final P getNearestEnd​(double x,
                                     double y)
        Description copied from interface: GISPolylineSet
        Replies the object that has the nearest end to the specified point.
        Specified by:
        getNearestEnd in interface GISPolylineSet<P extends MapPolyline>
        Parameters:
        x - is the position from which the nearest primitive must be replied.
        y - is the position from which the nearest primitive must be replied.
        Returns:
        the nearest element or null if none.