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

open datasource in read-only mode #22436

Closed
qgib opened this issue Mar 11, 2016 · 4 comments
Closed

open datasource in read-only mode #22436

qgib opened this issue Mar 11, 2016 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Mar 11, 2016

Author Name: Martin Landa (Martin Landa)
Original Redmine Issue: 14458
Affected QGIS version: 2.8.7
Redmine category:data_provider/ogr


Hi,

QGIS has some problems when opening datasources in read-only mode (eg. Shapefiles located in directory where the user has only read permission). When you open single file it works, but in log window appears

OGR[3] chyba 4: Unable to open /mnt/home/pc07/Repository/gismentors/shp/osm/pozarni_stanice.shp or /mnt/home/pc07/Repository/gismentors/shp/osm/pozarni_stanice.SHP.

The real problem starts when you try read all layers from directory. Then you get error:

Invalid Data Source: /mnt/home/pc07/Repository/gismentors/shp/ochrana_uzemi is not a valid or recognized data source

and nothing is open.

@qgib
Copy link
Contributor Author

qgib commented Mar 15, 2016

Author Name: Maximilian Krambach (Maximilian Krambach)


When opening a directory with read-only shapes in it, I get I get a

This message is created by the OGR provider, not QGIS.

https://github.com/qgis/QGIS/blob/5bb25d8917dc0d494ae46c035f8e019f448c60fb/src/providers/ogr/qgsogrprovider.cpp#l2727
QgsOgrProvider::open() handles the opening of a shapefile by checking if the OGROpen (... ,true) results in a valid layer (here the "unable to open" message is generated by OGR), and if not, proceeds with OGROpen (....,false). --> Layer is opened in read-only mode

I think, if opened as a directory, somewhere in the code it is tried with just OGROpen(....,true), and that fails, resulting in the layers affected to not open at all.

@qgib
Copy link
Contributor Author

qgib commented Mar 25, 2016

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was changed from 2.16 to Version 2.16

@qgib
Copy link
Contributor Author

qgib commented Mar 29, 2016

Author Name: Nyall Dawson (@nyalldawson)


I can't reproduce - What method are you using to add all files from a directory?


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented May 21, 2016

Author Name: Giovanni Manghi (@gioman)


closing for lack of feedback, please reopen if necessary.


  • resolution was changed from to not reproducable
  • status_id was changed from Feedback to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
@qgib qgib added this to the Version 2.16 milestone May 25, 2019
@qgib qgib closed this as completed 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! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

1 participant