[postgis-users] How can I split a polyline?

Fay Du fay.du at versaterm.com
Tue Mar 7 08:47:37 PST 2006


Robert and Amit:
Think you very much for help.
I get ideas how to split it from your email.

I still have a questions. What is a true multi-line?

select NumGeometries(GeomFromText('MULTILINESTRING((1837220.875
330343.625,1836865.75 330348.53125,1836449.25 330363.03125,1836208.375
330362.59375,1836013.375 330371.375,1835626.625 330381.46875,1834513.625
330397.3125))',-1));
return 1. Should it return number of points?

select astext(geometryn(GeomFromText('MULTILINESTRING((1837220.875
330343.625,1836865.75 330348.53125,1836449.25 330363.03125,1836208.375
330362.59375,1836013.375 330371.375,1835626.625 330381.46875,1834513.625
330397.3125))',-1),1));
Return same MULTILINESTRING. 

select astext(geometryn(GeomFromText('MULTILINESTRING((1837220.875
330343.625,1836865.75 330348.53125,1836449.25 330363.03125,1836208.375
330362.59375,1836013.375 330371.375,1835626.625 330381.46875,1834513.625
330397.3125))',-1),2));
Return null.

Thanks again?
Fay

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Robert Burgholzer
Sent: Tuesday, March 07, 2006 11:23 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] How can I split a polyline?

An possibly:

geometryN(geometry, integer)

for extracting sub-geometries in a true multi-line.

r.b.

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Amit
Kulkarni
Sent: Tuesday, March 07, 2006 11:11 AM
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] How can I split a polyline?

Fay,

You might use these functions...

1) for splitting to lines

NumGeometries(geometry)
NumPoints(geometry)

2) to points
PointN(geometry,integer)


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
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




More information about the postgis-users mailing list