ejsGeoPoint

A GeoPoint object that can be used in queries and filters that take a GeoPoint. GeoPoint supports various input formats.

See http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html

Module

 GeoPoint

GeoPoint ( p )

Defines a point


Parameters
p <Array> An optional point as an array in [lat, lon] format.

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
Objectarray(a)Sets the GeoPoint from an array point. The array must contain only 2 values. The first value is the lat and the 2nd value is the lon. Example: [41.12, -71.34]
Objectgeohash(hash,precision)Sets the GeoPoint as a GeoHash. The hash is a string of alpha-numeric characters with a precision length that defaults to 12. Example: "drm3btev3e86"
Objectproperties(obj)Sets the GeoPoint as properties on an object. The object must have a 'lat' and 'lon' or a 'geohash' property. Example: {lat: 41.12, lon: -71.34} or {geohash: "drm3btev3e86"}
Objectstring(s)Sets the GeoPoint as a string. The format is "lat,lon". Example: "41.12,-71.34"
StringtoJSON()Retrieves the internal script object. This is typically used by internal API functions so use with caution.

Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 array

Object array ( a )
Sets the GeoPoint from an array point. The array must contain only 2 values. The first value is the lat and the 2nd value is the lon. Example: [41.12, -71.34]

Parameters
a <Array> an array of length 2.
Returns
returns this so that calls can be chained.

 geohash

Object geohash ( hash, precision )
Sets the GeoPoint as a GeoHash. The hash is a string of alpha-numeric characters with a precision length that defaults to 12. Example: "drm3btev3e86"

Parameters
hash <String> an GeoHash as a string
precision <Integer> an optional precision length, defaults to 12 if not specified.
Returns
returns this so that calls can be chained.

 properties

Object properties ( obj )
Sets the GeoPoint as properties on an object. The object must have a 'lat' and 'lon' or a 'geohash' property. Example: {lat: 41.12, lon: -71.34} or {geohash: "drm3btev3e86"}

Parameters
obj <Object> an object with a lat and lon or geohash property.
Returns
returns this so that calls can be chained.

 string

Object string ( s )
Sets the GeoPoint as a string. The format is "lat,lon". Example: "41.12,-71.34"

Parameters
s <String> a String point in "lat,lon" format.
Returns
returns this so that calls can be chained.

 toJSON

String toJSON ( )
Retrieves the internal script object. This is typically used by internal API functions so use with caution.

Returns
returns this object's internal object representation.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo