<div dir="ltr">How about this for an approach?<div><br></div><div>- Create a line from the start and end point using ST_MakeLine</div><div>- Densify it using ST_Segmentize (e.g. to a1 km interval)</div><div>- Extract the individual points using ST_DumpPoints</div><div>- For each point, query to find the nearest elevation point</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 6, 2022 at 12:51 PM Luca Bertoncello <<a href="mailto:lucabert@lucabert.de">lucabert@lucabert.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi list!<br>
<br>
I have a table in my PostGIS database, with the ground elevation of Europe.<br>
The table is so:<br>
<br>
gis=# \d elevation<br>
                        Tabelle »public.elevation«<br>
  Spalte   |       Typ        | Sortierfolge | NULL erlaubt? | Vorgabewert<br>
-----------+------------------+--------------+---------------+-------------<br>
 latlng    | geography        |              |               |<br>
 lat       | double precision |              |               |<br>
 lng       | double precision |              |               |<br>
 elevation | real             |              |               |<br>
<br>
lat and lng are just used for an export to a SQLite-DB for use in an<br>
App. The same data are in "latlng" as geography...<br>
The table has currently a precision of 3x3 Km, but I can import data<br>
with a better precision, too, of course.<br>
<br>
So my question...<br>
I'd like to use these data to create a vertical profile similar to the<br>
one I can get from Google-Maps.<br>
Currently, with a simple query, I can get the elevation of a given point.<br>
Of course, I don't have _all_ point in the table, so I have to search<br>
the nearest point, but this is OK...<br>
<br>
What I need is a function that receive two coordinates as parameters.<br>
These coordinates define a line from A to B.<br>
I'd like to retrieve all elevations in this line, with a given interval,<br>
so that I can retrieve for example the elevation every kilometer or so.<br>
<br>
And I don't have any idea how to do that...<br>
<br>
Can someone suggest me a way?<br>
<br>
Thanks a lot<br>
Luca Bertoncello<br>
(<a href="mailto:lucabert@lucabert.de" target="_blank">lucabert@lucabert.de</a>)<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div>