Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDAL/OGR Convert Format, persistent/unwanted default output format #26755

Closed
qgib opened this issue May 7, 2018 · 6 comments
Closed

GDAL/OGR Convert Format, persistent/unwanted default output format #26755

qgib opened this issue May 7, 2018 · 6 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented May 7, 2018

Author Name: Lance Evans (Lance Evans)
Original Redmine Issue: 18923
Affected QGIS version: 3.0.2
Redmine category:processing/ogr


  1. In modeler, trying to convert a line shapefile to GPX using GDAL Convert Format. The algorithm insists on leaving in the default output format [-f "ESRI Shapefile"] even though I've input [-f "GPX"] in the Additional Creation Options. This results in an empty shapefile with standard GPX attributes (ele, time, magvar, geoidheight, name, cmt, descr, etc.) The processing log illustrates how the GDAL command includes output formats for both shapefile and GPX

{ INPUT: 'output_7', OPTIONS: '-f "GPX"', OUTPUT: 'C:/somepath/gdal_convertformat_1_gpxout.shp' }
GDAL command:
ogr2ogr -f "ESRI Shapefile" -f "GPX" "C:/somepath/gdal_convertformat_1_gpxout.shp" C:/somepath/INPUT.shp INPUT

  1. Similarly, using the Convert Format from the Processing Toolbox and only adding [-f "GPX"] to the additional creation options yields the following in the console call:
    ogr2ogr -f "ESRI Shapefile" -f "GPX" "C:/somepath/OUTPUT.shp" path_to_data_file layer_name

  2. Finally, for QGIS 3, there appears to be no means of modifying the GDAL command window. The Processing Toolbox Convert Format shows the resulting command window, but it is not editable.

@qgib
Copy link
Contributor Author

qgib commented May 7, 2018

Author Name: Nyall Dawson (@nyalldawson)


The output format is automatically set based on the output file extension. It may be a silly question, but have you tried converting to a .gpx file destination?

@qgib
Copy link
Contributor Author

qgib commented May 7, 2018

Author Name: Nyall Dawson (@nyalldawson)


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented May 8, 2018

Author Name: Lance Evans (Lance Evans)


I had not as I'm trying to get temporary layer result. If I specify a GPX file for output, as opposed to leaving blank to create a temporary layer, it fails. Processing log gives: ERROR 4: Failed to create GPX file "somepath/outtest.gpx". ERROR 1: GPX driver failed to create "somepath/outtest.gpx"

The line layer being used as input can be saved as a GPX file with no issues, but I can't seem to complete conversion with GDAL Convert Format/ogr2ogr.

@qgib
Copy link
Contributor Author

qgib commented May 8, 2018

Author Name: Nyall Dawson (@nyalldawson)


What's the gdal command when you try to export as gpx?

@qgib
Copy link
Contributor Author

qgib commented May 8, 2018

Author Name: Lance Evans (Lance Evans)


Using Convert Format from the Processing Toolbox, using no Additional Creation Options, and path/gpxtest.gpx as the converted file name, the console call shows:
ogr2ogr -f "ESRI Shapefile" "C:/Users/Lance/AppData/Local/Temp/processing_919f0c64ee7642c487acd74ea270cd12/12502b1eb597496ea7548d80c5b7b2b1/OUTPUT.shp" path_to_data_file layer_name

After running, the log shows the following was executed:
ogr2ogr -f "GPX" ""P:/Lunate Google Drive/QGIS Data/GPS Testing/gpxtest.gpx"" C:/Users/Lance/AppData/Local/Temp/processing_919f0c64ee7642c487acd74ea270cd12/663e287d5e484d0d90b5a896c900760f/INPUT.shp INPUT

@qgib
Copy link
Contributor Author

qgib commented Jun 4, 2018

Author Name: Nyall Dawson (@nyalldawson)


Fixed in master


  • resolution was changed from to fixed/implemented
  • status_id was changed from Feedback to Closed

@qgib qgib closed this as completed Jun 4, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant