Class GISTreeSetUtil


  • public final class GISTreeSetUtil
    extends Object
    Utilities for GISTreeSet.
    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:53
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.gis
    Maven Artifact Id:
    giscore
    • Method Detail

      • classifies

        @Pure
        public static int classifies​(AbstractGISTreeSetNode<?,​?> node,
                                     GeoLocation location)
        Replies the classificiation of the specified location.
        Parameters:
        node - the classification base.
        location - the point to classify.
        Returns:
        the classificiation of the specified location inside to the node.
      • contains

        @Pure
        static boolean contains​(int region,
                                double cutX,
                                double cutY,
                                double pointX,
                                double pointY)
        Replies if the given region contains the given point.
        Parameters:
        region - is the index of the region.
        cutX - is the cut line of the region parent.
        cutY - is the cut line of the region parent.
        pointX - is the coordinate of the point to classify.
        pointY - is the coordinate of the point to classify.
        Returns:
        true if the point is inside the given region, otherwise false
      • addInside

        static <P extends GISPrimitive,​N extends AbstractGISTreeSetNode<P,​N>> boolean addInside​(AbstractGISTreeSet<P,​N> tree,
                                                                                                            N insertionNode,
                                                                                                            P element,
                                                                                                            GISTreeSetNodeFactory<P,​N> builder)
        Add the given element inside the given node (or one of its children).
        Type Parameters:
        P - is the type of the primitives.
        N - is the type of the nodes.
        Parameters:
        tree - is the tree to update.
        insertionNode - the receiving node.
        element - the element to insert.
        builder - is the node factory.
        Returns:
        success state.
      • normalize

        public static void normalize​(Rectangle2d rect,
                                     Rectangle2afp<?,​?,​?,​?,​?,​?> reference)
        Normalize the given rectangle n to be sure that it has the same coordinates as b when they are closed. This function permits to obtain a bounding rectangle which may be properly used for classification against the given bounds.
        Parameters:
        rect - rectangle to be normalized.
        reference - the reference shape.
      • getNormalizedNodeBuildingBounds

        @Pure
        public static Rectangle2d getNormalizedNodeBuildingBounds​(AbstractGISTreeSetNode<?,​?> node,
                                                                  Rectangle2afp<?,​?,​?,​?,​?,​?> reference)
        Replies the bounds of the area covered by the node and normalize it to fit as well as possible the coordinates of the given reference. The normalization is done by normalize(Rectangle2d, Rectangle2afp).
        Parameters:
        node - is the node for which the bounds must be extracted and reploed.
        reference - is the bounding object which is the reference for the normalization.
        Returns:
        the normalized rectangle.
      • getNodeBuildingBounds

        @Pure
        public static Rectangle2d getNodeBuildingBounds​(AbstractGISTreeSetNode<?,​?> node)
        Replies the bounds of the area covered by the node. The replied rectangle is not normalized.
        Parameters:
        node - is the node for which the bounds must be extracted and reploed.
        Returns:
        the not-normalized rectangle.