<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 12pt; color: #000000'>Thanks Victor, <br>That's what i thought to...There are some (litte) steps to do manualy.<br>But i need to propose my users a easy script, so i am going to look for a quick script ( a good way to have a look to model and script...)<br><br>best regards,<br>Julien<br><br>------------------------------<br>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><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
    <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">
      <pre>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" target="_blank">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" target="_blank">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
    <br>
  

<br>_______________________________________________<br>Qgis-user mailing list<br>Qgis-user@lists.osgeo.org<br>http://lists.osgeo.org/mailman/listinfo/qgis-user</div><br></div></body></html>