<html><head></head><body><div class="ydp57d3a63yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div dir="ltr" data-setdir="false">Hi Riche,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Thanks! Join (adding the spreadsheet layer from the vector layer, not vice versa) worked. Beforehand, I was able to add a filename column to the layer imported from GPX files using ogr2ogr's sql option (-sql "select *, '$f' as filename from tracks") and then join on that field.</div><div><br></div><div class="ydp57d3a63signature">Gerry</div></div>
        <div><br></div><div><br></div>
        
        </div><div id="yahoo_quoted_8993685904" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Thursday, September 12, 2019, 05:25:20 AM MDT, Richard McDonnell <richard.mcdonnell@opw.ie> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv5940039744"><style>#yiv5940039744 #yiv5940039744 --
 
 _filtered #yiv5940039744 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;}
 _filtered #yiv5940039744 {font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;}
 _filtered #yiv5940039744 {panose-1:2 4 5 3 5 4 6 3 2 4;}
 _filtered #yiv5940039744 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
#yiv5940039744  
#yiv5940039744 p.yiv5940039744MsoNormal, #yiv5940039744 li.yiv5940039744MsoNormal, #yiv5940039744 div.yiv5940039744MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:New serif;}
#yiv5940039744 a:link, #yiv5940039744 span.yiv5940039744MsoHyperlink
        {color:#0563C1;text-decoration:underline;}
#yiv5940039744 a:visited, #yiv5940039744 span.yiv5940039744MsoHyperlinkFollowed
        {color:#954F72;text-decoration:underline;}
#yiv5940039744 p.yiv5940039744MsoListParagraph, #yiv5940039744 li.yiv5940039744MsoListParagraph, #yiv5940039744 div.yiv5940039744MsoListParagraph
        {margin-top:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;font-size:12.0pt;font-family:New serif;}
#yiv5940039744 p.yiv5940039744msonormal0, #yiv5940039744 li.yiv5940039744msonormal0, #yiv5940039744 div.yiv5940039744msonormal0
        {margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:New serif;}
#yiv5940039744 span.yiv5940039744EmailStyle18
        {font-family:sans-serif;color:#1F497D;}
#yiv5940039744 .yiv5940039744MsoChpDefault
        {font-size:10.0pt;}
 _filtered #yiv5940039744 {margin:72.0pt 72.0pt 72.0pt 72.0pt;}
#yiv5940039744 div.yiv5940039744WordSection1
        {}
#yiv5940039744  
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {font-family:Symbol;}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {font-family:Wingdings;}
 _filtered #yiv5940039744 {font-family:Symbol;}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {font-family:Wingdings;}
 _filtered #yiv5940039744 {font-family:Symbol;}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {font-family:Wingdings;}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
 _filtered #yiv5940039744 {}
#yiv5940039744 ol
        {margin-bottom:0cm;}
#yiv5940039744 ul
        {margin-bottom:0cm;}
#yiv5940039744 </style><div>
<div class="yiv5940039744WordSection1">
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">Hi Gerry,</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">Apologies, if you’ve already tried these…</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">If you are only merging columns from a spreadsheet to a Vector Layer, assuming you have a common field, you can merge the data  by:-</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">1.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">On the
<b>Layers</b> tab, right clicking on the layer and selecting <b>Properties</b></span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">2.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">Selecting Joins</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">3.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">Click on the Plus sign at the bottom to add Vector Join</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">4.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">Set your
<b>Join Layer</b> (spreadsheet)</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">5.<span style="font:7.0pt;">      
</span></span></span><b><span style="font-size:11.0pt;">Join field</span></b><span style="font-size:11.0pt;">
 (common field)</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">6.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">The rest of the options are optional, select Ok once you are happy.</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">There you have it spreadsheet fields added to vector using a common field.</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">Now if you are looking to merge two vector datasets, then form the toolbar select</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D;"><span style="">·<span style="font:7.0pt;">        
</span></span></span><b><span style="font-size:11.0pt;">Vector</span></b></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D;"><span style="">·<span style="font:7.0pt;">        
</span></span></span><b><span style="font-size:11.0pt;">Data Management Tools</span></b></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D;"><span style="">·<span style="font:7.0pt;">        
</span></span></span><b><span style="font-size:11.0pt;">Merge vector Layers</span></b></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D;"><span style="">·<span style="font:7.0pt;">        
</span></span></span><span style="font-size:11.0pt;">At
<b>Input Layers</b> select both layers you want to merge and either clock <b>Run</b> to create a hit the button beside
<b>Merged</b> to save to a specific destination</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><b><span style="font-size:11.0pt;">Note</span></b><span style="font-size:11.0pt;"> this will
 just merge the datasets using common attributes where possible and adding the rest.
</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">If you want to format the output, an option I have used before, is to:-</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">1.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">In the toolbar select
<b>Layer</b></span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">2.<span style="font:7.0pt;">      
</span></span></span><b><span style="font-size:11.0pt;">Create Layer</span></b><span style="font-size:11.0pt;"></span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">3.<span style="font:7.0pt;">      
</span></span></span><b><span style="font-size:11.0pt;">New Temporary Scratch Layer</span></b><span style="font-size:11.0pt;"></span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">4.<span style="font:7.0pt;">      
</span></span></span><b><span style="font-size:11.0pt;">Select your Geometry type
</span></b><span style="font-size:11.0pt;">and select<b> OK</b></span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">5.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">While still in edit mode click open the
<b>Attribute Table</b></span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">6.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">Add new fields in the format you require</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">7.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">Open the Attribute table of one of the Vector Datasets you want to merge and
<b>select all </b>then go to <b>Edit</b> on the toolbar then select copy features</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">8.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">Click highlight the formatted Scratch Layer go to
<b>Edit</b> and select <b>Paste Features</b></span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">9.<span style="font:7.0pt;">      
</span></span></span><span style="font-size:11.0pt;">Go back to the scratch layer<b> attribute
</b>table and edit as required</span></p> 
<p class="yiv5940039744MsoListParagraph" style=""><span style="font-size:11.0pt;"><span style="">10.<span style="font:7.0pt;">  
</span></span></span><span style="font-size:11.0pt;">Rinse and repeat for the others</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">Without seeing samples of the data, I cant , unfortunately give you any more help than that.</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">Regards</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">Riche</span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:13.5pt;">-- </span><span style="font-size:11.0pt;"></span></p> 
<table class="yiv5940039744MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="width:184.3pt;"><tbody><tr><td colspan="1" rowspan="1" width="100%" style="width:100.0%;padding:0cm 0cm 4.5pt 0cm;">
<table align="left" class="yiv5940039744MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="width:190.4pt;margin-left:6.75pt;margin-right:6.75pt;"><tbody><tr style="min-height:42.45pt;"><td colspan="1" rowspan="1" style="padding:0cm 0cm 0cm 0cm;min-height:42.45pt;"></td><td colspan="1" rowspan="1" valign="top" style="padding:0cm 0cm 0cm 7.5pt;min-height:42.45pt;">
<p class="yiv5940039744MsoNormal" style="margin-bottom:12.0pt;"><b><span style="font-size:11.5pt;">Richard McDonnell</span></b><span style="font-size:7.5pt;"><br clear="none">
</span><b><span style="font-size:8.5pt;">GIS Specialist</span></b><span style="font-size:8.5pt;"> | FRM Data Management</span><span style="font-size:7.5pt;"><br clear="none">
<b>MSc Geographic Information Systems</b></span></p> 
</td><td colspan="1" rowspan="1" style="padding:7.5pt 0cm 0cm 7.5pt;min-height:42.45pt;"></td></tr></tbody></table>
<div align="center" class="yiv5940039744MsoNormal" style="text-align:center;"><span style="font-size:11.0pt;">
</span><hr align="center" size="2" width="100%">
</div>
<table class="yiv5940039744MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%;"><tbody><tr><td colspan="1" rowspan="1" valign="top" width="50%" style="width:50.0%;padding:0cm 4.5pt 0cm 0cm;">
<table class="yiv5940039744MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="width:194.2pt;"><tbody><tr style="min-height:14.15pt;"><td colspan="1" rowspan="1" style="padding:0cm 2.25pt 0cm 0cm;min-height:14.15pt;"></td><td colspan="1" rowspan="1" style="padding:0cm 0cm 0cm 0cm;min-height:14.15pt;">
<p class="yiv5940039744MsoNormal"><span style="font-size:7.5pt;">Email:  <a rel="nofollow" shape="rect" ymailto="mailto:richard.mcdonnell@opw.ie" target="_blank" href="mailto:richard.mcdonnell@opw.ie"><span style="color:#006C85;">richard.mcdonnell@opw.ie</span></a></span><span style="font-size:11.0pt;"></span></p> 
</td></tr></tbody></table>
<p class="yiv5940039744MsoNormal"><span style="font-size:7.5pt;">  </span></p> 
<table class="yiv5940039744MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="width:164.8pt;"><tbody><tr style="min-height:14.65pt;"><td colspan="1" rowspan="1" style="padding:0cm 2.25pt 0cm 0cm;min-height:14.65pt;"></td><td colspan="1" rowspan="1" style="padding:0cm 0cm 0cm 0cm;min-height:14.65pt;">
<p class="yiv5940039744MsoNormal"><span style="font-size:7.5pt;">Phone:  + 353 (0) 1 647 6543</span><span style="font-size:11.0pt;"></span></p> 
</td></tr></tbody></table>
<p class="yiv5940039744MsoNormal"><span style="font-size:7.5pt;">  </span></p> 
<table class="yiv5940039744MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="width:183.4pt;"><tbody><tr style="min-height:14.25pt;"><td colspan="1" rowspan="1" style="padding:0cm 3.75pt 0cm 0cm;min-height:14.25pt;"></td><td colspan="1" rowspan="1" width="238" style="width:178.85pt;padding:0cm 0cm 0cm 0cm;min-height:14.25pt;">
<p class="yiv5940039744MsoNormal" style="margin-bottom:3.75pt;"><span style="font-size:7.5pt;">Mobile:  +353 (0) 87 688 5964</span><span style="font-size:11.0pt;"></span></p> 
</td></tr></tbody></table>
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;"></span></p> 
</td><td colspan="1" rowspan="1" valign="top" width="50%" style="width:50.0%;padding:4.5pt 0cm 0cm 1.5pt;"></td></tr></tbody></table>
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<table class="yiv5940039744MsoNormalTable" border="0" cellpadding="0"><tbody><tr><td colspan="1" rowspan="1" style="padding:0cm 3.75pt 0cm 0cm;"></td><td colspan="1" rowspan="1" style="padding:0cm 3.75pt 0cm 0cm;"></td><td colspan="1" rowspan="1" style="padding:0cm 3.75pt 0cm 0cm;"></td></tr></tbody></table>
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;"></span></p> 
</td></tr></tbody></table>
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<p class="yiv5940039744MsoNormal"><span style="font-size:11.0pt;">  </span></p> 
<div class="yiv5940039744yqt4846343493" id="yiv5940039744yqt40574"><div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm;">
<p class="yiv5940039744MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;">From:</span></b><span lang="EN-US" style="font-size:11.0pt;"> Qgis-user <qgis-user-bounces@lists.osgeo.org>
<b>On Behalf Of </b>G Fourteener<br clear="none">
<b>Sent:</b> 11 September 2019 17:49<br clear="none">
<b>To:</b> qgis-user@lists.osgeo.org<br clear="none">
<b>Subject:</b> [Qgis-user] Importing records from both spreadsheet and gpx files</span></p> 
</div>
</div>
<p class="yiv5940039744MsoNormal">  </p> 
<div>
<div>
<div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">Hello,</span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">  </span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">I've been trying to figure out how to do this...</span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">  </span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">I have a spreadsheet of records that has a field for the GPX file for each record. I'm able to use ogr2ogr to import the spreadsheet and the GPX files into different layers in a geopackage
 file. I haven't yet been able to figure out how to combine the two data sources into a single layer, or add a geometry column (and other GPX columns) to the imported spreadsheet layer from the corresponding GPX file. I've also tried using ogrmerge. The GPX
 layer uses any name within that file (which is different than the filename). I see QGIS has a vector layer merge function, but don't think that will work. Looks like using Python and gdal/ogr modules might work...</span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">  </span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">The spreadsheet looks like:</span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">name, gpx filename, source, date, notes</span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">  </span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">Thanks,</span></p> 
</div>
<div>
<p class="yiv5940039744MsoNormal"><span style="">Gerry</span></p> 
</div>
</div>
</div>
<p class="yiv5940039744MsoNormal"><span style="">  </span></p> 
</div></div>
</div>
<br clear="none"><br clear="none">Email Disclaimer: <a rel="nofollow" shape="rect" target="_blank" href="http://www.opw.ie/en/disclaimer/">http://www.opw.ie/en/disclaimer/</a>


</div></div></div>
            </div>
        </div></body></html>