Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 48944 invoked from network); 14 Jun 2009 12:03:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jun 2009 12:03:06 -0000 Received: (qmail 56806 invoked by uid 500); 14 Jun 2009 12:03:17 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 56725 invoked by uid 500); 14 Jun 2009 12:03:16 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 56715 invoked by uid 99); 14 Jun 2009 12:03:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jun 2009 12:03:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of manolopm@gmail.com designates 209.85.218.218 as permitted sender) Received: from [209.85.218.218] (HELO mail-bw0-f218.google.com) (209.85.218.218) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jun 2009 12:03:06 +0000 Received: by bwz18 with SMTP id 18so4028127bwz.11 for ; Sun, 14 Jun 2009 05:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Qfq5hd2x3hWI9oBlqubZGr+Zn4+LyYK3ejWIXRcr8Vg=; b=KRPRw4badWEd2gwsK1n9QS4z/lE6PR2beItBmXrjZ0mIK6Pa5uqW5hsLrT4DMlQY8A l7+sWHmrs698HKhHd0JgHgby2uvSXGELfeYOzhrKHmdyCdOzXj1JPGauczlcpLkKsGeB pYfNuZeAjRXKh5+CR3pPwZYo9nIUzHmm105R4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rqKybzKOGdMWTdXsocl4JkQ6G0J2K31dBf/XuN5aqQG5rVafPhvdZNvfQYfHuBrKGI a1FT8QIE1dVr0UUDMcK0C5IjDv+eZXagOFLHU2uNNoJh8qmkm9P69CIWo+3iix9nx6ch byjYomahM0X80Sd2PltDhcEvAc59fJJ4lLQ9A= MIME-Version: 1.0 Received: by 10.223.126.66 with SMTP id b2mr3617457fas.18.1244980963704; Sun, 14 Jun 2009 05:02:43 -0700 (PDT) In-Reply-To: <2C1A5D65-F929-42B8-93CE-A9BB68C8D1DA@mac.com> References: <2C1A5D65-F929-42B8-93CE-A9BB68C8D1DA@mac.com> Date: Sun, 14 Jun 2009 13:02:41 +0100 Message-ID: <55fad2460906140502t7ae153c7l595d9be1ca4e2867@mail.gmail.com> Subject: Re: Retrieving documents that have a latitude and longitude intersection From: Manolo Padron Martinez To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I've been trying to do complex searchs (like two ranged variables) and the solution for me was to use couch-lucene (http://rnewson.github.com/couchdb-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=C3=B3n Mart=C3=ADnez 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 abili= ty > 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 northeas= t > lat,long. > These are my first steps with map/reduce but I've determined how I can us= e > 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) { > =C2=A0if (doc.lat && doc.lng) { > =C2=A0 =C2=A0emit([doc.lat, doc.lng], [doc._id, doc.rating, doc.name, > doc.description]); > =C2=A0} > } > > 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 b= e > very grateful if someone had some idea as to how to do this.. > > Cheers! > > Tim Burgess > timburgess@mac.com >