[postgis-users] Line_interpolate point with multilinestring

Scott Ellington scottellington at comcast.net
Tue Jun 22 18:23:08 PDT 2004


Great advice guys.  I went ahead and updated my tiger data to LINESTRING
as you suggested.  No since in running geometryN on the fly if there is
no need to.

thanks again,
Scott Ellington 

On Tue, 2004-06-22 at 12:51, Paul Ramsey wrote:
> If you loaded your Tiger from Shape into PostGIS, shp2pgsql will have 
> cast everything as a MULTILINESTRING, despite the fact that the data 
> might not contain any MULTILINESTRINGs at all. This is an outgrowth of 
> the fact that the Shape file format generally declares all lines and 
> polygons as multis. You could convert your whole table to a new geometry 
> type first using the GeometryN function as dave suggests below (drop 
> type contraint, update table ("update road_100_tiger set the_geom = 
> geometryn(the_geom,1)"), re-add the constraint), then procede as normal.
> 
> P.
> 
> Dave Blasby wrote:
> > Quoting Scott Ellington <scottellington at comcast.net>:
> > 
> > 
> >>scottell=# select line_interpolate_point(the_geom,0.5) from
> >>road_100_tiger ;
> >>ERROR:  line_interpolate_point: 1st arg isnt a line
> >>
> >>I assume this is because my geometry is of type MULTILINESTRING instead
> >>of LINESTRING.  Is it possible for me to use my multilinestring data in
> >>this function?  If not, my thinking was that perhaps I could extract the
> >>LINESTRINGs on the fly.  Is there any built-in functionality to do this?
> > 
> > select line_interpolate_point(geometryN(the_geom,1),0.5) from
> > road_100_tiger ;
> > 
> > GeometryN( <multi geometry> , n) pulls the nth sub-geometry out of the given 
> > MULTI* or GEOMETRYCOLLECTION.
> 




More information about the postgis-users mailing list