<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-language:PT;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:EN-US;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="PT" link="#0563C1" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Ah, Ghrrr. Not in this simple code sample but I (thought) I did in the real implementation<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><a href="https://github.com/GenericMappingTools/GMT.jl/blob/master/src/gdal_utils.jl#L197">https://github.com/GenericMappingTools/GMT.jl/blob/master/src/gdal_utils.jl#L197</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">but it only looked at the first layer<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">making it scan all layers produces the correct plot.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Cheers<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Joaquim<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:PT">From:</span></b><span lang="EN-US" style="mso-fareast-language:PT"> Even Rouault <even.rouault@spatialys.com>
<br>
<b>Sent:</b> Friday, October 29, 2021 5:50 PM<br>
<b>To:</b> Joaquim Manuel Freire Luís <jluis@ualg.pt>; gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [gdal-dev] ingesting .gpx files from FFI<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>You didn't explore completely the dataset. The waypoints layer has 0 feature, but the tracks one has 1 and the track_points one 2469<span style="mso-fareast-language:PT"><o:p></o:p></span></p>
<div>
<p class="MsoNormal">Le 29/10/2021 à 18:32, Joaquim Manuel Freire Luís a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Trying to read .gpx files from Julia (and I would bet, from python too but can’t test it) is showing puzzling results.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">For example, with the attached gpx file I get this</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">julia> ds = gdalread("25708.gpx", gdataset=true);</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">julia> layer = getlayer(ds, 0)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Layer: waypoints (1)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> Geometry 0 (</span><span lang="EN-US" style="font-family:"Tahoma",sans-serif">�</span><span lang="EN-US">∟*</span><span lang="EN-US" style="font-family:"Tahoma",sans-serif">��</span><span lang="EN-US">): [1]</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> Field 0 (ele): [Real]</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> Field 1 (time): [9999]</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> Field 2 (magvar): [Real]</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> Field 3 (geoidheigh): [Real]</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> Field 4 (name): [String]</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">...</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Number of Fields: 23</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">But there are no Features in the layers, so I can’t get the data from the geometries</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">julia> GMT.Gdal.nfeature(layer)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">0</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">HOWEVER, both the GDAL `ogr2ogr` command line or it’s Julia wrapper works in converting, e.g., to geopackage</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">julia> ogr2ogr("25708.gpx", dest="25708.gpkg")</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">and I can now plot "25708.gpkg" (not shown here but the plot can be seen in
<a href="https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509/22?u=joa-quim">
https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509/22?u=joa-quim</a>)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">How is ogr2ogr able to read this file data?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Thanks</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Joaquim</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:PT"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>gdal-dev mailing list<o:p></o:p></pre>
<pre><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><o:p></o:p></pre>
<pre><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</body>
</html>