<div dir="ltr">Hi there everyone,<div><br></div><div>Thanks again for all your suggestions and patience! I'll sit down and take a look at it soon and report back on whether or not I can make it work. </div><div><br></div><div>Kind regards,</div><div>Jimi.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 2, 2020 at 3:03 PM Bernd Vogelgesang <<a href="mailto:bernd.vogelgesang@gmx.de">bernd.vogelgesang@gmx.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"><br>
On 02.11.20 13:57, Fernando M. Roxo da Motta wrote:<br>
> On Sun, 1 Nov 2020 17:26:46 -0500, Garth Fletcher <<a href="mailto:garth@jacqcad.com" target="_blank">garth@jacqcad.com</a>><br>
> wrote:<br>
><br>
>    Just a side note.<br>
><br>
>    If I understand it correct, this procedure will store in attribute<br>
> table (as a temporary or permanent attribute) the coordinates as they<br>
> are at the time it is stored.   If a point is moved through edition that<br>
> value will not be updated automatically.  It will be necessary to store<br>
> the new value in the table with the described procedure.<br>
<br>
Yes and no: Since a while, it is possible to update values based on such<br>
a function after doing some configurations.<br>
<br>
First create your x and y fields and apply the $x and $y functions on<br>
them through the field calculator.<br>
<br>
When you now want them to automatically update on changes, go to<br>
<br>
Layer Properties -> Attributes Form -> Pick the field in question -><br>
Section "Default Values" -> enter the function into the "Default value"<br>
and tick the "Apply default value on update"<br>
<br>
Done ;)<br>
<br>
><br>
>> My experience is with .gpx files generated by a Garmin eTrex-20.<br>
>><br>
>> When I use QGIS's Data Source Manager to open a and Add a .gxp file I<br>
>> see several different layers:<br>
>>    Tracks<br>
>>    Track Points<br>
>>    Routes<br>
>>    Route Points<br>
>>    Waypoints<br>
>><br>
>> The one you want is "Track Points" because it contains all the<br>
>> individual points which collectively make up the tracks. "Tracks"<br>
>> only contains link(s) to the various tracks that have been recorded -<br>
>> it usually only contains one item unless you have saved multiple<br>
>> tracks.<br>
>><br>
>> You may also be interested in "Waypoints" if you've recorded specific<br>
>> waypoints on your GPS.<br>
>><br>
>> So Add the layers of interest (Track Points and maybe Waypoints)<br>
>><br>
>> Because a .gpx file is "input only", your first step needs to be to<br>
>> to right-click on the layer, select Export > Save Features As...<br>
>><br>
>> This will let you save the layer in a form that can be edited. Keep<br>
>> this new layer (you can remove the original .gpx layer)<br>
>><br>
>> The layer's Attribute Table contains fields for all sorts of<br>
>> attributes, but NOT including the location (Lat,Long) data which is<br>
>> stored separately.<br>
>><br>
>> So to be able to make your own location based calculations you want to<br>
>> copy the point locations into new fields in the Attribute Table.<br>
>><br>
>> With the layer selected, select the Field Calculator (Abaccus icon in<br>
>> toolbar)<br>
>>    check Create a new field<br>
>>    enter a name, e.g., "Latid"<br>
>>    set Output field type to Decimal number (real)<br>
>>    set Output field length to 10, Precision to 6<br>
>>    type "$y" in the Expression window below<br>
>>      {$y is the location's Y axis, i.e., its latitude}<br>
>>    click OK<br>
>> the first time it may warn you that the layer is not in edit mode and<br>
>> than proceding will turn on edit mode - this is fine<br>
>><br>
>> Now repeat for a 2nd field, using a different field name and<br>
>> expression "Longid" and $x<br>
>><br>
>> Now when you open the layer's Attribute Table you will see 2 new<br>
>> fields at the right which contain the point's Latid and Longid<br>
>> values...<br>
>><br>
>> Save the layer if you want to keep these additions.<br>
>><br>
>><br>
>> On 11/1/20 2:17 PM, J. M wrote:<br>
>>> Hi again Garth,<br>
>>><br>
>>> Well I parked this problem and only just came back to it. I may<br>
>>> have missed something, but when I create the new fields you<br>
>>> suggested in the Track they contain no information. Is this a very<br>
>>> advanced procedure? It seems like something quite basic, but<br>
>>> perhaps I've underestimated it (as I usually do with QGIS!).<br>
>>><br>
>>> Kind regards,<br>
>>> Jimi.<br>
>>><br>
>>> On Fri, Sep 11, 2020 at 11:51 AM J. M <<a href="mailto:jimimckay@gmail.com" target="_blank">jimimckay@gmail.com</a><br>
>>> <mailto:<a href="mailto:jimimckay@gmail.com" target="_blank">jimimckay@gmail.com</a>>> wrote:<br>
>>><br>
>>>      Hi Garth,<br>
>>><br>
>>>      Thanks a lot for the very complete answer! I'll give it a go as<br>
>>> soon as I resolve an unrelated Ubuntu problem. I hadn't realised<br>
>>> that GPX data wasn't automatically visible in Properties, and that<br>
>>> fields had to be created.<br>
>>><br>
>>>      Kind regards,<br>
>>>      Jimi.<br>
>>><br>
>>>      On Fri, Sep 11, 2020 at 4:26 AM Garth Fletcher<br>
>>> <<a href="mailto:garth@jacqcad.com" target="_blank">garth@jacqcad.com</a> <mailto:<a href="mailto:garth@jacqcad.com" target="_blank">garth@jacqcad.com</a>>> wrote:<br>
>>><br>
>>>          On 10 Sep 2020 at 20:12, J. M <<a href="mailto:jimimckay@gmail.com" target="_blank">jimimckay@gmail.com</a><br>
>>>          <mailto:<a href="mailto:jimimckay@gmail.com" target="_blank">jimimckay@gmail.com</a>>> wrote:<br>
>>>           > I can successfully import .gpx files into QGIS, and they<br>
>>>           > are<br>
>>>          visible and<br>
>>>           > can be clustered in new groups (waypoints, tracks and<br>
>>>           > routes<br>
>>>          appear as<br>
>>>           > independent layers). The problem I'm having is that I<br>
>>>           > can't<br>
>>>          seem to find<br>
>>>           > any way to access the data about the routes (distance,<br>
>>>           > time,<br>
>>>          etc) which is<br>
>>>           > clearly visible in the app I used to create the tracks<br>
>>><br>
>>>          The GPX file contains a number of fields whose contents you<br>
>>> can see /<br>
>>>          access in the layer's Attribute Table<br>
>>>             right-click on layer and choose Open Attribute Table<br>
>>><br>
>>>          However, these are only the extra fields in the GPX records<br>
>>> but NOT including the x,y coordinates (Long,Lat)<br>
>>><br>
>>>          To access the later, use the Field Calculator<br>
>>>             select the layer<br>
>>>             click on Open Field Calculator icon (Abaccus) in the<br>
>>> menu bar which is next to the Open Attribute Table icon in menu, or<br>
>>>              in Processing > GDAL > Vector Table > Field Calculator<br>
>>><br>
>>>          create new fields, called Lat and Long, as decimal numbers<br>
>>>          and enter the expression $X or $Y (see Geometry > for<br>
>>> details) When you click OK, the new fields will be appended and<br>
>>> filled in with the right values.<br>
>>><br>
>>>          You can then access them in the layer's Attribute Table.<br>
>>><br>
>>>          With those 2 extra fields you essentially have access to<br>
>>> everything that was recorded in the GPX file.<br>
>>><br>
>>>          You can also use Field Calculator to add more fields and<br>
>>> populate them with calculation results.<br>
>>><br>
>>>          As an aside, Field Calculator cannot create new fields in<br>
>>> the GPX file; instead it creates them as temporary virtual fields.<br>
>>><br>
>>>          A better approach is to first save the data in a shape file<br>
>>>             right-click on layer, choose Export > Save selected<br>
>>> features then open that file instead of the original GPX.<br>
>>>          Field Calculator will add new fields to that format.<br>
>>><br>
>>>          Cordially,<br>
>>>          --<br>
>>>          Garth Fletcher<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
>    Roxo<br>
><br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div>