Trouble With Spatial Query in AQL

geoindexing
geo

#1

Hi all,

I am unable to get the following to work in AQL. The query returns all results, disregarding the WHERE predicate. Java API works fine. Any thoughts? Thanks in advance.

// Aerospike Community Edition build 3.15.0.2

// Aerospike Tools Version 3.15.0.3

// AQL Version 3.15.0.3

// insert some data

aql> INSERT INTO test.geotest(PK,name,location) VALUES (1, “ACME Corp”, CAST(’{“type”:“Point”,“coordinates”:[-115.2592775,36.2744193]}’ AS GEOJSON))

aql> INSERT INTO test.geotest(PK,name,location) VALUES (2, “Stark Industries”, CAST(’{“type”:“Point”,“coordinates”:[-115.1610773,36.1300541]}’ AS GEOJSON))

aql> INSERT INTO test.geotest(PK,name,location) VALUES (3, “Wayne Enterprises”, CAST(’{“type”:“Point”,“coordinates”:[-115.1371557,36.1255425]}’ AS GEOJSON))

// create geospatial index

aql> CREATE INDEX geotest_index ON test.geotest (location) GEO2DSPHERE

// query the results

aql> SELECT name FROM test.geotest WHERE location WITHIN CAST(’{“type”:“AeroCircle”,“coordinates”:[[-115.1610773,36.1300541],100}’ AS GEOJSON)

*************************** 1. row ***************************

name: “ACME Corp”

*************************** 2. row ***************************

name: “Wayne Enterprises”

*************************** 3. row ***************************

name: “Stark Industries”

3 rows in set (0.180 secs)