0

I have a service and I tried to paint his layer on my map:

http://www.ign.es/wfs-inspire/unidades-administrativas?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&COUNT=1&srsName=EPSG:3857&TYPENAMES=au:AdministrativeBoundary


WFS = new ol.layer.Vector({
    source: new ol.source.Vector({
        format: new ol.format.GeoJSON(),
        url: 'http://www.ign.es/wfs-inspire/unidades-administrativas?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&COUNT=1&srsName=EPSG:3857&TYPENAMES=au:AdministrativeBoundary'
        }),
        stroke: new ol.style.Stroke({
            color: 'rgba(0, 0, 255, 1.0)',
            width: 2
        })
})

¿is it possible? I don't see the geometries in the map. I think the problem is "outputFormat", is not possible get "outputFormat=application/json"

2

is not possible get "outputFormat=application/json"

It is not possible in the service you list. The service GetCapabilities response tells you what output formats are available:

http://www.ign.es/wfs-inspire/unidades-administrativas?service=WFS&request=GetCapabilities

<ows:Parameter name="outputFormat">
    <ows:AllowedValues>
        <ows:Value>text/xml; subtype=gml/3.2.1</ows:Value>
        <ows:Value>application/gml+xml; version=3.2</ows:Value>
        <ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
        <ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
    </ows:AllowedValues>
</ows:Parameter>

and application/json is not available

Furthermore the service here appears to be a complex features WFS

see:

http://contenido.ign.es/wfs-inspire/unidades-administrativas?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=2.0.0&TYPENAME=au:AdministrativeBoundary

and:

http://contenido.ign.es/wfs-inspire/unidades-administrativas?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAME=au:AdministrativeBoundary&count=1&

and AFAIK OpenLayers can't handle complex features

  • 1
    is it possible paint the layer on the map? – AlexPK Jun 13 at 14:16
  • It should be possible, since OpenLayers support GML formats 2, 3, and 3.2, but I couldn't get it working with this particular WFS service. – TomazicM Jun 16 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.