Open stephenrjones opened 10 years ago
Just digging into this a little more -- it seems that the GDAL DataStore object isn't getting initialized correctly for some reason. An error gets thrown when trying to use it in other calls (OGR_DS_CREATE, OGR_DS_DESTROY). When this happens the temporary file created is in the incorrect state, and trying to write to it later causes the Seg fault
This might be a way to turn on exceptions: http://trac.osgeo.org/gdal/wiki/PythonGotchas#PythonbindingsdonotraiseexceptionsunlessyouexplicitlycallUseExceptions
Though, this doesn't seem to be working (probably because we're not using the osgeo library - couldn't get that working). I tried:
from django.contrib.gis.gdal.libgdal import lgdal lgdal.UseExceptions()
but that didn't work. Maybe you can see if the osgeo library works on your build?
Sure, I'll give it a shot
This shows the libraries that it checks for: https://github.com/django/django/blob/master/django/contrib/gis/gdal/libgdal.py
But the version I have loaded checks for: lib_names = ['gdal', 'GDAL', 'gdal1.9.0', 'gdal1.8.0', 'gdal1.7.0', 'gdal1.6.0', 'gdal1.5.0']
I'm wondering if the problem is the versions?
That's what I was suspecting. Which version of gdal do you have installed?
updated from 1.7.3 to 1.9.2 and still see the problem
from django.contrib.gis.gdal import libgdal help(libgdal) gives 1.9.2
I see that the newest version of django has 1.11... is there a way to just update django.contrib.gis.gdal ? Maybe 1.11 can help us. I'm also trying to export "Geospatial PDF" (for #256), but don't have that driver loaded with 1.9.2, and I don't think you can write to it with 1.9.2.
But, if you're up to 1.9.2, I'm not sure if that's still the issue.
Finally fixed this issue. Running this code on an x86_64 caused issues as the pointer values being passed from the GDAL calls were getting truncated to 32-bit values, which then were invalid. I setup function definitions within shape_view.py to check if the system is a 64bit system and create function signatures that would accept 64bit values
When trying to create a shapefile from the Job detail page, the system throws a Segmentation fault and exits:
Validating models...
0 errors found September 19, 2014 - 08:21:25 Django version 1.5.4, using settings 'geoq.settings' Development server is running at http://0.0.0.0:8000/ Quit the server with CONTROL-C. /opt/src/pyenv/geoq/nga-geoq/lib/python2.6/site-packages/django/conf/urls/defaults.py:3: DeprecationWarning: django.conf.urls.defaults is deprecated; use django.conf.urls instead DeprecationWarning) Segmentation fault (core dumped)