[mapserver-users] MApserver and geoJSON via URL

Wolfgang Lahr bgiv at gmx.de
Sat Jun 21 08:13:41 PDT 2014


Hello list,

I am having a hard time displaying geoJSON from an URL in Mapserver
(v5.6.5 and v6.0.3) on Windows. The URL is working in QGIS, OpenLayers,
and ogrinfo. However, Mapserver will crash.
The respective section of the mapfile looks like:

   CONNECTIONTYPE OGR
   CONNECTION "http://servername/c3agc-REST/geojson?format=geojson&cadaster_num=KAT_18"
   #CONNECTION "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json"
    DATA "select * from OGRGeoJSON"

Testing with shp2img, in 5.6.5 the error comes from libcurl (as seen in the events log) and
nothing gets read. In 6.0.3 the queried features are read, but not
displayed and the error comes from inside libmap.dll. Mapserver debug log doesn't show anything.

With CONFIG "CPL_DEBUG" "ON", I get with shp2img:

HTTP: Fetch(http://servername/c3agc-REST/geojson?format=geojson&cadaster_num=KAT_18)
HTTP: These HTTP headers were set: Accept: text/plain Accept: application/json

OGR: OGROpen(http://servername/c3agc-REST/geojson?format=geojson&cadaster_num=KAT_18/02260FC8)
succeeded as GeoJSON.

GenSQL: 1 features read on layer 'OGRGeoJSON'.

And, it's the same with an ESRI-Ressource (an example from the ogr
geoJSON format description):

  CONNECTION "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json"

A connection to a geoJSON file like:

  CONNECTION '/pathToGeoJSON/map/geoJSON.geojson'

will work fine.

Any idea how to fix this?

tia
wollah




More information about the MapServer-users mailing list