Hi Micha,<br><br>thanks for the tip! I managed to do it with the following command from FWTools shell:<br><br>ogr2ogr -update -append -f "PostgreSQL" PG:"host=localhost user=postgres dbname=db password=xxx"  <br>
my_gps_points.gpx waypoints -sql "SELECT name AS gps_nimi, time AS gps_aika FROM waypoints" -t_srs EPSG:3067 -nln <br>my_table_name<br><br>I selected the fields I wanted, and cast them to different field names in my db table. I only wanted waypoints, and also did a coordinate transformation from wgs84 -> ETRS-TM35FIN. Very handy, once you get the syntax right. Now the only manual thing left is to change the input gpx file name every time, if all other parameters stay constant.<br>
<br>Pekka<br><br><div class="gmail_quote">On Mon, Jul 4, 2011 at 11:42 AM, Micha Silver <span dir="ltr"><<a href="mailto:micha@arava.co.il">micha@arava.co.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<u></u>

  
    
  
  <div style="direction: ltr;" text="#000000" bgcolor="#ffffff"><div><div></div><div class="h5">
    <p style="margin-bottom: 0cm; margin-top: 0pt;">On 04/07/2011 11:29,
      Pekka Hurskainen wrote:<br>
    </p>
    <blockquote type="cite">
      <pre>Hello list,

Let's say I have a bunch of waypoints collected with a GPS device, and
uploaded to QGIS with GPSBabel in GPX-format. I have only four fields
in the GPX file which I want to keep (lat, lon, time, name).

Then I have an empty template shapefile, which has more fields
defined. Some of them has to be filled interactively in QGIS, some of
them will be filled by trigger functions in PostGIS. The point is that
the template shapefile has to match exactly the table definitions in
my PostGIS database, so that it is possible to append GPS datasets to
the database using PostGIS Manager plugin. I can't just spit the GPX
files straight to PostGIS.

The problem is how to "combine" the GPX points with the template. I've
tried to merge these two with fTools and mmqgis plugins, but these
both add all fields from both layers, which I don't want (there isn't
an option to choose fields). Also I haven't found any "append" tool
similar to ArcGIS in QGIS.

I know it's possible to overcome this with manually deleting the
unwanted fields, but I want to automate the process since this part
will be repeated hundreds of times.

Any ideas?

</pre>
    </blockquote>
    <br></div></div>
    Can you skip the shapefile step altogether and use ogr2ogr to go
    straight from gpx to PostGIS ?<br>
    ogr2ogr has an -append option to add new features to an existing
    layer, and a -select option to list which fields you want to insert
    into the target layer. <br>
    Then, with the new features already in PostGIS do your interactive
    editing as needed from QGIS.<br>
    <br>
    <br>
    <blockquote type="cite">
      <pre>Pekka Hurskainen
_______________________________________________
Qgis-user mailing list
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>

This mail was received via Mail-SeCure System.


</pre>
    </blockquote>
    <br>
    <br>
    <div>-- <br>
      
      <div>
        
        
        <p style="margin-bottom: 0cm; margin-top: 0pt; float: right;"><img alt="Hevra Logo" src="cid:part1.08010000.04070605@arava.co.il" border="0" width="135" height="59"></p>
        <p style="margin-bottom: 0cm; margin-top: 0pt; direction: ltr;">Micha


          Silver</p>
        <p style="margin-bottom: 0cm; margin-top: 0pt; direction: ltr;">Arava


          Development Co</p>
        <p style="margin-bottom: 0cm; margin-top: 0pt; direction: ltr;">052-3665918</p>
        <p style="margin-bottom: 0cm; margin-top: 0pt; direction: ltr;"><a href="http://www.surfaces.co.il" target="_blank">http://www.surfaces.co.il</a></p>
      </div>
    </div>
  </div>

</blockquote></div><br><br>