[postgis-users] Prorate values along a line feature based on length.

Simon Norris snorris at hillcrestgeo.ca
Wed Jan 5 09:17:41 PST 2022


Bobb,

It sounds like you want to add measures from the endpoints: 
https://postgis.net/docs/ST_AddMeasure.html <https://postgis.net/docs/ST_AddMeasure.html>

Then grab the interpolated elevations with something like this:
SELECT ST_Z(ST_PointN(geom, generate_series(1, ST_NPoints(geom) - 1))) AS elevation

Simon



> On Jan 5, 2022, at 9:03 AM, Basques, Bob (CI-StPaul) <bob.basques at ci.stpaul.mn.us> wrote:
> 
> All,
>  
> Ok, this is sort of a weird one (to me).
>  
> I have a feature dataset of MutliLineStrings, all with no Z value, but with a Elevation attribute on each end.   I need to prorate the elevation for each vertex along the line based on the distance for either/or each of the ends.
>  
> I was planning on attaching this from the client side originally, but though I would ask here if anyone has tried a SQL approach to extracting/creating.  
>  
> Maybe recreate the feature with the attiributes on the fly?  Then extract the vertex info.  The intent is to import into a CAD application and build a 3D CAD model.
>  
> Anyway, any thoughts?
>  
> Bobb
>  
>  
>  
> Get me in Teams <https://teams.microsoft.com/l/chat/0/0?users=bob.basques@ci.stpaul.mn.us>
> PW19-S295-C024
>  
>  
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/postgis-users <https://lists.osgeo.org/mailman/listinfo/postgis-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20220105/0d5a221e/attachment.html>


More information about the postgis-users mailing list