couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manolo Padron Martinez <>
Subject Re: Retrieving documents that have a latitude and longitude intersection
Date Sun, 14 Jun 2009 12:02:41 GMT
I've been trying to do complex searchs (like two ranged variables) and
the solution for me was to use couch-lucene
( to index the documents. If
anyone has a better solution that could be done only with chouch would
be great to hear about it.

Regards from Canary Islands

Manuel Padrón Martínez

On Sun, Jun 14, 2009 at 9:12 AM, Tim Burgess<> wrote:
> I've run up couchdb and am trying to use it to serve JSON requests from a
> browser javascript application (using google maps).
> I've been doing this with MySQL and RoR but the replication and the ability
> to simply add image attachments is very appealing to me.
> Essentially the client-side requests points that fall within a given
> latitude and longitude boundary i.e. a southwest lat, long and a northeast
> lat,long.
> These are my first steps with map/reduce but I've determined how I can use
> startkey and endkey to pull documents within a latitude. I'm
> a bit stumped on a URL query that can do both however.
> A simple view such as;
> function(doc) {
>  if ( && doc.lng) {
>    emit([, doc.lng], [doc._id, doc.rating,,
> doc.description]);
>  }
> }
> I'm fortunate in that I'm only having to deal with an area that doesn't
> cross the equator or prime meridian so essentially I just need to query
> two floats that fall within ranges provided by startkey and endkey. I'd be
> very grateful if someone had some idea as to how to do this..
> Cheers!
> Tim Burgess

View raw message