Is there anyway to query geo polygon region inside another polygon

Aerospike Server Version - 3.16.0.6

I am trying out following query -

I have 2 records in database, one having Point in a bin “gj” and another records having polygon. This bin “gj” has GEOJSON type index.

aql> select * from test.demo

+---------------------------------------------------------------------------------------+
| gj                                                                                    |
+---------------------------------------------------------------------------------------+
| GeoJSON('{"type": "Polygon", "coordinates": [[[2,2], [3,2], [3,3], [2,3], [2,2]]] }') |
| GeoJSON('{"type": "Point", "coordinates": [2, 2]}')                                   |
+---------------------------------------------------------------------------------------+
2 rows in set (0.821 secs)

But, When I am executing following query

aql> SELECT * FROM test.demo WHERE gj WITHIN GEOJSON('{"type": "Polygon", "coordinates": [[[1,1], [4,1], [4,4], [1,4], [1,1]]] }'))
+-----------------------------------------------------+
| gj                                                  |
+-----------------------------------------------------+
| GeoJSON('{"type": "Point", "coordinates": [2, 2]}') |
+-----------------------------------------------------+
1 row in set (0.005 secs)

It is only returning records having bin “gj” as Point. It doesn’t return the record having the Polygon type, though that polygon is completely inside the query polygon.

Does Aerospike support polygon inside polygon type of GEOJSON queries?

1 Like

We are also facing a similar problem. Is there a way to query a polygon inside a polygon or a region inside a region ?

No. Aerospike does not support querying for polygons/region in a polygon/region. We only support 2 types for now.

  1. Points in a region
  2. Region containing/covering a point.