<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    AFAIK the "data" and "layer" option box in the "Save As" dialog only
    handles -dcso and -lco options for ogr. So the -sql .... won't work.
    <br>
    <br>
    One option is to create "virtual fields" in QGIS with the correct
    field names "name", "cmt" ... and give these virtual fields the
    relevant content. <br>
    However the export to gpx will fail if you specify
    -gpx_use_extensions=<b>no</b>, because the original field names
    doesn't fit the schema definition for GPX. This will cause an error
    message and the data won't be created<br>
    <br>
    To sum it up:<br>
    <ol>
      <li>Use virtual fields in QGIS to create fields and values that's
        acceptable for GPX</li>
      <li>use_gpx_extension has to be set to "yes"</li>
      <li>Remember to save your GPX data in the EPSG:4326 projection
        (ll/wgs84)</li>
    </ol>
    <p>Regards<br>
    </p>
    <p>Bo Victor Thomsen<br>
      AestasGIS<br>
      Denmark</p>
    <p>Den 16-02-2015 kl. 17:54 skrev Julien_Guilloux:<br>
    </p>
    <blockquote cite="mid:1424105669371-5187941.post@n6.nabble.com"
      type="cite">
      <pre wrap="">Hi list,
i already read a lot of post about exporting layer in another format using
"save as " windows of QGIS with adding ogr2ogr options (in data source box
or layer box down the windows).

the trouble is the same that a lot of people : i "only" want to export a
layer shape in a layer GPX

1) of course i could only use GPX_USE_EXTENSIONS  = YES and all my fields
would go into the <extension>
 xml; 
But... it is not what i need. i really need to have the fields "name" and
"cmt" as they exist in the real gpx structure !

2) so, how to rename my field "testfield" to a field called "name" so as to
respect GPX syntax ?

in the data source option i try many many many syntaxe :

-sql "SELECT testfield AS name FROM testlayer" (this is ogr2ogr
documentation...)
-sql "SELECT testfield AS name"
sql "SELECT testfield AS name FROM testlayer"
"SELECT testfield AS name FROM testlayer"
'SELECT testfield AS name FROM testlayer'

Etc... But it never works !

i also try some syntaxe using the -dsco option but no more succes !

so, is it possible to use ogr2 ogr option ?

another thing : there use to be a samll GPX plugin to do that, we could
choose the field for name etc. ( i don't talk about gps extension with
gpsbabel)
is this plugin still exist ? theis plugin in was made with ogr2ogr i think,
so what not to use ogr2org option directly ans asked here ?

thanks a lot.


Thanks for helping. So long





--
View this message in context: <a class="moz-txt-link-freetext" href="http://osgeo-org.1560.x6.nabble.com/save-layer-as-with-OGR2OGR-options-tp5187941.html">http://osgeo-org.1560.x6.nabble.com/save-layer-as-with-OGR2OGR-options-tp5187941.html</a>
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>