Re: [postgis-users] ST_MakeLine() woes

2014-05-15 Thread georgew
Remi, I finally got my act together and succeeded in getting your latest code to work with my data. The result is very interesting but not what I expected, see below: New3DLine.png If I superimpose my original line the result is: New3

Re: [postgis-users] ST_MakeLine() woes

2014-05-13 Thread georgew
Remi, you replied before the edits I made to my last posting were accepted by the forum. It actually did work!, with very minor adjustments to your code. But I accept that my approach may not the best way to go about this problem, so I'll try your latest suggestion and let you know the results. Tha

Re: [postgis-users] ST_MakeLine() woes

2014-05-13 Thread Rémi Cura
Sorry it didn't work :-( . Can you check that temp_id is not always 1? It is more that this approach is flawed _depending on the raster resolution and the small turn in your line (fixe = simplify line). _anyway, you are constructing a new line from centroid, and not putting the height information

Re: [postgis-users] ST_MakeLine() woes

2014-05-12 Thread georgew
thanks Remi, attached is the result after running your code, no change unfortunately. I had to make some slight changes to the code to make it work. The image has the code. However you also say that my approach is not as robust as it could be. Any suggestions on how to make it more robust? newli

Re: [postgis-users] ST_MakeLine() woes

2014-05-12 Thread Rémi Cura
Hey, your original code was not correct, as far as I can tell without being able to test it! As far as I can tell the blog query is not correct either (the last statement may mix the order as it is not enforced). Another problem is that the points are going to be ill ordered as soon as the line is

Re: [postgis-users] ST_MakeLine() woes

2014-05-11 Thread georgew
Thank you Remi, I assume that means that my original code was correct (although it produces unwanted results). I am slowly reaching the conclusion that the problem is with st_intersection(), which traverses the raster in an order which is not compatible with my line shape and any attempt to create

Re: [postgis-users] ST_MakeLine() woes

2014-05-11 Thread Rémi Cura
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 : > I don't

Re: [postgis-users] ST_MakeLine() woes

2014-05-11 Thread Hugues François
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 201

Re: [postgis-users] ST_MakeLine() woes

2014-05-11 Thread georgew
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_Inte

Re: [postgis-users] ST_MakeLine() woes

2014-05-11 Thread Hugues François
sts.osgeo.org] De la part de georgew Envoyé : dimanche 11 mai 2014 11:07 À : postgis-users@lists.osgeo.org 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

Re: [postgis-users] ST_MakeLine() woes

2014-05-11 Thread georgew
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 ma

Re: [postgis-users] ST_MakeLine() woes

2014-05-11 Thread Hugues François
3D points from the previous tables. Hugues. -Message d'origine- De : postgis-users-boun...@lists.osgeo.org [mailto:postgis-users-boun...@lists.osgeo.org] De la part de georgew Envoyé : dimanche 11 mai 2014 08:34 À : postgis-users@lists.osgeo.org Objet : [postgis-users] ST_MakeLine()

[postgis-users] ST_MakeLine() woes

2014-05-10 Thread georgew
Hi, I have the following code (based on the blog: http://blog.mathieu-leplatre.info/drape-lines-on-a-dem-with-postgis.html): WITH line AS -- From an arbitrary line (SELECT geom from foot_cl where (sheet='AT24' AND sid=463)), cells AS -- Get DEM elevation for each intersected cell (SELECT ST_Centro