As I told you (and after I took a look at the blog, I think I'm right), the 
problem is not the order by statement itself but its place in the query. It I a 
nonsense to do it outside the with where you make point and order them at the 
same time because of the link between line and cells to make your final line.

Instead of
points3d as(
SELECT ST_SetSRID(ST_MakePoint(ST_X(cells.geom), ST_Y(cells.geom), val),
2193) AS geom
FROM cells, line)

You should write
points3d as(
SELECT ST_SetSRID(ST_MakePoint(ST_X(cells.geom), ST_Y(cells.geom), val), 32632) 
AS geom
 FROM cells, line
 ORDER BY ST_Distance(ST_StartPoint(line.geom), cells.geom))

Here the points will be in the right order so you can make your line.

And please, feel free to call me "Hugues" ;)

Hugues.

-----Message d'origine-----
De : [email protected] 
[mailto:[email protected]] De la part de georgew
Envoyé : dimanche 11 mai 2014 11:07
À : [email protected]
Objet : Re: [postgis-users] ST_MakeLine() woes

Thanks Francois, the ORDER BY statement was in the original blog I quoted, but 
even if I remove it, the points are still displayed in the same wrong sequence.



--
View this message in context: 
http://postgis.17.x6.nabble.com/ST-MakeLine-woes-tp5006266p5006268.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
_______________________________________________
postgis-users mailing list
[email protected]
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[email protected]
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Reply via email to