azure cosmosdb - DocumentDB Spatial Distance Query - Empty Set -


i trying valid result following documentdb spatial query.

in both linq or sql -

select * root  (st_distance(root["address"]["location"]["queryable"],  {"type": "point", "coordinates": [-36.******, 174.******]}) < 10000)  

...and/or:

feedoptions queryoptions = new feedoptions { maxitemcount = -1, enablescaninquery = true }; iqueryable<store> documentquery = client.createdocumentquery<store>( urifactory.createdocumentcollectionuri(this.databasename, this.collection), queryoptions) .where(s => s.address.location.queryable.distance(store.address.location.queryable) < 10000); 

...both approaches give me same result - empty set.

but there 2 "store" documents in database should resolved query.

my db instance in australia east - should fine apparently.

what doing wrong here? collection not have spatial index on - required?

in geojson, points specified [longitude, latitude] make match our normal expectations of x being east-west, , y being north-south. unfortunately, opposite of traditional way of showing geo coordinates.

174.xxx not valid value latitude. range latitude -90 +90. longitude specified -180 +180.

swap coordinates , should work expected.


Comments