[postgis-users] ST_MakeLine() woes

Hugues François hugues.francois at irstea.fr
Sun May 11 04:30:14 PDT 2014


I don't  have any available data and not enough time for now but you may try the same query but without all "with" statements for the final one ( SELECT ST_MakeLine(geom)  FROM points3d).  You can also add a serial column in the points3d with to keep the ordering information.

Hug

Le 11 mai 2014 13:05, georgew <gws293 at hotmail.com> a écrit :
>
> Thank you Hugues (and my apologies for using the wrong name), if I understood 
> you correctly this is what the code should look like: 
>
> WITH line AS 
> (SELECT geom from foot_cl where (sheet='AT24' AND sid=463)), 
> cells AS 
> (SELECT ST_Centroid((ST_Intersection(at24.rast, line.geom)).geom) AS geom, 
> (ST_Intersection(at24.rast, line.geom)).val AS val 
> FROM at24, line 
> WHERE ST_Intersects(at24.rast, line.geom)), 
> points3d AS 
> (SELECT ST_SetSRID(ST_MakePoint(ST_X(cells.geom), ST_Y(cells.geom), val), 
> 2193) AS geom 
> FROM cells, line ORDER BY ST_Distance(ST_StartPoint(line.geom), cells.geom)) 
> SELECT ST_MakeLine(points3d.geom)  FROM points3d,line,cells 
>
> The result is exactly the same as before as you can see here: 
> makeline.png <http://postgis.17.x6.nabble.com/file/n5006270/makeline.png>
> But it should look as follows (after replacing makeline with the points): 
>
> points.png <http://postgis.17.x6.nabble.com/file/n5006270/points.png>
> Thank you for your help 
>
>
>
> -- 
> View this message in context: http://postgis.17.x6.nabble.com/ST-MakeLine-woes-tp5006266p5006270.html 
> Sent from the PostGIS - User mailing list archive at Nabble.com. 
> _______________________________________________ 
> postgis-users mailing list 
> postgis-users at lists.osgeo.org 
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users 


More information about the postgis-users mailing list