-
Notifications
You must be signed in to change notification settings - Fork 88
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
Weird "Could not open the datasource at …" error #231
Comments
"Could not open the datasource" implies you are not giving the correct path to the data on the command line. It looks like the command in the docs only works if you have moved all the |
Yes that would be the easy explanation. But the path is indeed correct. And it does work perfectly fine if I add the above code to manage.py -- Note that with "working perfectly fine" I don't mean just the added lines but the whole import! So to make it more clear:
|
So I can't think what to suggest, sorry. DataSource is just a wrapper for the underlying GDAL library, so I don't really know what it could be doing. What OS, what version of Django, what version of GDAL are you using? It seems to be okay on e.g. Debian wheezy, GDAL 1.9, Django 1.8. |
This is
on debian jessie. I don't think it's that urgent issue if noone else sees this. And even if: There is a workaround. I've found the workaround while debugging: First I checked if the paths were correct. I even tried with absolute paths. My next attempt was to move the |
So far I've tracked it down to django's |
Just to note that on jessie here, with (system) GDAL 1.10.1 (no python package installed) and Django 1.8.12 or Django 1.9.5, it works okay for me. I wonder what's different! |
My first guess was that the working directory is changed at some point. But that would only be relevant for relative URLs. I might take some time to take a closer look later today. |
I had the exact same problem as torotil and the same solution worked for me. I'm using Amazon Web Services with the following Thank you for the workaround torotil. |
I can at least confirm that this is not a problem which is specific to mapit. We've observed this same behaviour from
|
https://community.bitnami.com/t/rebuild-gdal-with-expat-xml-parser/41762/2 seems to be the same too. I've replicated the issue in jessie. |
Okay, this is due to I think a bug in Django prompted by our import of gdal from osgeo in |
Ah yes. The merits of import-time side-effects. (Most often disguised using decorators.) Thanks for tracking this down! |
#260 has been merged. |
As noted elsewhere, OS X will always fail to open and data the first time ¯\_(ツ)_/¯
When I try to import he data using this guide I always get an "Could not open the datasource at …" error for the first file of the boundary-line data.
Strangely the problem goes away if I add 2 lines directly to manage.py:
It seems that the first call to DataSource has some (in that case helpful) side-effects.
The text was updated successfully, but these errors were encountered: