GeoJSON
, defined in RFC , is the format of geo values in Ember Nexus. Requests can also send them as (well-known text), and responses can return WKT on request. Internally, geometries are stored in one format and converted when a response is written.
Geo values are only recognized for properties which the defines with one of the geo types. Without a definition, a GeoJSON object is stored as a plain object and a WKT string as a plain string, without validation, conversion or geo index.
Supported geometries
GeometryCollection and Feature objects are not supported, store each geometry in its own property instead.
Positions are [longitude, latitude], or [longitude, latitude, altitude] for properties with "dimensions": 3, in WGS 84. Longitudes range from -180 to 180 and latitudes from -90 to 90. Rings of polygons have to be closed: their last position equals the first one. The values are checked for their structure and these ranges, not for e.g. self-intersections.
WKT
WKT is accepted as input for every geo property, whatever format the responses use. It is the compact format for ingesting data, e.g. from a spatial database or a CSV export, and may also be used for queries in the future.
- Keywords are case-insensitive, and the
Zmarker is optional for positions with three coordinates:POINT Z (13.4 52.5 34)equalsPOINT (13.4 52.5 34). - An
SRID=4326;prefix is accepted, other reference systems are rejected. MULTIPOINTaccepts positions with and without their own parentheses:MULTIPOINT ((0 0), (1 1))andMULTIPOINT (0 0, 1 1).EMPTYgeometries are not supported.
{ "type": "Place", "data": { "location": "POINT (13.4 52.5)" }}Response format
Responses contain GeoJSON by default. Requests can ask for WKT with the Prefer header of RFC :
GET /<uuid>Prefer: geometry=wkt| Preference | Geo values in the response |
|---|---|
| none | GeoJSON |
geometry=geojson | GeoJSON |
geometry=wkt | WKT strings |
The preference applies to the whole response, every geo value of every element has the same format. Responses which honored a preference carry Preference-Applied: geometry=wkt (or geometry=geojson), unknown preferences and values are ignored. Responses vary by the header, so they carry Vary: Prefer.
The preference is supported by , the collections , , and , and the element step of and . Other search steps work with the internal format.
The ETag of a response in another format than GeoJSON gets the name of the format appended: an element whose ETag is "abcdefg" has the ETag "abcdefg-wkt" in WKT responses, on every endpoint above, whether the element has geo values or not. If-None-Match and If-Match accept both forms, see caching and conditional .
Expressions
Schema , search expressions and the see geo values as GeoJSON, whatever format the request used. The geo of Expr create, convert, measure and compare them, e.g. geoContains(document.area, document.location) or geoFromWkt('POINT (13.4 52.5)'). They check geometries more strictly than writes do: self-intersecting rings, for example, are stored, but fail the geo functions.