Class: Geohash

Geohash()

A Geohash Model represents a single geohash.

Constructor

new Geohash()

Since:
  • 2.25.0
Source:

Extends

  • Backbone.Model

Members

defaults :Object

Default attributes for Geohash models. Note that attributes like precision, bounds, etc. are all calculated on the fly during the get method.
Type:
  • Object
Properties:
Name Type Attributes Description
hashString string The hashString of the geohash.
properties Object <optional>
An object containing arbitrary properties associated with the geohash. (e.g. count values from SolrResults)
Source:

type :string

The name of this type of model
Type:
  • string
Source:

type :string

The name of this type of model. This will be updated to 'CesiumVectorData' upon initialization.
Type:
  • string
Source:

Methods

addProperty(key, value)

Set a property on the geohash.
Parameters:
Name Type Description
key string The key of the property to set.
value * The value of the property to set.
Source:

createCesiumModel(recreateopt)

Create the Cesium model for the geohashes.
Parameters:
Name Type Attributes Default Description
recreate Boolean <optional>
false Set to true to recreate the Cesium model.
Source:

geodeticToECEF(coord) → {Array}

Convert geodetic coordinates to Earth-Centered, Earth-Fixed (ECEF) coordinates.
Parameters:
Name Type Description
coord Object The geodetic coordinates, an array of longitude and latitude.
Source:
Returns:
The ECEF coordinates.
Type
Array

get(attr) → {*}

Overwrite the get method to calculate bounds, point, precision, and arbitrary properties on the fly.
Parameters:
Name Type Description
attr string The attribute to get the value of.
Source:
Returns:
The value of the attribute.
Type
*

getBounds() → {Array|null}

Get the bounds of the geohash "tile".
Source:
Returns:
An array containing the bounds of the geohash.
Type
Array | null

getCZML(limitToExtentopt) → {Object}

Returns the CZML representation of the geohashes.
Parameters:
Name Type Attributes Default Description
limitToExtent Boolean <optional>
true Set to false to return the CZML for all geohashes, not just those in the current extent.
Since:
  • 2.25.0
Source:
Returns:
The CZML representation of the geohashes.
Type
Object

getChildGeohashes(keepPropertiesopt) → {Array.<Geohash>}

Get the 32 child geohashes of the geohash.
Parameters:
Name Type Attributes Default Description
keepProperties boolean <optional>
false If true, the child geohashes will have the same properties as the parent geohash.
Source:
Returns:
An array of Geohash models.
Type
Array.<Geohash>

getGeoData(geometry) → {Object|null}

Get the data from this model that is needed to create geometries for various formats of geospacial data, like GeoJSON and CZML.
Parameters:
Name Type Description
geometry string The type of geometry to get. Can be "rectangle", "point", or "both".
Source:
Returns:
An object with the keys "rectangle", "point", and "properties".
Type
Object | null

getGeoJSON(limitToExtentopt) → {Object}

Returns the GeoJSON representation of the geohashes.
Parameters:
Name Type Attributes Default Description
limitToExtent Boolean <optional>
true Set to false to return the GeoJSON for all geohashes, not just those in the current extent.
Since:
  • 2.25.0
Source:
Returns:
The GeoJSON representation of the geohashes.
Type
Object

getGeohashGroup()

Get all geohashes that belong in the same complete group of 32 geohashes.
Source:

getGeohashes(limitToExtentopt) → {Geohashes}

Get the geohash collection and optionally reduce it to only those geohashes that are within the current map extent, and to no more than the specified amount.
Parameters:
Name Type Attributes Default Description
limitToExtent boolean <optional>
true Whether to limit the geohashes to those that are within the current map extent.
Source:
Returns:
The geohashes to display.
Type
Geohashes

getGeohashesForExtent() → {Geohashes}

Get the geohashes that are currently in the map's extent.
Since:
  • 2.25.0
Source:
Returns:
The geohashes in the current extent.
Type
Geohashes

