Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudant Geospatial query

I'm new to cloudant, i want to fetch records by lat and long with particular category.

//This is getting records by Lat and Long

dbname/_design/ad/_geo/geoidx?lat=29.2609417&lon=71.1750101&radius=100

but i want to fetch records by particular category something like this...

dbname/_design/ad/_geo/geoidx?lat=22.2609417&lon=73.1750101&radius=100&item_type_id: '12345'

how can i achieve this? please reply... Thanks..

like image 803
Mohammed Sufyan Shaikh Avatar asked Mar 27 '26 02:03

Mohammed Sufyan Shaikh


1 Answers

You can't achieve this using the Cloudant Geo index. You need to use Cloudant Search (powered by Lucene Geo), which allows you to combine a radius search with attribute search. Here's a tutorial: https://developer.ibm.com/clouddataservices/2016/01/07/geospatial-query-with-cloudant-search/

The only caveat is with Cloudant Search you can only do bounding box and radius searches -- no polygon searches.

like image 122
Raj Avatar answered Mar 31 '26 07:03

Raj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!