You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Benoit Chesneau <bc...@gmail.com> on 2010/08/01 10:53:00 UTC

geocouch: limit number of points in an area

I'm looking for a way to limit number of points retrieved for an area
depending on its size. Ie When playing with the zoom on the map I want
to be able to only display and retrieved only main points instead of
all the points in this area. Is there a simple way to do that actually
?

- benoit

Re: geocouch: limit number of points in an area

Posted by Randall Leeds <ra...@gmail.com>.
On Sun, Aug 1, 2010 at 13:54, Volker Mische <vo...@gmail.com> wrote:
> On 01.08.2010 22:48, J Chris Anderson wrote:
>>
>> On Aug 1, 2010, at 1:43 PM, Volker Mische wrote:
>>
>>> On 01.08.2010 17:24, Benoit Chesneau wrote:
>>>>
>>>> On Sun, Aug 1, 2010 at 2:17 PM, Volker Mische<vo...@gmail.com>
>>>> wrote:
>>>>>
>>>>> On 01.08.2010 10:53, Benoit Chesneau wrote:
>>>>>>
>>>>>> I'm looking for a way to limit number of points retrieved for an area
>>>>>> depending on its size. Ie When playing with the zoom on the map I want
>>>>>> to be able to only display and retrieved only main points instead of
>>>>>> all the points in this area. Is there a simple way to do that actually
>>>>>> ?
>>>>>>
>>>>>> - benoit
>>>>>
>>>>> Hi Benoit,
>>>>>
>>>>> there a two ways. Either introducing a "limit" parameter, but that's
>>>>> probably not what you want. It would limit to a arbitrary selection
>>>>> (not the
>>>>> "main points" as you'd like to have it).
>>>>> You probably want clusters. My suggestion is to do it on the client
>>>>> side
>>>>> with OpenLayers' cluster strategy [1][2].
>>>>>
>>>>> [1] http://openlayers.org/dev/examples/strategy-cluster.html
>>>>> [2] http://openlayers.org/dev/examples/strategy-cluster-threshold.html
>>>>>
>>>>> Cheers,
>>>>>  Volker
>>>>>
>>>> This solution doesn't work when you have a lot of points though. Do
>>>> you plan to add such things to geocouch ?
>>>>
>>>
>>> Clustering isn't that easy. I think some layer on top of GeoCouch
>>> should/will be built to handle such things. It can even be in any
>>> programming language and communicate with GeoCouch via HTTP.
>>>
>>
>> If there is a threshold that can be emitted with the points, maybe a _list
>> function is the way to filter it server side.
>>
>
> The problem is, that the points are potentially returned in random order. So
> you never know if there will be a point that is close to anther one at a
> later stage.

I think Chris was referring to a zoom threshold of sorts, which is
independent of nearby points.
R

Re: geocouch: limit number of points in an area

Posted by Volker Mische <vo...@gmail.com>.
On 01.08.2010 22:48, J Chris Anderson wrote:
>
> On Aug 1, 2010, at 1:43 PM, Volker Mische wrote:
>
>> On 01.08.2010 17:24, Benoit Chesneau wrote:
>>> On Sun, Aug 1, 2010 at 2:17 PM, Volker Mische<vo...@gmail.com>   wrote:
>>>> On 01.08.2010 10:53, Benoit Chesneau wrote:
>>>>>
>>>>> I'm looking for a way to limit number of points retrieved for an area
>>>>> depending on its size. Ie When playing with the zoom on the map I want
>>>>> to be able to only display and retrieved only main points instead of
>>>>> all the points in this area. Is there a simple way to do that actually
>>>>> ?
>>>>>
>>>>> - benoit
>>>>
>>>> Hi Benoit,
>>>>
>>>> there a two ways. Either introducing a "limit" parameter, but that's
>>>> probably not what you want. It would limit to a arbitrary selection (not the
>>>> "main points" as you'd like to have it).
>>>> You probably want clusters. My suggestion is to do it on the client side
>>>> with OpenLayers' cluster strategy [1][2].
>>>>
>>>> [1] http://openlayers.org/dev/examples/strategy-cluster.html
>>>> [2] http://openlayers.org/dev/examples/strategy-cluster-threshold.html
>>>>
>>>> Cheers,
>>>>   Volker
>>>>
>>> This solution doesn't work when you have a lot of points though. Do
>>> you plan to add such things to geocouch ?
>>>
>>
>> Clustering isn't that easy. I think some layer on top of GeoCouch should/will be built to handle such things. It can even be in any programming language and communicate with GeoCouch via HTTP.
>>
>
> If there is a threshold that can be emitted with the points, maybe a _list function is the way to filter it server side.
>

The problem is, that the points are potentially returned in random 
order. So you never know if there will be a point that is close to 
anther one at a later stage.

Cheers,
   Volker

Fwd: geocouch: limit number of points in an area

Posted by Benoit Chesneau <bc...@gmail.com>.
I blame gmail. This mail was  for all


---------- Forwarded message ----------
From: Benoit Chesneau <bc...@gmail.com>
Date: Mon, Aug 2, 2010 at 8:34 AM
Subject: Re: geocouch: limit number of points in an area
To: J Chris Anderson <jc...@apache.org>


On Sun, Aug 1, 2010 at 10:48 PM, J Chris Anderson <jc...@apache.org> wrote:

>>
>
> If there is a threshold that can be emitted with the points, maybe a _list function is the way to filter it server side.
>
>> Cheers,
>>  Volker
>>
>>

Hum in this case I will probably use too much cpu, didn't try it. I'm
looking for some papers about the way other indexers works, There
should be some way imo to speed calculation of such cluster depending
on the number of points you want in a zone . So maybe next would be to
add this method to the js api , such things.

- benoit

Re: geocouch: limit number of points in an area

Posted by J Chris Anderson <jc...@apache.org>.
On Aug 1, 2010, at 1:43 PM, Volker Mische wrote:

> On 01.08.2010 17:24, Benoit Chesneau wrote:
>> On Sun, Aug 1, 2010 at 2:17 PM, Volker Mische<vo...@gmail.com>  wrote:
>>> On 01.08.2010 10:53, Benoit Chesneau wrote:
>>>> 
>>>> I'm looking for a way to limit number of points retrieved for an area
>>>> depending on its size. Ie When playing with the zoom on the map I want
>>>> to be able to only display and retrieved only main points instead of
>>>> all the points in this area. Is there a simple way to do that actually
>>>> ?
>>>> 
>>>> - benoit
>>> 
>>> Hi Benoit,
>>> 
>>> there a two ways. Either introducing a "limit" parameter, but that's
>>> probably not what you want. It would limit to a arbitrary selection (not the
>>> "main points" as you'd like to have it).
>>> You probably want clusters. My suggestion is to do it on the client side
>>> with OpenLayers' cluster strategy [1][2].
>>> 
>>> [1] http://openlayers.org/dev/examples/strategy-cluster.html
>>> [2] http://openlayers.org/dev/examples/strategy-cluster-threshold.html
>>> 
>>> Cheers,
>>>  Volker
>>> 
>> This solution doesn't work when you have a lot of points though. Do
>> you plan to add such things to geocouch ?
>> 
> 
> Clustering isn't that easy. I think some layer on top of GeoCouch should/will be built to handle such things. It can even be in any programming language and communicate with GeoCouch via HTTP.
> 

If there is a threshold that can be emitted with the points, maybe a _list function is the way to filter it server side.

> Cheers,
>  Volker
> 
> 


Fwd: geocouch: limit number of points in an area

Posted by Benoit Chesneau <bc...@gmail.com>.
I blame gmail. This mail was  for all


---------- Forwarded message ----------
From: Benoit Chesneau <bc...@gmail.com>
Date: Mon, Aug 2, 2010 at 8:30 AM
Subject: Re: geocouch: limit number of points in an area
To: Volker Mische <vo...@gmail.com>


On Sun, Aug 1, 2010 at 10:43 PM, Volker Mische <vo...@gmail.com> wrote:
> On 01.08.2010 17:24, Benoit Chesneau wrote:
>>
>> On Sun, Aug 1, 2010 at 2:17 PM, Volker Mische<vo...@gmail.com>
>>  wrote:
>>>
>>> On 01.08.2010 10:53, Benoit Chesneau wrote:
>>>>
>>>> I'm looking for a way to limit number of points retrieved for an area
>>>> depending on its size. Ie When playing with the zoom on the map I want
>>>> to be able to only display and retrieved only main points instead of
>>>> all the points in this area. Is there a simple way to do that actually
>>>> ?
>>>>
>>>> - benoit
>>>
>>> Hi Benoit,
>>>
>>> there a two ways. Either introducing a "limit" parameter, but that's
>>> probably not what you want. It would limit to a arbitrary selection (not
>>> the
>>> "main points" as you'd like to have it).
>>> You probably want clusters. My suggestion is to do it on the client side
>>> with OpenLayers' cluster strategy [1][2].
>>>
>>> [1] http://openlayers.org/dev/examples/strategy-cluster.html
>>> [2] http://openlayers.org/dev/examples/strategy-cluster-threshold.html
>>>
>>> Cheers,
>>>  Volker
>>>
>> This solution doesn't work when you have a lot of points though. Do
>> you plan to add such things to geocouch ?
>>
>
> Clustering isn't that easy. I think some layer on top of GeoCouch
> should/will be built to handle such things. It can even be in any
> programming language and communicate with GeoCouch via HTTP.
>
> Cheers,
>  Volker
>
>
>

Just for the record since we discuss about it on irc, but my main
point here is to have it working in a couchapp.

So imo, if CouchDB could embed all the mechanic to index geodata, but
also search them it would be better than accumulating external tool on
top of it.

- benoit

Re: geocouch: limit number of points in an area

Posted by Volker Mische <vo...@gmail.com>.
On 01.08.2010 17:24, Benoit Chesneau wrote:
> On Sun, Aug 1, 2010 at 2:17 PM, Volker Mische<vo...@gmail.com>  wrote:
>> On 01.08.2010 10:53, Benoit Chesneau wrote:
>>>
>>> I'm looking for a way to limit number of points retrieved for an area
>>> depending on its size. Ie When playing with the zoom on the map I want
>>> to be able to only display and retrieved only main points instead of
>>> all the points in this area. Is there a simple way to do that actually
>>> ?
>>>
>>> - benoit
>>
>> Hi Benoit,
>>
>> there a two ways. Either introducing a "limit" parameter, but that's
>> probably not what you want. It would limit to a arbitrary selection (not the
>> "main points" as you'd like to have it).
>> You probably want clusters. My suggestion is to do it on the client side
>> with OpenLayers' cluster strategy [1][2].
>>
>> [1] http://openlayers.org/dev/examples/strategy-cluster.html
>> [2] http://openlayers.org/dev/examples/strategy-cluster-threshold.html
>>
>> Cheers,
>>   Volker
>>
> This solution doesn't work when you have a lot of points though. Do
> you plan to add such things to geocouch ?
>

Clustering isn't that easy. I think some layer on top of GeoCouch 
should/will be built to handle such things. It can even be in any 
programming language and communicate with GeoCouch via HTTP.

Cheers,
   Volker



Re: geocouch: limit number of points in an area

Posted by Benoit Chesneau <bc...@gmail.com>.
On Sun, Aug 1, 2010 at 2:17 PM, Volker Mische <vo...@gmail.com> wrote:
> On 01.08.2010 10:53, Benoit Chesneau wrote:
>>
>> I'm looking for a way to limit number of points retrieved for an area
>> depending on its size. Ie When playing with the zoom on the map I want
>> to be able to only display and retrieved only main points instead of
>> all the points in this area. Is there a simple way to do that actually
>> ?
>>
>> - benoit
>
> Hi Benoit,
>
> there a two ways. Either introducing a "limit" parameter, but that's
> probably not what you want. It would limit to a arbitrary selection (not the
> "main points" as you'd like to have it).
> You probably want clusters. My suggestion is to do it on the client side
> with OpenLayers' cluster strategy [1][2].
>
> [1] http://openlayers.org/dev/examples/strategy-cluster.html
> [2] http://openlayers.org/dev/examples/strategy-cluster-threshold.html
>
> Cheers,
>  Volker
>
This solution doesn't work when you have a lot of points though. Do
you plan to add such things to geocouch ?

- benoit

Re: geocouch: limit number of points in an area

Posted by Volker Mische <vo...@gmail.com>.
On 01.08.2010 10:53, Benoit Chesneau wrote:
> I'm looking for a way to limit number of points retrieved for an area
> depending on its size. Ie When playing with the zoom on the map I want
> to be able to only display and retrieved only main points instead of
> all the points in this area. Is there a simple way to do that actually
> ?
>
> - benoit

Hi Benoit,

there a two ways. Either introducing a "limit" parameter, but that's 
probably not what you want. It would limit to a arbitrary selection (not 
the "main points" as you'd like to have it).
You probably want clusters. My suggestion is to do it on the client side 
with OpenLayers' cluster strategy [1][2].

[1] http://openlayers.org/dev/examples/strategy-cluster.html
[2] http://openlayers.org/dev/examples/strategy-cluster-threshold.html

Cheers,
   Volker