Class XYGridTree

    • Constructor Detail

      • XYGridTree

        public XYGridTree​(int maxzoom)
        Initialises all zoomlevel up until the given one.
        Parameters:
        maxzoom - the maximum zoom to be used
      • XYGridTree

        public XYGridTree()
    • Method Detail

      • getIds

        public Iterable<CellId> getIds​(long longitude,
                                       long latitude)
        Get CellIds in all zoomlevel for a given point.
        Parameters:
        longitude - Longiude for the given point
        latitude - Latitude for the given point
        Returns:
        An iterator over the cellIds in all zoomlevel
      • getIds

        public Iterable<CellId> getIds​(double longitude,
                                       double latitude)
        Get CellIds in all zoomlevel for a given point.
        Parameters:
        longitude - Longitude for the given point
        latitude - Latitude for the given point
        Returns:
        An iterator over the cellIds in all zoomlevel
      • getInsertId

        public CellId getInsertId​(OSHDBBoundingBox bbox)
        Calculate cell, a line or relation should be stored in.
        Parameters:
        bbox - OSHDBoundingBox for which to get the CellId
        Returns:
        CellId for the given OSHDBBoundingbox
      • bbox2CellIds

        public Iterable<CellId> bbox2CellIds​(OSHDBBoundingBox bbox)
        Query cells for given bbox. The boundingbox is automatically enlarged, so lines and relations are included.
        Parameters:
        bbox - OSHDBBoundingBox for the query
      • bbox2CellIds

        public Iterable<CellId> bbox2CellIds​(OSHDBBoundingBox bbox,
                                             boolean enlarge)
        Get CellIds in all zoomlevel for a given bbox.
        Parameters:
        bbox - OSHDBBoundingBox for the query
        enlarge - true if the query should include enlarged bboxes
      • bbox2CellIdRanges

        public Iterable<XYGridTree.CellIdRange> bbox2CellIdRanges​(OSHDBBoundingBox bbox,
                                                                  boolean enlarge)
        Get CellIds in all zoomlevel for a given bbox.
        Parameters:
        bbox - OSHDBBoundingBox
        enlarge - true to include enlarged bboxes
        Returns:
        List of CellIdRanges which are covered by the given bbox