I'm trying to retrieve DefaultCRS for one layers from WFS 2.0.0.
For the moment, only way I find is to use GetCapabilities
and reduce the xml file by setting the sections like that :
https://wxs.ign.fr/environnement/geoportail/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetCapabilities&SECTIONS=FeatureTypeList
Is there a way to directly ask metadata for only one layer?
I also tried CSW but it wasn't conclusive.
Respond to @nmtoken comment.
I tried both method.
Set count = 1 to GetFeature is a double edge sword because for some ressources features are quite simple and the response time is fast but sometime features are quite complexe and loading the geometry takes more time than call GetCapabilities.
GetPropertyValue only list possible value for attribute but there are no columns corresponding to CRS. However, when setting valueReference=the_geom
the third node of xml response contain CRS.
Normally, the argument valueReference can handle XPath() expression so I can select the third node attributs after url encoding with something like : valueReference=the_geom/wfs:member/LIMITES_ADMINISTRATIVES_EXPRESS.LATEST:the_geom/gml:MultiSurface
or more simply with valueReference=the_geom[3]
In both case it's not working in my example :
# First try
https://wxs.ign.fr/administratif/geoportail/wfs?service=WFS&version=2.0.0&request=GetPropertyValue&typeNames=LIMITES_ADMINISTRATIVES_EXPRESS.LATEST%3Acommune&valueReference=valueReference=the_geom%2Fwfs%3Amember%2FLIMITES_ADMINISTRATIVES_EXPRESS.LATEST%3Athe_geom%2Fgml%3AMultiSurface&count=1&outputFormat=gml32
# Second try
https://wxs.ign.fr/administratif/geoportail/wfs?service=WFS&version=2.0.0&request=GetPropertyValue&typeNames=LIMITES_ADMINISTRATIVES_EXPRESS.LATEST%3Acommune&valueReference=the_geom%5B3%5D&count=1&outputFormat=gml32
If anyone already used valueReference with XPath expression can you check if mine are correct ?