[mapserver-users] WFS OUTPUTFORMAT and application/json

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Thu Dec 20 00:14:29 PST 2018


Hi,

We use outputformat as follows. The mimetype is what is written to GetCapabilities, in our case
<GetFeatureInfo><Format>application/json</Format>
OGC service clients are supposed to use that as the format name. The problem that you have by using "application/json" as a name may be a bug but you can avoid it by using some other name. If you want to support both "application/json" and  "application/json; subtype=geojson" you must write two outputformats.

OUTPUTFORMAT
  NAME "geojson"
  MIMETYPE "application/json"
  DRIVER "TEMPLATE"
  FORMATOPTION " geojson_template.js"
END

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Seth G
Lähetetty: 20. joulukuuta 2018 0:28
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: [mapserver-users] WFS OUTPUTFORMAT and application/json

Hi list,

Has anyone run into the following issue with using "application/json" in an OUTPUTFORMAT NAME as follows?

  OUTPUTFORMAT
    NAME "application/json"
    DRIVER "OGR/GEOJSON"
    MIMETYPE "application/json; subtype=geojson"
    FORMATOPTION "FORM=SIMPLE"
    FORMATOPTION "STORAGE=memory"
  END  

Then a request such as below:

http://localhost/mapserver/?&SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&OUTPUTFORMAT=application/json&TYPENAME=layer&SRSNAME=EPSG:3857

Causes the following error:

msWFSGetFeature(): WFS server error. OUTPUTFORMAT 'application/json' does not have IMAGEMODE FEATURE, and is not permitted for WFS output.

Adding a IMAGEMODE FEATURE (or RGBA) doesn't resolve the issue. 
I thought it may have been an issue with the slash in the NAME, but this works in other cases. Changing NAME to "geojson" also works fine, but I'm wondering why this occurs. GeoServer and TinyOWS both use "application/json" so it would be good if it worked for MapServer also. 


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