<div dir="ltr"><div dir="ltr">Steve and list,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 21, 2021 at 1:41 PM wxgis <<a href="mailto:thinjogger@gmail.com">thinjogger@gmail.com</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 - <br>
Wondering if there is existing Python(3) script code that can take an (ESRI)<br>
shape file as input and then calculate latitude/longitude/elevation values<br>
for country boundaries.  For example, if the input file is a SHP file for<br>
France, the output would be the lat/lon/elevation values for the country<br>
boundaries.  I am quite new to QGIS, looking at version 3.18 (so only know<br>
about ESRI shape files, maybe there are other types of SHP files?), and read<br>
that in QGIS  I can edit the attribute table for a given layer and add<br>
latitude/longitude attributes, but I am hoping to this more<br>
programmatically, using the QGIS Python console.  I gladly welcome any ideas<br>
on this.<br></blockquote><div><br></div><div>Most polygon data that I've run into tends to be 2D ie there's no elevation value.  Things like contours are 2½D ie each line is at the same elevation and so the elevation is stored as an attribute of the line.</div><div><br></div><div>Boundaries would typically be either polygons or lines.  As the elevation varies along the polygon  or line, you would need 3D data.  If you have 2D data and a DEM you can convert the 2D data to 3D and then interpolate the elevation values along the polygon or line from the DEM.  Some file formats will not support 3D polygons or lines.<br></div><div><br></div><div>But something in the way you're stating what you want makes me think you actually want points along the boundary, each point with latitude, longitude and elevation.  If that's the case, you can convert your polygons or lines to points and then again assuming you have a DEM you can interpolate the elevations at the points.</div><div><br></div><div>If your data is not in lat/lon you can project it to lat/lon either before you start or after you finish.</div><div><br></div><div>Does this help?<br></div></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Chris Hermansen · clhermansen "at" gmail "dot" com<br><br>C'est ma façon de parler.</div></div></div>