DocumentDB: ST_DISTANCE function does not work with '<' (smaller than) sign -


i have working query looks follows:

select p.id place p st_distance(p.geometry, {'type': 'point', 'coordinates':[52.0826443333333, 5.11771783333333]} ) > 6000

it returns list of id's of documents more 6000 m geospatial point. seems fine. however, if turn around '>' (greater than) sign '<' (smaller than), not give result. interestingly, return false/true statements if put clause in select statement, follows:

select st_distance(p.geometry, {'type': 'point', 'coordinates':[52.0826443333333, 5.11771783333333]}) < 6000 result place p

it generates both true , false statements expected. evaluation seems work, not return output. currently, use latter work around, , select computed distances. have compute points within distance somewhere else (like on client side or in stored procedure).

update tested specified index policy (thanks example):

'indexingpolicy': {'includedpaths': [{'path': '/"geometry"/?', 'indexes': [ {'kind': 'spatial', 'datatype': 'linestring'}]}, {'path': '/'}]}

and solved problem. still think odd spatial function did work on 'greater than' , not on 'smaller than', think solved this.

you should specify spatial index on field this:

'indexingpolicy': {     'includedpaths': [         {             'path': '/"geometry"/?',              'indexes': [                 {'kind': 'spatial', 'datatype': 'linestring'}             ]         },          {'path': '/'}     ] } 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -