Support for 'application/json; subtype=geojson; ' as WFS outputformat in the new mapviewer

1328
4
12-07-2021 08:08 AM
Status: Open
JoëlHempenius3
Occasional Contributor II

I tried to add a WFS layer in the new Mapviewer, but I got an error message that the WFS does not support GeoJSON. However, the WFS does support GeoJSON, but this is specified as 
<ows:Value>application/json; subtype=geojson; charset=utf-8</ows:Value> in the GetCapabilities

I tried another WFS, which also contains <ows:Value>application/json</ows:Value>  in the outputformats and this one works. Therefore, I think the new Mapviewer does not support or understand the <ows:Value>application/json; subtype=geojson; charset=utf-8</ows:Value> outputformat and this might be the reason for the error message. 

My idea: please add support for application/json; subtype=geojson; in the new Map Viewer.

The WFS which doesn't work can be found here:

https://api.data.amsterdam.nl/v1/wfs/woningbouwplannen/?service=WFS&version=2.0.0&request=getcapabil...

And it is capable of GeoJSON output:
https://api.data.amsterdam.nl/v1/wfs/woningbouwplannen/?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature... 

Thank you.

4 Comments
LaurensBuddingh12

I would like to add to this and would like for support for GML2, GML3 to be included as it is in ArcGIS Pro.

Diederik-van-der-Boor

Developer from Amsterdam here (who wrote that WFS server hosted at the /v1/wfs/ endpoint). I'd be happy to assist here if anything is needed on our side.

I also wonder why this subtype isn't handled. This is the equivalent GetCapabilities response from our older MapServer endpoint which does the same thing: https://map.data.amsterdam.nl/maps/woningbouw?SERVICE=WFS&REQUEST=GetCapabilities Both WFS servers show the same content types, and treat the "subtype" keyword as an alias for the mimetype.

LaurensBuddingh12

This other WFS you linked here gets the same response in the viewer: A valid 200 HTTPS response is received, that contains the expected xml from the request.The viewer however does not seem to be able to handle/recognize the resultant GeoJSON format, resulting in a service error.

This is the request: 

https://api.data.amsterdam.nl/v1/wfs/woningbouwplannen/?SERVICE=WFS&REQUEST=GetCapabilities&VERSION=...

this is the response:

(613 lines, so added in pastebin)

https://pastebin.com/MdJZ4j0N

MiguelParedes

Greetings  @JoëlHempenius3  and @Diederik-van-der-Boor 

I just wanted to let you know that whilst trying to find a WFS service that only supports the HTTP Get method for requests, I came up with this article, and the WFS created by Diederik, that is https://api.data.amsterdam.nl/v1/wfs/woningbouwplannen
During my testing, I was not able to add the WFS to the MapViewer Classic, however, I was able to successfully add it to the MapViewer (new):

ZP29VnMyw3.png

I do not know whether  Joël has tried this since he entered this idea, but the WFS is now working in the MapViewer app, and I thought he might want to know.

Muchos saludos,

Miguel