couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volker Mische <>
Subject Re: Retrieving documents that have a latitude and longitude intersection
Date Sun, 14 Jun 2009 12:48:22 GMT
Hi Tim,

that's a problem GeoCouch [1] tries to solve. The current version that
is online wouldn't work, but I've a version that makes such reuqests
possible (it actually works!).

If you need it immediately, just drop a mail, if you can wait a week or
two, I'll make an new release by then.



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