[postgis-users] ST_MakeLine() woes

Rémi Cura remi.cura at gmail.com
Sun May 11 11:46:34 PDT 2014


Hey,
the order by has to be on the same statement of your ST_makeline, or the
order could be wrong.

Morevover,
the order by should order the Point3D CTE because you want (points3d.geom)
to be ordered, not line or others.

Cheers,
rémi-C




2014-05-11 13:30 GMT+02:00 Hugues François <hugues.francois at irstea.fr>:

> 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
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140511/d520401d/attachment.html>


More information about the postgis-users mailing list