<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hello,<br>
<br>
Le 04/07/2011 15:43, Pekka Hurskainen claviota:
<blockquote
 cite="mid:CAKuj5C1OHdjFnvQiT4WvaKe5BFg-P6kDcPE3z+eshoFPo1SyfA@mail.gmail.com"
 type="cite">Hi Micha,<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>
</blockquote>
<br>
Looks neat.<br>
What I usually do for such tasks is to generate a .csv using the
Marvelous gpsbabel.  You can define a template and fine-tune it to your
needs. See the manual page or its documentation.<br>
After, I have a few bash scripts which automagically dump .csv files
into my database tables.<br>
<br>
<blockquote
 cite="mid:CAKuj5C1OHdjFnvQiT4WvaKe5BFg-P6kDcPE3z+eshoFPo1SyfA@mail.gmail.com"
 type="cite">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>
</blockquote>
<br>
If all your input files are stored in a directory, you can write a
simple script, something like:<br>
<br>
for i in *.gpx ; <br>
do <br>
ogr2ogr -update -append -f "PostgreSQL" PG:"host=localhost
user=postgres dbname=db password=xxx"  <br>
$i waypoints -sql "SELECT name AS gps_nimi, time AS gps_aika FROM
waypoints" -t_srs EPSG:3067 -nln <br>
my_table_name<br>
;  done<br>
<br>
<br>
This will proceed all your files.<br>
This was in bash, but you can write something in any other (decent)
shell, or in python, whatever you like.<br>
And if the files are scattered in a directory structure, you can "walk"
through it, python has some neat tools for this. And all (decent)
shells also, of course.<br>
<br>
<br>
<div class="gmail_quote">
<blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
  <div style="direction: ltr;" text="#000000" bgcolor="#ffffff">
  <div>
  <div class="h5">
  <blockquote type="cite">
    <pre>Any ideas?
    </pre>
  </blockquote>
  </div>
  </div>
  </div>
</blockquote>
</div>
<br>
Plenty! ;)<br>
<br>
À+<br>
Pierre<br>
-- <br>
<pre class="moz-signature" cols="72">____________________________________________________________________________
Pierre Chevalier Géologue EI
    Mesté Duran
    32100 Condom
  Tél+fax  :    09 75 27 45 62
                05 62 28 06 83
                06 37 80 33 64
  Émail  :   pierrechevaliergeolCHEZfree.fr
  icq#   :   10432285
  skype  :   pierre.chevalier1967
  <a class="moz-txt-link-freetext" href="http://pierremariechevalier.free.fr/pierre_chevalier_geologue">http://pierremariechevalier.free.fr/pierre_chevalier_geologue</a>
____________________________________________________________________________
</pre>
</body>
</html>