I have been following the steps on the page http://www.aerospike.com/docs/guide/geospatial.html.
So I have an index:
CREATE INDEX my_geo_index ON test.demoset (geobin) GEO2DSPHERE
I inserted data with Java. This is an example:
aql> select geobin from test.demoset where PK = 5
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| geobin |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "{"type":"Polygon","coordinates":[[[-0.151416025313,51.51273574101],[-0.151416025313,51.51722724101],[-0.144198435331,51.51722724101],[-0.144198435331,51.51273574101],[-0.151416025313,51.51273574101]]]}" |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 secs)
However, when I attempt to query in aql I get no results:
SELECT * from test.demoset WHERE geobin CONTAINS CAST('{"type": "Point", "coordinates": [-0.149223, 51.514275]}' AS GEOJSON)
0 rows in set (0.001 secs)
That point is within the polygon in the select above.
Similarly when I query with the Java API, using the geoContains filter, I get no results.
Please let me know what I’m doing wrong!