Bug report #13760
OGR Conversion format (Toolbox) don't work due to wrong syntax
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Sandro Santilli | ||
Category: | Processing/OGR | ||
Affected QGIS version: | 2.12.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 21786 |
Description
With the aim of convert a kml to shp, in QGIS I do:
Processing > Toolbox > GDAL/OGR > [OGR] Conversion > Conversion format
But the executed command:
cmd.exe /C ogr2ogr.exe –f “ESRI Shapefile” C:/Users/jj/Desktop/new/qgisexport/qgisexport.shp C:/User/jj/Desktop/new/doc.kml doc
GDAL command output:
FAILURE: Couldn`t fetch request layer 'doc'!
And any shapefile is generated.
This happens with both with QGIS 2.6.1 ( QGIS-OSGeo4W-2.6.1-1-Setup-x86_64.exe ) and QGIS 2.12 ( QGIS-OSGeo4W-2.12.0-1-Setup-x86_64.exe ).
With OGR2GUI, the executed command no included the final 'doc' and works:
ogr2ogr -f "ESRI Shapefile" "C:\\Users\\jj\\Desktop\
ew\\ogr2gui\\ogr2gui.shp" "C:\\Users\\jj\\Desktop\
ew\\doc.kml" -overwrite
Generate the appropiate 762 shapefiles (with their attached archives: prj, shx, dbf).
Thanks!
History
#1 Updated by Alex Puente about 9 years ago
I misspelled the line, is:
cmd.exe /C ogr2ogr.exe –f “ESRI Shapefile” C:/Users/jj/Desktop/new/qgisexport/qgisexport.shp C:/User/jj/Desktop/new/doc.kml doc
I had to write this line by hand, because I can not 'copy and paste' the log in the 'OGR Conversion format' window because the "error window" out above all others (prohibiting copy and paste from the window below) and when I close it the 'OGR Conversion format' window also closes (this is another thing to improve).
Thanks!
#2 Updated by Jürgen Fischer about 9 years ago
Alex Puente wrote:
I misspelled the line, is:
cmd.exe /C ogr2ogr.exe –f “ESRI Shapefile” C:/Users/jj/Desktop/new/qgisexport/qgisexport.shp C:/User/jj/Desktop/new/doc.kml doc
"User" is still a typo. Question is if it was on the actual invocation or when filing the ticket.
#3 Updated by Alex Puente about 9 years ago
"C:\\User\\" is a typo, both routes are C:/Users/...
It's a good idea to modify the error window behavior for possible copy and paste and avoid handwriting typo error in bug tickets.
Thanks!
#4 Updated by Giovanni Manghi about 9 years ago
- Assignee set to Giovanni Manghi
- Status changed from Open to In Progress
- Category set to Processing/OGR
The problem is how we build the ogr2ogr command in Processing, and the fact that the kml file name can not correspond to what is written in the "name" tag inside the kml. Probably when exporting from kml we can change the way the command is written.
#5 Updated by Sandro Santilli about 8 years ago
- Target version set to Version 2.14
- Assignee changed from Giovanni Manghi to Sandro Santilli
- Status changed from In Progress to Feedback
Alex, Giovanni: could you please try with current master_2 or release-2_14 branches ?
I've recently fixed extracting layer names during format conversion in processing.
#6 Updated by Giovanni Manghi about 8 years ago
Sandro Santilli wrote:
Alex, Giovanni: could you please try with current master_2 or release-2_14 branches ?
I've recently fixed extracting layer names during format conversion in processing.
Seems to work fine on 2.18.
#7 Updated by Giovanni Manghi almost 8 years ago
- Resolution set to fixed/implemented
- Status changed from Feedback to Closed