[postgis-users] postgis-users Digest, Vol 97, Issue 7

Leigh Holcombe worker201 at gmail.com
Sat May 8 01:04:25 PDT 2010


On Fri, May 07, 2010 at 12:05:37 +0200, strk wrote:
> 
> On Fri, May 07, 2010 at 02:57:09AM -0700, Leigh Holcombe wrote:
> 
>> Is there a way to force linestring data to be imported as a linestring instead
>> of as a multilinestring? 
> 
> Yes, shp2pgsql -S

Trying to use this option produced the following output:
# shp2pgsql -S -s st_address.shp test.kcstreets > kcstreets.sql
Shapefile type: Arc
Postgis type: LINESTRING[2]
We have a Multilinestring with 2 parts, can't use -S switch!

Does this mean that one of the lines in the dataset actually is a real multilinestring?

>> Is there a way to convert a multilinestring into a linestring easily and quickly
>> on the fly (I'm doing PHP/LAPP programming)? 
> 
> ST_GeometryN(the_geom, 1) gives you the first LINESTRING of the (pseudo)set.

The following statement worked perfectly for me:
ST_AsText(line_interpolate_point(ST_GeometryN(the_geom, 1), $prop))

Thanks for all your help!




More information about the postgis-users mailing list