SET key id [FIELD name value ...] [EX seconds] [NX|XX] (OBJECT geojson)|(POINT lat lon [z])|(BOUNDS minlat minlon maxlat maxlon)|(HASH geohash)|(STRING value)
Set the value of an id. If a value is already associated to that key/id, it’ll be overwritten.
Set a simple point in latitude, longitude.
A point with Z coordinate. This is application specific such as elevation, or a timestamp, etc.
A minimum bounding rectangle. The values are (southwest latitude, southwest longitude, northeast latitude, northeast longitude).
A Geohash. A geohash is a convenient way of expressing a location (anywhere in the world) using a short alphanumeric string, with greater precision obtained with longer strings.
A GeoJSON object. GeoJSON is an industry standard format for representing a variety of object types including a point, multipoint, linestring, multilinestring, polygon, multipolygon, geometrycollection, feature, and featurecollection. Tile38 supports all of the standards with these exceptions.
- The crs member is not supported and will be ignored. The CRS84/WGS84 projection is assumed.
- Any member that is not recognized (including crs) will be ignored.
- All coordinates can be 2 or 3 axes. Less than 2 axes or more than 3 will result in a parsing error.
* All ignored members will not persist.
Important to note that all GeoJSON coordinates are in Longitude, Latitude order.
SET supports a set of options that modify its behavior:
- EX seconds – Set the specified expire time, in seconds.
- NX – Only set the object if it does not already exist.
- XX – Only set the object if it already exist.
Fields are extra data which belongs to an object. A field is always a double precision floating point. There is no limit to the number of fields that an object can have.
To set a field when setting an object.
It’s also possible to set a field when an object already exists. See FSET.
A z coordinate allows for optimized range queries for values such as Elevation and Timestamps.
To set the z coordinate:
Now queries can search the z coordinate by treating it as a field:
Which will look for all points that are within 100 kilometers of 33,-115 and have a
z coordinate between -15 and 130.
notice the lowercase
z in the WHERE clause