GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.43k stars 1.12k forks source link

Windows GDAL Upload Fail #1538

Closed nathanhilbert closed 10 years ago

nathanhilbert commented 10 years ago

In trying to get GeoNode to work on Windows I ran into an issue with uploading shapefiles. I get the following error on the upload/progress call:

GDAL_ERROR 4: Record count in .shp header is -11, which seems
unreasonable.  Assuming header is corrupt.
exception: access violation writing 0x00000018
Traceback (most recent call last):
  File "D:\Srv\geonode\geonode\layers\views.py", line 131, in layer_upload
    title = form.cleaned_data["layer_title"],
  File "D:\Srv\geonode\geonode\layers\utils.py", line 322, in file_upload
    bbox_x0, bbox_x1, bbox_y0, bbox_y1 = get_bbox(filename)
  File "D:\Srv\geonode\geonode\layers\utils.py", line 256, in get_bbox
    datasource = DataSource(filename)
  File "D:\Srv\venv86\lib\site-packages\django\contrib\gis\gdal\datasource.py",
line 79, in __init__
    ds = capi.open_ds(force_bytes(ds_input), self._write, byref(ds_driver))
WindowsError: exception: access violation writing 0x00000018

This occurred with both GDAL version 1.11 and 1.10. It can ultimately be traced back to the GDAL library http://fossies.org/dox/gdal-1.11.0/shpopen_8c_source.html on calculating the records of a shapefile.

ischneider commented 10 years ago

Does the shapefile work in QGIS? How about GeoServer? Other software?

What tool/program produced the shapefile?

To be fair, having -11 records does seems 'unreasonable' :)

nathanhilbert commented 10 years ago

Very true. This happens with all shapefiles with different negative numbers displayed as the number of records. I was able to upload the same shapefile in an Ubuntu GeoNode install.