I suspect I may be misunderstanding what you are trying to do. If you
want to query for keys from the above view such that: a < doc.lat < b
and x < doc.lng < y, then I think you can do just that:

startkey = [a, x]
endkey = [b, y]


Thanks guys. Yes, using arrays clearly wasn't doing the job after a little bit of experimentation - I thought there might have been some 'trick' I was
missing.

Volker, if you could point me to your code I would like to try it out. This is a 'must have' thing for me as without it, it's pretty much impossible to
use couchdb for my app. Yes, I could do two queries from the browser but
paying for unwanted data across the wire and putting extra load on the
browser is not a solution for me.

Bounding box is all I need and I could scrape by without anything else
for the time being so I'd be happy to try GeoCouch. The link to Paul Davis' external2 couchdb branch from the link you provided goes nowhere on github by the way.

Cheers, Tim



This will also bring back rows with eg the key [b, w] which is outside
the wanted range.

The simple answer is to have two maps: one by lat and one by long, and
query them both, intersecting to find the rows in both queries (or
more simply to just query for a longitude range and filter the results
by lattitude.) This is not very efficient and hence there are
dedicated strategies for geo indexing.

GeoCouch is probably the best solution, or you could do the work to
integrate another geographic indexer. Adding alternate indexers to
CouchDB is about as simple as can be, so don't be put off by the idea.

Is that what you want?


+ seth




--
Chris Anderson
http://jchrisa.net
http://couch.io

Tim Burgess
[email protected]

Kyoto Podcast - Glimpses of Japan
www.kyotopodcast.jp



Reply via email to