Calling WfsFeatureSource.GetFeatureById()
always returns null
. The other methods to get features are OK:
const string serviceLocationUrl = "https://geodata.nationaalgeoregister.nl/kadastralekaart/wfs/v4_0";
const string typeName = "openbareruimtenaam";
var featureSource = new WfsFeatureSource(serviceLocationUrl, typeName);
featureSource.Open();
featureSource.SendingWebRequest += (_, e) => Debug.WriteLine(e.WebRequest.RequestUri);
var features = featureSource.GetFeaturesInsideBoundingBox(new RectangleShape(25001, 388934, 25002, 388933), ReturningColumnsType.AllColumns);
Debug.Assert(features.Count >= 1); // works
var id = features[0].Id;
var feature = featureSource.GetFeatureById(id, ReturningColumnsType.AllColumns);
Debug.Assert(feature != null); // FAILS
This problem is not that the feature would not be found; the two WFS requests sent by the code above return exactly the same data.
GetFeatureById:
https://geodata.nationaalgeoregister.nl/kadastralekaart/wfs/v4_0?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&request=GetFeature&FeatureId=openbareruimtenaam.004e2cf5-2396-497f-a7b7-ce172e044dc0
(There are two REQUEST parameters, and TYPENAME is missing, but this is not a problem for this server.)
Apparently, GetFeatureById does something different when parsing the result.