[mapserver-users] MapServer and Geopackage failing

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Tue Mar 6 08:05:13 PST 2018


Hi,

Please explain what you are actually doing. Do you wish to use geopackage for input or output, or both?  For rasters, vectors, or both?

If you use gpkg as input I suggest to create the database with GDAL from some publicly available datasets so others can do the same for reproducing you case (share your ogr2ogr or gdal_translate commands), with a complete mapfile that you will hopefully provide as well.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Seth G
Lähetetty: 6. maaliskuuta 2018 12:20
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: [mapserver-users] MapServer and Geopackage failing

Hi all,

I'm trying out the geopackage format as an alternative to shapefiles but running into an issue where MapServer expects the geopackage dataset to include spatialite. Drawing layers with shp2img logs the following:

[Tue Mar 06 10:39:42 2018].512000 msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Tue Mar 06 10:39:42 2018].512000 msDrawMap(): WMS/WFS set-up and query, 0.000s [Tue Mar 06 10:39:42 2018].529000 msOGRFileOpen: Spatialite support in GPKG not enabled [Tue Mar 06 10:39:42 2018].549000 msOGRFileNextShape(): OGR error. OGR GetNextFeature() error'd. Check logs.
[Tue Mar 06 10:39:42 2018].549000 msOGRFileNextShape(): In ExecuteSQL(): sqlite3_prepare(SELECT spatialite_version()):
  no such function: spatialite_version
[Tue Mar 06 10:39:42 2018].550000 msDrawMap(): Image handling error. Failed to draw layer named 'ways'.  

The spatialite_version function is missing in the geopackage. The dataset was created by exporting from MapServer as an OUTPUTOPTION:

      OUTPUTFORMAT
        NAME "GeoPackage"
        DRIVER "OGR/GPKG"
        FORMATOPTION "STORAGE=memory"
        FORMATOPTION "FORM=simple"
        FORMATOPTION "FILENAME=result.gpkg"
        FORMATOPTION "DSCO:SPATIALITE=YES"	# not a listed option, but tried anyway	
        FORMATOPTION "LCO:SPATIAL_INDEX=YES"
    END
  
Running a GisInternals build,  including GDAL 2.1.3 and MapServer 7.0.4. 

Relevant code is at https://github.com/mapserver/mapserver/blob/aae74ff2abed3f2f8fe1f76c9b4bbccf15023dc1/mapogr.cpp#L1313
It looks like the error should be swallowed up?

The same dataset exported directly to spatilite works fine. 

Anyone experienced the above issue?

Regards,

Seth


--
web:http://geographika.co.uk
twitter: @geographika
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list