Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 55403 invoked from network); 14 Jun 2009 23:04:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jun 2009 23:04:57 -0000 Received: (qmail 96637 invoked by uid 500); 14 Jun 2009 23:05:07 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 96563 invoked by uid 500); 14 Jun 2009 23:05:07 -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 96553 invoked by uid 99); 14 Jun 2009 23:05:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jun 2009 23:05:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of volker.mische@gmail.com designates 72.14.220.155 as permitted sender) Received: from [72.14.220.155] (HELO fg-out-1718.google.com) (72.14.220.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jun 2009 23:04:55 +0000 Received: by fg-out-1718.google.com with SMTP id l27so434413fgb.3 for ; Sun, 14 Jun 2009 16:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=8uQHHH7Bvz+K/sXdAX21JnNgWJQvCs2gPnxXv4aLnU0=; b=ExoZWZZOHk9pQIpI70PhpZVBV0il8zisPWsSZdRmaiGyik+QAw6jVTsxtNuJC5TQwP wFJRWnlnC1mFEvU8wDvwagHpb9gy+T3x3GAmo07KBz/KCUR+gGpT1e3WPyI7i0dviyFO 2SjPAoGYfxwO58cvS9W1uIfDVMQ8DYL0lErEQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=puU52oMxCke4yV2e1BncSwlW4NZQkHBe5SfoxYiJH1XjWBIkb50iydtAoN7GZeh5FG Tqc7l0Ti8mawAVPJ4E7oVo/wlh7W7YcWHbEqbXC2hPnCwMxOdnW8JiSc0FHNKp3uvs7j Mbmk+F+cD58pvNOifnmWUr+EoQzIY7astpSNs= Received: by 10.86.65.18 with SMTP id n18mr6173428fga.25.1245020675224; Sun, 14 Jun 2009 16:04:35 -0700 (PDT) Received: from ?192.168.0.136? (dslb-084-056-058-227.pools.arcor-ip.net [84.56.58.227]) by mx.google.com with ESMTPS id 12sm9253037fgg.20.2009.06.14.16.04.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 14 Jun 2009 16:04:34 -0700 (PDT) Message-ID: <4A358200.6050409@gmail.com> Date: Mon, 15 Jun 2009 01:04:32 +0200 From: Volker Mische User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Tim Burgess CC: user@couchdb.apache.org Subject: Re: Retrieving documents that have a latitude and longitude intersection References: <2C1A5D65-F929-42B8-93CE-A9BB68C8D1DA@mac.com> <8508f1c80906141226i2be52f9dt2556c3c1a3d30e15@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org GeoCouch 0.0.1 doesn't solve your problem, only the current code base I have does. I'll to put some basic documentation together asap, and drop you a mail with these instructions (off-list). Cheers, Volker Tim Burgess wrote: >>> >>> 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 > timburgess@mac.com > > Kyoto Podcast - Glimpses of Japan > www.kyotopodcast.jp > > >