[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: Re: [postgis-users] Converting a LineString to MultiPoint
From: Andrea Peri <aperi2007 () gmail ! com>
Date: 2010-06-19 12:44:59
Message-ID: AANLkTimYtefDDZPEqdP6A3R3FKBERy8OvvM97-wxleVN () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
HI Mike,
it work very well.
So I reached my scope.
I used this sql:
INSERT INTO public.<table_name multipoint> (id,idrtt,geom) (
select
c.id,
c.idrtt,
st_union(c.geom)
from (
select
a.id as id,
a.idrtt as idrtt,
(ST_DumpPoints(a.geom)).* as geom
from
public.<table_name linestring> as a
) as c
group by
c.id,
c.idrtt
);
Regards,
Andrea.
> If you have PostGIS 1.5, then you can use ST_DumpPoints:
> http://postgis.refractions.net/docs/ST_DumpPoints.html \
> <http://postgis.refractions.net/docs/ST_DumpPoints.html>
> E.g.:
>
> SELECT gid, ST_AsText(ST_Collect(ST_AsText(geom)))
> FROM (
> SELECT gid, (ST_DumpPoints(g.geom)).*
> FROM
> (SELECT 1 as gid, 'LINESTRING (0 0, 0 3, 3 4)'::geometry AS geom
> UNION ALL
> SELECT 2 as gid, 'LINESTRING (1 1, 2 6, 7 7)'::geometry AS geom) AS g
> ) j
> GROUP BY gid;
>
> -Mike
--
-----------------
Andrea Peri
. . . . . . . . .
qwerty אטלעש
-----------------
[Attachment #5 (text/html)]
<pre>HI Mike,<br><br>it work very well.<br><br>So I reached my scope.<br><br>I used \
this sql:<br><br>INSERT INTO public.<table_name multipoint> (id,idrtt,geom) \
(<br> select<br> <a href="http://c.id">c.id</a>,<br> c.idrtt,<br> \
st_union(c.geom)<br> from (<br> select <br> <a href="http://a.id">a.id</a> as \
id,<br> a.idrtt as idrtt,<br> (ST_DumpPoints(a.geom)).* as geom<br> from \
<br> public.<table_name linestring> as a<br> ) as c<br> group by<br> \
<a href="http://c.id">c.id</a>,<br> \
c.idrtt<br>);<br><br><br>Regards,<br><br>Andrea.<br><br>>If you have PostGIS 1.5, \
then you can use ST_DumpPoints:<br><a \
href="http://postgis.refractions.net/docs/ST_DumpPoints.html">>http://postgis.refractions.net/docs/ST_DumpPoints.html</a><br>
><br>>E.g.:<br>><br>>SELECT gid, \
ST_AsText(ST_Collect(ST_AsText(geom)))<br>>FROM (<br>> SELECT gid, \
(ST_DumpPoints(g.geom)).*<br>> FROM<br>> (SELECT 1 as gid, 'LINESTRING \
(0 0, 0 3, 3 4)'::geometry AS geom<br> > UNION ALL<br>> SELECT 2 as \
gid, 'LINESTRING (1 1, 2 6, 7 7)'::geometry AS geom) AS g<br>> ) \
j<br>>GROUP BY gid;<br>><br>>-Mike<br></pre><br clear="all"><br>-- \
<br>-----------------<br> Andrea Peri<br>. . . . . . . . . <br>qwerty \
אטלעש<br>-----------------<br><br>
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic