Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 7964 invoked from network); 4 Mar 2009 11:39:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Mar 2009 11:39:11 -0000 Received: (qmail 22796 invoked by uid 500); 4 Mar 2009 11:39:09 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 22591 invoked by uid 500); 4 Mar 2009 11:39: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 22580 invoked by uid 99); 4 Mar 2009 11:39:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Mar 2009 03:39:06 -0800 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=SPF_PASS,WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dantheman@gmail.com designates 209.85.218.163 as permitted sender) Received: from [209.85.218.163] (HELO mail-bw0-f163.google.com) (209.85.218.163) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Mar 2009 11:39:00 +0000 Received: by bwz7 with SMTP id 7so3357170bwz.11 for ; Wed, 04 Mar 2009 03:38:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=ReKj4+fvsAHOVq2uoh0oFYQp3c0Q2oSpPjsKFNkLYnU=; b=jWGZeGtA5NCRhfPJbgdu4v0xG+s1h5yGNg6g3G/oPCsDp3+05AWeEqyK7iRPGeGU0N ru2IRXyEMUSFcYV8UzyMBcygnq6QEy7mLxoSeqbsYSW1o1kwkgCAl63dZpxuMklcOFaw SpNr0zDNSJ6bmI17zKUfMi5lCcDAhLNDPS7tg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=MKQkQiMnNsoY3fL/c+/MZqr6K9cvzy+H58KyI7Le540iRYizBf+GXoNfX09wDIJ7/E t8Bp71K/syYwWvyPaQG2+BZHvYRj/J8Hyq9oPpIayp6y4GrqSuollaZxEtMlVhAy5AxQ AUfmP4To0n1byxZsvJ4E9e+kOODFJJsnK2Vw4= MIME-Version: 1.0 Sender: dantheman@gmail.com Received: by 10.223.105.72 with SMTP id s8mr7196979fao.9.1236166718245; Wed, 04 Mar 2009 03:38:38 -0800 (PST) In-Reply-To: <20090304111938.GC16406@banot.net> References: <20090304111938.GC16406@banot.net> Date: Wed, 4 Mar 2009 06:38:38 -0500 X-Google-Sender-Auth: bacbec320527cb77 Message-ID: <7a236b8b0903040338o443f68dkaabdf9710e938be0@mail.gmail.com> Subject: Re: Filtering a cloud of points From: Daniel Gagne To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Not sure if this is the best, or a workable solution , I haven't tried it, but it may lead to one. If you look at : http://wiki.apache.org/couchdb/View_collation?action=3Dshow&redirect=3DView= Collation It shows how views are collated at the bottom. The example you posted could be solved by doing 3 requests - all points in each row, and then combining them in your code: startkey=3D[[1],[0]]&endkey=3D[[1],[5]] startkey=3D[[2],[0]]&endkey=3D[[2],[5]] startkey=3D[[3],[0]]&endkey=3D[[3],[5]] Hope that helps, danny On Wed, Mar 4, 2009 at 6:19 AM, Manuel Padr=F3n Mar=E1rt=EDnez wrote: > Hi : > > I have a problem with views (again). I have a cloud of points in a 2d spa= ce, I mean each point has X > and Y position, and each point is in a document: > > { > =A0"Point": > =A0 =A0 =A0{ > =A0 =A0 =A0 =A0"X":20, > =A0 =A0 =A0 =A0"Y":30 > =A0 =A0 =A0} > } > > I need to make a view to filter a region of space, I mean all the points = between X0-X1 and Y0-Y1. > I've tried to make a view like this: > > MAP: > function(doc) { > =A0emit([[doc.X],[doc.Y]], doc); > } > > And tried to filter with start - end key (for example : startkey=3D[[1],[= 0]]&endkey=3D[[3],[5]]) but I > get points that are out of region (like [[1][9]]). > I've also tried with objects, simple vectos ([X,Y]) and still the same re= sults. > > Anyone knows how to solve it? There any way ? Or should I make a view for= X coordinate, another for Y > coordinate and try to make a ""join"" in my program? > > Thanks in advance > > Manuel Padr=F3n Mart=EDnez >