Object/Class

org.locationtech.geomesa.utils.geohash

RectangleGeoHashIterator

Related Docs: class RectangleGeoHashIterator | package geohash

Permalink

object RectangleGeoHashIterator

Iterates over the GeoHashes at a fixed resolution within a given rectangle. The difference between this iterator and the default iteration available through GeoHash is that this iterator considers only those GeoHashes known to be inside the bounding rectangle.

The GeoHash is a combination of hashes of its two dimensions, latitude and longitude; the total precision of the GeoHash is defined as a fixed number of bits.

Each bit represents an interval-halving decision. The first longitude bit, then, is interpreted as follows: a 0 means that the target longitude is on the interval [0, 180); a 1 means its on [180, 360]. The first two bits together define a cell that is 90 degrees wide; the first three bits together define a cell that is 45 degrees wide, etc.

The bit-strings from the two dimensions are interleaved (they alternate), beginning with longitude, so a GeoHash of 10110 (read Lon-Lat-Lon-Lat-Lon) consists of three bits of longitude (110) and two bits of latitude (01). The following is an example of how the GeoHashes (at 5-bits precision) progress:

Longitude 000 001 010 011 100 101 110 111 ----- ----- ----- ----- ----- ----- ----- ----- 11 | 01010 01011 01110 01111 11010 11011 11110 11111 10 | 01000 01001 01100 01101 11000 11001 11100 11101 01 | 00010 00011 00110 00111 10010 10011 10110 10111 00 | 00000 00001 00100 00101 10000 10001 10100 10101

Each cell in this example is 45 degrees wide and 45 degrees high (since longitude ranges over [0,360], and latitude only goes from [-90,90]).

Note that the dimension-specific bit-strings proceed in order (longitude from 0 to 7; latitude from 0 to 3) along each axis. That allows us to work on these bit-strings as coordinate indexes, making it simple to iterate over the GeoHashes within a rectangle (and make some estimates about in-circle membership).

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RectangleGeoHashIterator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val OFFSET_DEGREES: Double

    Permalink

    Offset, in degrees, by which the LL and UR corners are perturbed to make sure they don't fall on GeoHash boundaries (that may be shared between GeoHashes).

  5. def apply(geometry: Geometry, precision: Int): RectangleGeoHashIterator

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped