I'm quite new to Leaflet, and i would like to use this WFS,
https://wxs.ign.fr/agriculture/geoportail/wfs?SERVICE=WFS&REQUEST=GetCapabilities,
to display interactive agricultural plots on a leaflet map.
I tried this:
var data_url ="https://wxs.ign.fr/agriculture/geoportail/wfs?SERVICE=WFS&REQUEST=GetFeature";
var params = '&Name=RPG.2020:parcelles_graphiques&outputFormat=application/json';
var url =encodeURI(data_url+params) ;
$.get(url, function(json){
var obj = $.parseJSON(json);
console.log(obj);
});
it returns this in the console :
<ExceptionReport>
<script> try { Object.defineProperty(navigator, "globalPrivacyControl", { value: false, configurable: false, writable: false }); document.currentScript.parentElement.removeChild(document.currentScript); } catch(e) {}; </script>
<Exception exceptionCode="MissingParameter">Resource parameter not found</Exception>
</ExceptionReport>
Best Answer
Your request is missing a version number, also for WFS 2 you need a
typenames
parameter, and for previous versions atypename
with your GetFeature request.The below request works for example:
Gives: