<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi David,<br>
<br>
I would think working with a subselect would solve your problem:<br>
<br>
SELECT<br>
generate_series(1,ST_NumGeometries(geom)) as gid,<br>
geom<br>
FROM (<br>
SELECT <br>
ST_GeomFromEWKB((ST_Dump(ST_Split(g.geom,
blade.geom))).geom) As geom,<br>
FROM <br>
points as blade,<br>
lines as g<br>
WHERE<br>
ST_Intersects(g.geom, blade.geom)<br>
) as sel;<br>
<br>
Hope that helps,<br>
<br>
Birgit.<br>
<br>
<br>
<br>
Am 25.02.2012 22:01, schrieb David Quinn:
<blockquote
cite="mid:CAKPYEgdXKrF0N-vtke4VdxmGOjc6j0r9hMF+49rk1Ft1sQfC7A@mail.gmail.com"
type="cite">After re-reading the documentation I realized I missed
an example, so I figured out what I need to do (in part):<br>
<br>
SELECT <br>
ST_GeomFromEWKB((ST_Dump(ST_Split(g.geom, blade.geom))).geom)
As geom <br>
FROM <br>
points as blade,<br>
lines as g<br>
WHERE<br>
ST_Intersects(g.geom, blade.geom)<br>
<br>
This works fine, but I also want to include a column that is an
identifier. I've tried doing the following:<br>
<br>
SELECT <br>
ST_GeomFromEWKB((ST_Dump(ST_Split(g.geom, blade.geom))).geom)
As geom,<br>
generate_series(1,ST_NumGeometries((ST_Split(g.geom,
blade.geom)))) as gid<br>
FROM <br>
points as blade,<br>
lines as g<br>
WHERE<br>
ST_Intersects(g.geom, blade.geom)<br>
<br>
While this does generate a series, it starts counting for each
line that it splits so it is 1,2,3,1,2,1,2,3,4. How can I have a
sequential GID (or get the total geometry count)?<br>
<br>
-David<br>
<br>
<div class="gmail_quote">On Sat, Feb 25, 2012 at 2:54 PM, David
Quinn <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:daithiquinn@gmail.com">daithiquinn@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I'm trying to split up a line using points into several
smaller lines. I'm using ST_Split but I don't understand how
to combine the returned values into a line. My code is as
follows:<br>
<br>
SELECT <br>
ST_Dump(ST_Split(g.geom, blade.geom)) AS geom <br>
FROM<br>
points as blade,<br>
lines as g<br>
WHERE<br>
ST_Intersects(g.geom, blade.geom)<br>
<br>
I've tried using a few different geometry constructors such as
ST_LineFromMultiPoint() and ST_GeomFromEWKB() to convert what
ST_Dump() returns to create lines but my syntax/approach is
not correct. What is the correct approach?<br>
<br>
Thanks,<br>
David<br>
</blockquote>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
</body>
</html>