Geospatial Cylindrical Queries
23 May 2017 01:40 PM
|
|
Introduction At the time of this writing (MarkLogic 9), MarkLogic Server cannot perform spherical queries, as the geospatial indexes do not support a true 3D coordinate system. In situations where cylindrical queries are sufficient, you can create a 2D geospatial index and a separate range index on an altitude value. An "and-query" with these indexes would result in a cylindrical query. Example Consider the following sample document structure:
Configure these 2 indexes for your content database:
Assuming you have data in your content database matching above document structure, this query: will return all the documents with location i.e., points falling in the cylinder with center at 37.655983, -122.425525 having a radius of 1000 miles and with an altitude of less than 4 miles. Note that in MarkLogic Server 9 geospatial region match was introduced, so the above technique can be extended beyond cylinders. | |
|