incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Burgess <>
Subject Re: Retrieving documents that have a latitude and longitude intersection
Date Sun, 14 Jun 2009 22:17:47 GMT
>> 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 < < 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  
bit of experimentation - I thought there might have been some 'trick'  
I was

Volker, if you could point me to your code I would like to try it out.  
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  
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

Tim Burgess

Kyoto Podcast - Glimpses of Japan

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message