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

problem with json format #1

Open
lucadelu opened this issue Jul 29, 2013 · 4 comments
Open

problem with json format #1

lucadelu opened this issue Jul 29, 2013 · 4 comments
Assignees

Comments

@lucadelu
Copy link

I found a bug using json file, it is possible to replicate converting lake.gml of Alaska dataset in GeoJSON format using ogr2ogr. The returned error is:

Traceback (most recent call last):
File "/home/lucadelu/.qgis2/python/plugins/rt_mapserver_exporter/mapfileexportdlg.py", line 353, in accept
if mapscript.MS_SUCCESS != ms_layer.applySLD( sldContents, ms_layer.name ):
IOError: msShapefileOpen(): Unable to access file. (/home/lucadelu/geodati/qgis_sample_data/gml/lakes.json)
msShapefileOpen(): Unable to access file. (/home/lucadelu/geodati/qgis_sample_data/gml/lakes.json)

@luipir
Copy link
Contributor

luipir commented Aug 2, 2013

confirmed

exceprion is generated by mapscript call applySLD generating a IOError exception without other information.
SLD creation by qgis call works fine, error is in mapscript code.
I'm investigating it.

thenks for the report

@luipir
Copy link
Contributor

luipir commented Aug 2, 2013

SLD generated before mapscript call applySLD:

https://gist.github.com/6139610.git

@luipir
Copy link
Contributor

luipir commented Aug 2, 2013

error come from this piece of code added as preliminary patch in mapscript
MapServer/MapServer#3114
it works only with shapefile.
in mapogcsld.c:259 the call msLayerOpen(GET_LAYER(map, i)) set ms_error that is not reset after exit this call => wrapper receive MS_SUCCESS as result but still find a ms_error set rising the exception

should be managed by mapscript team

@ghost ghost assigned luipir Aug 2, 2013
@luipir
Copy link
Contributor

luipir commented Aug 5, 2013

wrote a report in the mapserver-dev list:


hi mapscript

I've a IOError generarted by applySLD call applying this SLD: https://gist.github.com/luipir/6139610

debugging msSLDApplySLD call I found that it exit with the last line mapogcsld.c:479 - return MS_SUCCESS;

but an error code returned by python wrapper: _wrap_layerObj_applySLD
to be precise the call:

errorObj *ms_error = msGetErrorObj();

returns:

ms_error->code = 1
ms_error.routine = "msShapeFileOpen()"
ms_error->message=(/mnt/data/PROGRAMMING/FAUNALIA/qgis-plugins/PLUGIN_TEST_DATA/rt_mapserver_exporter/singlejson_alphatest_data/lakes.json)...
ms_error->isreported=0

then wrapper scan ms_error-> code and return error to python... but applySLD was succesful!

seems related to a preliminary patch: MapServer/MapServer#3114 applied one years ago
that piece of code work only with shapefile

I think it could be managed refining the code before applying the above preliminary patch

thanks Luigi Pirelli (luigi.pirelli@faunalia.it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants