Class HilbertPartitioning

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int[] splits
      The splits.
    • Constructor Summary

      Constructors 
      Constructor Description
      HilbertPartitioning​(List<org.locationtech.jts.geom.Envelope> samples, org.locationtech.jts.geom.Envelope boundary, int partitions)
      Instantiates a new hilbert partitioning.
    • Field Detail

      • splits

        protected int[] splits
        The splits.
    • Constructor Detail

      • HilbertPartitioning

        public HilbertPartitioning​(List<org.locationtech.jts.geom.Envelope> samples,
                                   org.locationtech.jts.geom.Envelope boundary,
                                   int partitions)
                            throws Exception
        Instantiates a new hilbert partitioning.
        Parameters:
        samples - the sample list
        boundary - the boundary
        partitions - the partitions
        Throws:
        Exception - the exception
    • Method Detail

      • computeHValue

        public static int computeHValue​(int n,
                                        int x,
                                        int y)
        Compute H value.
        Parameters:
        n - the n
        x - the x
        y - the y
        Returns:
        the int
      • locationMapping

        public static int locationMapping​(double axisMin,
                                          double axisLocation,
                                          double axisMax)
        Location mapping.
        Parameters:
        axisMin - the axis min
        axisLocation - the axis location
        axisMax - the axis max
        Returns:
        the int
      • gridID

        public static int gridID​(org.locationtech.jts.geom.Envelope boundary,
                                 org.locationtech.jts.geom.Envelope spatialObject,
                                 int[] partitionBounds)
                          throws Exception
        Grid ID.
        Parameters:
        boundary - the boundary
        spatialObject - the spatial object
        partitionBounds - the partition bounds
        Returns:
        the int
        Throws:
        Exception - the exception
      • updateEnvelope

        public static org.locationtech.jts.geom.Envelope updateEnvelope​(org.locationtech.jts.geom.Envelope envelope,
                                                                        org.locationtech.jts.geom.Envelope spatialObject)
                                                                 throws Exception
        Update envelope.
        Parameters:
        envelope - the envelope
        spatialObject - the spatial object
        Returns:
        the envelope
        Throws:
        Exception - the exception
      • createFromHValues

        protected void createFromHValues​(int[] hValues,
                                         int partitions)
        Creates the from H values.
        Parameters:
        hValues - the h values
        partitions - the partitions
      • getPartitionBounds

        public int[] getPartitionBounds()
        Gets the partition bounds.
        Returns:
        the partition bounds
      • getGrids

        public List<org.locationtech.jts.geom.Envelope> getGrids()
        Gets the grids.
        Returns:
        the grids