getGroupID(level) → {string}

Get the group ID of the geohash at the specified level.
Parameters:
Name Type Description
level number The number of levels to go up from the current geohash.
Source:
Returns:
The group ID of the geohash at the specified level.
Type
string

getParentGeohash(keepPropertiesopt) → {Geohash|null}

Get the parent geohash of the geohash.
Parameters:
Name Type Attributes Default Description
keepProperties boolean <optional>
false If true, the parent geohash will have the same properties as this child geohash.
Source:
Returns:
A Geohash model or null if the geohash is empty.
Type
Geohash | null

getPoint() → {Object|null}

Get the center point of the geohash.
Source:
Returns:
Returns object with latitude and longitude keys.
Type
Object | null

getPrecision() → {number}

Get the associated precision level for the current camera height. Required that a mapModel be set on the model. If one is not set, then the minimum precision from the geohash collection will be returned.
Since:
  • 2.25.0
Source:
Returns:
The precision level.
Type
number

getPrecision() → {number|null}

Get the precision of the geohash.
Source:
Returns:
The precision of the geohash.
Type
number | null

getProperty(key) → {*}

Get a property from the geohash.
Parameters:
Name Type Description
key string The key of the property to get.
Source:
Returns:
The value of the property.
Type
*

getPropertyOfInterest() → {string}

Get the property that we want the geohashes to display, e.g. count.
Since:
  • 2.25.0
Source:
Returns:
The property of interest.
Type
string

getViewExtent() → {GeoBoundingBox}

Get the current map extent from the Map Interaction model.
Source:
Returns:
The current map extent
Type
GeoBoundingBox

initialize(assetConfigopt)

Executed when a new CesiumGeohash model is created.
Parameters:
Name Type Attributes Description
assetConfig MapConfig#MapAssetConfig <optional>
The initial values of the attributes, which will be set on the model.
Source:

isEmpty() → {boolean}

Checks if the geohash is empty. It is considered empty if it has no hashString set.
Source:
Returns:
true if the geohash is empty, false otherwise.
Type
boolean

isParentOf(hashString)

Checks if this geohash contains the given geohash
Parameters:
Name Type Description
hashString string The hashString of the geohash to check.
Source:

isProperty(key) → {boolean}

Checks if the geohash has a property with the given key.
Parameters:
Name Type Description
key string The key to check for.
Source:
Returns:
True if the geohash has a property with the given key, false otherwise.
Type
boolean

removeProperty(key)

Remove a property from the geohash.
Parameters:
Name Type Description
key string The key of the property to remove.
Source:

replaceGeohashes(geohashes)

Replace the collection of geohashes to display on the map with a new set.
Parameters:
Name Type Description
geohashes Array.<Geohash> | Array.<Object> The new set of geohash models to display or attributes for the new geohash models.
Since:
  • 2.25.0
Source:

selectGeohashes(geohash)

Find the geohash Entity on the map and add it to the selected features.
Parameters:
Name Type Description
geohash string The geohash to select.
Since:
  • 2.25.0
Source:

startListening()

Update and re-render the geohashes when the collection of geohashes changes.
Since:
  • 2.25.0
Source:

stopListeners()

Stop the model from listening to itself for changes.
Since:
  • 2.25.0
Source:

toCZML(label) → {Object}

Get the geohash as a CZML Feature.
Parameters:
Name Type Description
label string The key for the property to display as a label.
Source:
Returns:
A CZML Feature representing the geohash, including a polygon of the geohash area and a label with the value of the property specified by the label parameter.
Type
Object

toGeoJSON() → {Object}

Get the geohash as a GeoJSON Feature.
Source:
Returns:
A GeoJSON Feature representing the geohash.
Type
Object

updateColorRangeValues()

For the property of interest (e.g. count) Get the min and max values from the geohashes collection and update the color palette.
Since:
  • 2.25.0
Source: