[postgis-users] Re: postgis-users Digest, Vol 33, Issue 19

hien thu hientb24 at yahoo.com
Mon Aug 1 22:28:00 PDT 2005



postgis-users-request at postgis.refractions.net wrote:Send postgis-users mailing list submissions to
postgis-users at postgis.refractions.net

To subscribe or unsubscribe via the World Wide Web, visit
http://postgis.refractions.net/mailman/listinfo/postgis-users
or, via email, send a message with subject or body 'help' to
postgis-users-request at postgis.refractions.net

You can reach the person managing the list at
postgis-users-owner at postgis.refractions.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of postgis-users digest..."


Today's Topics:

1. cocoon, postgis and mapserver (Andres Taborda)
2. Help with finding multi-variate clusters (Eli Dylan Lorimer)
3. Re: Versioning system for PostGIS (Paul Ramsey)
4. Re: Help with finding multi-variate clusters (Paul Ramsey)
5. Mixing GPL with BSD (Denis Lussier)
6. Re: Help with finding multi-variate clusters (Eli Dylan Lorimer)
7. Re: Help with finding multi-variate clusters (Eli Dylan Lorimer)
8. Re: Re: Help with finding multi-variate clusters
(Stephen Woodbridge)


----------------------------------------------------------------------

Message: 1
Date: Tue, 12 Jul 2005 14:24:34 -0500 (CDT)
From: Andres Taborda 
Subject: [postgis-users] cocoon, postgis and mapserver
To: postgis-users at postgis.refractions.net
Message-ID: <20050712192434.84127.qmail at web40504.mail.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1

some users 
can help me with integration de apache cocoon,
postgis and mapserver..

thanks very much

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 


------------------------------

Message: 2
Date: Tue, 12 Jul 2005 22:16:50 +0100
From: Eli Dylan Lorimer 
Subject: [postgis-users] Help with finding multi-variate clusters
To: postgis-users at postgis.refractions.net
Message-ID: <248FF8D8-3DF0-4100-820E-536219B49226 at sms.ed.ac.uk>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Hello PostGIS Folks,

I'm trying to leverage the power of the spatial database to help me 
find 3-dimensional clusters in my data. Specifically, in one table I 
have a 2D point field and a timestamp attribute field. I want to 
treat the data from each of these 2 fields as a 3D point (x,y,z) and 
over and entire table, find clusters given a specific tolerance 
(perhaps a mean nearest neighbor). To be honest, I'm not too fussed 
with the clustering algorithm, anything simple will do for now. What 
I'd like is to make my query and get in return a result set 
consisting of points defining the center of each of the clusters. I 
want to then draw them client side using Java3D. In any event, I 
figure this is possible with PostGIS but I have no idea where to 
begin looking. Could anyone point me in the right direction (or 
perhaps this functionality already exists and I'm not seeing it in 
the documentation.)

I'm very grateful for you help. This is a part of a big Uni project.

Cheers.
./dylan


------------------------------

Message: 3
Date: Tue, 12 Jul 2005 15:49:03 -0700
From: Paul Ramsey 

Subject: Re: [postgis-users] Versioning system for PostGIS
To: PostGIS Users Discussion 

Message-ID: <40777B0C-2140-49CD-BC4E-078A04810D52 at refractions.net>
Content-Type: text/plain; format=flowed; delsp=yes; charset=US-ASCII

How deep does this have to be? The simplest versioning system is just:

create table foo;
create table foo_history;

Then add update/insert/delete triggers on foo that fill in the deltas 
in foo_history. There used to be code in contrib/ that did this, but 
I think it got removed.

"Versioning" is a loaded and conflicted term, more definitions are 
required to know what you mean by it!

Paul

On 12-Jul-05, at 11:04 AM, Hisaji ONO wrote:

> Hello.
>
> I think currently implementing Spatio-Temporal function
> into GIS is important more and more increasingly.
>
> PostGIS has recently supported 4D format, however this
> format is very useful for versioning system of spatial
> data.
>
> PostGIS dev. team has any plan to implement these
> versioning system of spatial data into PostGIS.
>
> Regards.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



------------------------------

Message: 4
Date: Tue, 12 Jul 2005 15:51:17 -0700
From: Paul Ramsey 

Subject: Re: [postgis-users] Help with finding multi-variate clusters
To: PostGIS Users Discussion 

Message-ID: <83BB4957-E297-45B4-B3C0-9A3A3062099F at refractions.net>
Content-Type: text/plain; format=flowed; delsp=yes; charset=US-ASCII

Skip PostGIS and look into R. If you can find a function in R to do 
it, load PL/R into PostgreSQL and pipe the results of a PostGIS query 
into the R function.

select rfunction(x(thepoint),y(thepoint),timestamp) from foo

Or something like that.

Or, write your own k-means clustering system. V. v. computationally 
expensive for large sets though.

P

On 12-Jul-05, at 2:16 PM, Eli Dylan Lorimer wrote:

> Hello PostGIS Folks,
>
> I'm trying to leverage the power of the spatial database to help me 
> find 3-dimensional clusters in my data. Specifically, in one table 
> I have a 2D point field and a timestamp attribute field. I want to 
> treat the data from each of these 2 fields as a 3D point (x,y,z) 
> and over and entire table, find clusters given a specific tolerance 
> (perhaps a mean nearest neighbor). To be honest, I'm not too fussed 
> with the clustering algorithm, anything simple will do for now. 
> What I'd like is to make my query and get in return a result set 
> consisting of points defining the center of each of the clusters. I 
> want to then draw them client side using Java3D. In any event, I 
> figure this is possible with PostGIS but I have no idea where to 
> begin looking. Could anyone point me in the right direction (or 
> perhaps this functionality already exists and I'm not seeing it in 
> the documentation.)
>
> I'm very grateful for you help. This is a part of a big Uni project.
>
> Cheers.
> ./dylan
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



------------------------------

Message: 5
Date: Tue, 12 Jul 2005 23:16:38 -0400
From: "Denis Lussier" 
Subject: [postgis-users] Mixing GPL with BSD 
To: 

Message-ID:


Content-Type: text/plain; charset="us-ascii"

Hi All,



My company is EnterpriseDB Corp. We add some proprietary (usually all
made BSD open source within one year) code to PostgreSQL that mostly
focuses on Oracle compatibility. My problem is that PostGIS is GPL so I
don't see a way I can bundle it into my product offering. I wouldn't
have a problem if it were LGPL cuz any tweaks or improvements I'd be
more than willing to offer to the community immediately.



I guess I can always just have my commercial customers who want to use
PostGIS separately go ahead and download/install it themselves (perhaps
I'm showing my ignorance if PostGIS needs to be compiled in), but... a
separate download/install is inconvenient and less than optimal. Since
we don't presently have any true Spatial experts in our company at the
moment, we'd also be looking to partner with various community members
to provide professional services and advanced support to our customers.



Any suggestions??



--Denis Lussier

Chief Architect and Chairman

EnterpriseDB Corporation



PS This product must be darn good cuz I've had several potentially
large accounts insist that EDB support it. It shouldn't be an issue for
us because we certainly allow usage of PL/pgSQL and we strive to
maintain 100% compatability with all features, and add-ons of
PostgreSQL.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/postgis-users/attachments/20050712/e52bea8b/attachment-0001.html

------------------------------

Message: 6
Date: Wed, 13 Jul 2005 13:37:48 +0100
From: Eli Dylan Lorimer 
Subject: [postgis-users] Re: Help with finding multi-variate clusters
To: postgis-users at postgis.refractions.net
Message-ID: <72F3E906-A8DF-4C6A-A375-CC5C195B66B5 at sms.ed.ac.uk>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Hello,

So I've been trying quasi unsuccessfully to find clusters in my data 
using spatial sql. I think I"m pretty close but I need a tip or 
something to get me past this little hurdle I'm hitting. Basically, 
I've got a simple test table with a 2D Point field in it.

For testing purposes, I've placed the following data in it:

select AsText(point) from waypoints_test;

--------------
POINT(0 0)
POINT(4 4)
POINT(5 5)
POINT(6 6)
POINT(9 9)
POINT(10 10)

I want to run whatever magical SQL command I'm seeking to get back 
the following clusters (based on a Euclidean distance of 2)

MULTIPOINT(4 4,5 5,5 5,6 6)
MULTIPOINT(9 9,10 10)
(2 rows)

What I've come up with is sort of close but not quite there. Here are 
my attempts:


select distinct AsText(a.point) from waypoints_test a, 
waypoints_test b where intersects(buffer(a.point,2), buffer(b.point, 
2)) and not equals(a.point,b.point) group by a.point;
astext
--------------
POINT(10 10)
POINT(4 4)
POINT(5 5)
POINT(6 6)
POINT(9 9)
(5 rows)

select distinct AsText(a.point) from waypoints_test a, 
waypoints_test b where distance(a.point,b.point)<2 and not equals 
(a.point,b.point);
astext
--------------
POINT(10 10)
POINT(4 4)
POINT(5 5)
POINT(6 6)
POINT(9 9)
(5 rows)

select AsText(collect(a.point)) from waypoints_test a, 
waypoints_test b where distance(a.point,b.point)<2 and not equals 
(a.point,b.point);
---------------------------------------
MULTIPOINT(4 4,5 5,5 5,6 6,9 9,10 10)

I cant' seem to figure out how to get the GeomUnion or Collect rows 
back with each row containing my cluster. The basic logistics behind 
finding them is really simple, I just want to pass some tolerance 
(perhaps a mean nearest neighbor value) and then:

For each point in my table
buffer it by the passed tolerance.
Find all points in the table that exist in that buffer.
Buffer them.
Continue until no points exist within the buffer.
Take Union (or collection) of all points and make that a cluster.

I would really appreciate a tip on how to group the rows being 
returned based on the buffer they appeared in. Or, alternatively, I 
could use a distance function in stead of buffering and find all 
points that are within said distance(tolerance) of each other and 
union all these points together.

Anything will do.
Thank you in advance.

Cheers,
./dylan




------------------------------

Message: 7
Date: Wed, 13 Jul 2005 14:22:32 +0100
From: Eli Dylan Lorimer 
Subject: [postgis-users] Re: Help with finding multi-variate clusters
To: postgis-users at postgis.refractions.net
Message-ID: <64CBA3C1-5A78-4544-8DAA-7A7D4A840AD3 at sms.ed.ac.uk>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Oh,
and regarding the use of R, I think that is a stellar idea but I need 
to stay within the GeoServer/GeoTools2 domain so that I can make my 
WFS request client-side using GeoTools2 and then have GerServer 
handle said request and do the magic dance with PostGIS to get back 
my data. If there is a way to do this with R, that might work. I'll 
look into it now, but ideally, I'd like to stick to a pure PostGIS 
solution and use GT filters to form the WFS request.
Cheers.



On Jul 12, 2005, at 10:16 PM, Eli Dylan Lorimer wrote:

> Hello PostGIS Folks,
>
> I'm trying to leverage the power of the spatial database to help me 
> find 3-dimensional clusters in my data. Specifically, in one table 
> I have a 2D point field and a timestamp attribute field. I want to 
> treat the data from each of these 2 fields as a 3D point (x,y,z) 
> and over and entire table, find clusters given a specific tolerance 
> (perhaps a mean nearest neighbor). To be honest, I'm not too fussed 
> with the clustering algorithm, anything simple will do for now. 
> What I'd like is to make my query and get in return a result set 
> consisting of points defining the center of each of the clusters. I 
> want to then draw them client side using Java3D. In any event, I 
> figure this is possible with PostGIS but I have no idea where to 
> begin looking. Could anyone point me in the right direction (or 
> perhaps this functionality already exists and I'm not seeing it in 
> the documentation.)
>
> I'm very grateful for you help. This is a part of a big Uni project.
>
> Cheers.
> ./dylan
>



------------------------------

Message: 8
Date: Wed, 13 Jul 2005 09:37:24 -0400
From: Stephen Woodbridge 
Subject: Re: [postgis-users] Re: Help with finding multi-variate
clusters
To: PostGIS Users Discussion 

Message-ID: <42D51914.1080109 at swoodbridge.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Eli,

In general, the algorithm you presented is an iterative operation and 
SQL operations tend to be set operations. This means that it is likely 
that there is not a simple solution to this problem. That said, there is 
no reason you can write a pgsql function that does the iterative solution.

I for one would love to see a function like this, as it is part and 
parcel of what needs to be done to generate thematic maps.

-Steve W.

Eli Dylan Lorimer wrote:
> Hello,
> 
> So I've been trying quasi unsuccessfully to find clusters in my data 
> using spatial sql. I think I"m pretty close but I need a tip or 
> something to get me past this little hurdle I'm hitting. Basically, 
> I've got a simple test table with a 2D Point field in it.
> 
> For testing purposes, I've placed the following data in it:
> 
> select AsText(point) from waypoints_test;
> 
> --------------
> POINT(0 0)
> POINT(4 4)
> POINT(5 5)
> POINT(6 6)
> POINT(9 9)
> POINT(10 10)
> 
> I want to run whatever magical SQL command I'm seeking to get back the 
> following clusters (based on a Euclidean distance of 2)
> 
> MULTIPOINT(4 4,5 5,5 5,6 6)
> MULTIPOINT(9 9,10 10)
> (2 rows)
> 
> What I've come up with is sort of close but not quite there. Here are 
> my attempts:
> 
> 
> select distinct AsText(a.point) from waypoints_test a, waypoints_test 
> b where intersects(buffer(a.point,2), buffer(b.point, 2)) and not 
> equals(a.point,b.point) group by a.point;
> astext
> --------------
> POINT(10 10)
> POINT(4 4)
> POINT(5 5)
> POINT(6 6)
> POINT(9 9)
> (5 rows)
> 
> select distinct AsText(a.point) from waypoints_test a, waypoints_test 
> b where distance(a.point,b.point)<2 and not equals (a.point,b.point);
> astext
> --------------
> POINT(10 10)
> POINT(4 4)
> POINT(5 5)
> POINT(6 6)
> POINT(9 9)
> (5 rows)
> 
> select AsText(collect(a.point)) from waypoints_test a, waypoints_test 
> b where distance(a.point,b.point)<2 and not equals (a.point,b.point);
> ---------------------------------------
> MULTIPOINT(4 4,5 5,5 5,6 6,9 9,10 10)
> 
> I cant' seem to figure out how to get the GeomUnion or Collect rows 
> back with each row containing my cluster. The basic logistics behind 
> finding them is really simple, I just want to pass some tolerance 
> (perhaps a mean nearest neighbor value) and then:
> 
> For each point in my table
> buffer it by the passed tolerance.
> Find all points in the table that exist in that buffer.
> Buffer them.
> Continue until no points exist within the buffer.
> Take Union (or collection) of all points and make that a cluster.
> 
> I would really appreciate a tip on how to group the rows being returned 
> based on the buffer they appeared in. Or, alternatively, I could use a 
> distance function in stead of buffering and find all points that are 
> within said distance(tolerance) of each other and union all these 
> points together.
> 
> Anything will do.
> Thank you in advance.
> 
> Cheers,
> ./dylan
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



------------------------------

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


End of postgis-users Digest, Vol 33, Issue 19
*********************************************


		
---------------------------------
 Start your day with Yahoo! - make it your home page 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050801/733bc3db/attachment.html>


More information about the postgis-users mailing list