Bug report #4192

Shapefiles loaded with File browser are not recognized as OGR data sources for rasterization

Added by Paolo Cavallini over 13 years ago. Updated over 11 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GDAL Tools
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:worksforme
Crashes QGIS or corrupts data:No Copied to github as #:14167

Description

If I apply Rasterize from GDALTools on a layer loaded double-clicking from File browser (shown on the legend as "filename.shp") this is not recognized as a valid data source. The same file, loaded with the old method, works smoothly

History

#1 Updated by Paolo Cavallini over 13 years ago

When loaded with the old method, it is shown as "filename", not as "filename.shp"

#2 Updated by Giuseppe Sucameli over 13 years ago

The problem is that the layer's source ends with

 |layerid=0 

Loading a OGR layer from QGis, the layer's source contains only the file path.

#3 Updated by Martin Dobias over 13 years ago

That is a legal URI - some data sources may contain multiple layers, in that case also QGIS shows a dialog that lets user to select "sublayers" to load - they also include the "|layerid=X" postfix.

#4 Updated by Giuseppe Sucameli over 13 years ago

  • Category set to GDAL Tools
  • Assignee changed from Martin Dobias to Giuseppe Sucameli

So it's GdalTools plugin that has to check the path when selecting a layer from canvas.

#5 Updated by Giuseppe Sucameli about 13 years ago

Martin Dobias wrote:

That is a legal URI - some data sources may contain multiple layers, in that case also QGIS shows a dialog that lets user to select "sublayers" to load - they also include the "|layerid=X" postfix.

Why don't add "|layername=Y" too?
There're GDAL tools that get a vector as input, they get layername instead of layerid to select the right sublayer.

E.g. gdal_rasterize (-l), gdalwarp (-cl)

#6 Updated by Giovanni Manghi almost 13 years ago

  • Target version set to Version 1.7.4

#7 Updated by Giuseppe Sucameli almost 13 years ago

Now the problem occurs only if the datasource contains more than one layer, otherwise the |layerid=X is not appended to the layer URI.

#8 Updated by Paolo Cavallini over 12 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0
  • Crashes QGIS or corrupts data set to No
  • Affected QGIS version set to master

#9 Updated by Paolo Cavallini about 12 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#10 Updated by Paolo Cavallini almost 12 years ago

  • Assignee changed from Giuseppe Sucameli to anonymous -

#11 Updated by Jürgen Fischer over 11 years ago

  • Assignee deleted (anonymous -)

#12 Updated by Daniel Vaz over 11 years ago

This still occurs?

Could you provide some dataset to reproduce it?

Thanks in advance

#13 Updated by Paolo Cavallini over 11 years ago

  • Resolution set to worksforme
  • Status changed from Open to Closed

Apparently fixed in the meantime

Also available in: Atom PDF