OK, here goes:
Search for a streetname…
https://geodata.nationaalgeoregister.nl/locatieserver/suggest?&q=Nieuwe Binnenweg, Rotterdam
{
"response":{"numFound":1424,"start":0,"maxScore":26.588642,"docs":[
{
"type":"weg",
"weergavenaam":"Nieuwe Binnenweg, Rotterdam",
"id":"weg-df31116df439b1c7a6dcccc5ddc9a711",
"score":26.588642},
Next request: get de details of th street found:
https://geodata.nationaalgeoregister.nl/locatieserver/v3/lookup?id=weg-df31116df439b1c7a6dcccc5ddc9a711
{
"response":{"numFound":1,"start":0,"maxScore":15.756616,"docs":[
{
"type":"weg",
"weergavenaam":"Nieuwe Binnenweg, Rotterdam",
"id":"weg-df31116df439b1c7a6dcccc5ddc9a711",
"identificatie":"0599300000003475",
"geometrie_rd":"MULTILINESTRING((90503 436114,90787 436356,91546 436573,91596 436615,91629 436705,91663 436746,92106 436908),(91872 436823,92078 436898))"}]
}}
This is where it gets a bit tricky. I don’t know what software you use, or what libraries, but the trickiness is that this requests returns a WKT (Well Known Text) geometry. But for the WFS request you’ll need a GML geometry. Best is if you use software that can properly convert between those two formats, in order to avoid mistakes. In this case, it is quite simple to just copy the coordinates and insert them into a bit of GML, in order to create the filter we want. Which looks like this:
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:Intersects>
<ogc:PropertyName>geom</ogc:PropertyName>
<gml:LineString srsName="28992">
<gml:coordinates>90503 436114,90787 436356,91546 436573,91596 436615,91629 436705,91663 436746,92106 436908,91872 436823,92078 436898
</gml:coordinates>
</gml:LineString >
</ogc:Intersects>
</ogc:Filter>
You can see it’s a fairily simple bit of xml. You can either POST this to the WFS, or use GET. POST is better if you expect really large geometries, since there is a limit to what you can pass along using GET, but in this case a GET-request works fine:
https://service.pdok.nl/cbs/wb2021/wfs/v1_0?service=WFS&version=2.0.0&request=GetFeature&typename=wb2021:wijken&outputFormat=json&filter=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:Intersects><ogc:PropertyName>geom</ogc:PropertyName><gml:LineString srsName="28992"><gml:coordinates>90503 436114,90787 436356,91546 436573,91596 436615,91629 436705,91663 436746,92106 436908,91872 436823,92078 436898</gml:coordinates></gml:LineString></ogc:Intersects></ogc:Filter>
The response to this request will be the following:
{
"type": "FeatureCollection",
"numberMatched": 2,
"name": "wijken",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::28992" } },
"features": [
{ "type": "Feature", "properties": { "wijkcode": "WK059901", "wijknaam": "Rotterdam Centrum", "gemeentecode": "GM0599", "gemeentenaam": "Rotterdam", "indelingswijzigingWijkenEnBuurten": 1, "water": "NEE", "omgevingsadressendichtheid": 6294, "stedelijkheidAdressenPerKm2": 1, "bevolkingsdichtheidInwonersPerKm2": 8855, "aantalInwoners": 36600, "mannen": 18900, "vrouwen": 17695, "percentagePersonen0Tot15Jaar": 9, "percentagePersonen15Tot25Jaar": 17, "percentagePersonen25Tot45Jaar": 41, "percentagePersonen45Tot65Jaar": 21, "percentagePersonen65JaarEnOuder": 13, "percentageOngehuwd": 69, "percentageGehuwd": 21, "percentageGescheid": 8, "percentageVerweduwd": 2, "aantalHuishoudens": 21735, "percentageEenpersoonshuishoudens": 60, "percentageHuishoudensZonderKinderen": 25, "percentageHuishoudensMetKinderen": 15, "gemiddeldeHuishoudsgrootte": 1.6, "percentageWesterseMigratieachtergrond": 19, "percentageNietWesterseMigratieachtergrond": 38, "percentageUitMarokko": 6, "percentageUitNederlandseAntillenEnAruba": 1, "percentageUitSuriname": 7, "percentageUitTurkije": 4, "percentageOverigeNietwestersemigratieachtergrond": 20, "oppervlakteTotaalInHa": 488, "oppervlakteLandInHa": 413, "oppervlakteWaterInHa": 75, "jaarstatcode": "2021WK059901", "jaar": 2021 }, "geometry": { "type": "MultiPolygon", "coordinates": [ <snipped> ] } },
{ "type": "Feature", "properties": { "wijkcode": "WK059903", "wijknaam": "Delfshaven", "gemeentecode": "GM0599", "gemeentenaam": "Rotterdam", "indelingswijzigingWijkenEnBuurten": 1, "water": "NEE", "omgevingsadressendichtheid": 5639, "stedelijkheidAdressenPerKm2": 1, "bevolkingsdichtheidInwonersPerKm2": 14907, "aantalInwoners": 76845, "mannen": 38970, "vrouwen": 37875, "percentagePersonen0Tot15Jaar": 16, "percentagePersonen15Tot25Jaar": 15, "percentagePersonen25Tot45Jaar": 35, "percentagePersonen45Tot65Jaar": 23, "percentagePersonen65JaarEnOuder": 10, "percentageOngehuwd": 65, "percentageGehuwd": 24, "percentageGescheid": 9, "percentageVerweduwd": 2, "aantalHuishoudens": 39560, "percentageEenpersoonshuishoudens": 52, "percentageHuishoudensZonderKinderen": 20, "percentageHuishoudensMetKinderen": 28, "gemiddeldeHuishoudsgrootte": 1.9, "percentageWesterseMigratieachtergrond": 14, "percentageNietWesterseMigratieachtergrond": 54, "percentageUitMarokko": 13, "percentageUitNederlandseAntillenEnAruba": 1, "percentageUitSuriname": 9, "percentageUitTurkije": 12, "percentageOverigeNietwestersemigratieachtergrond": 20, "oppervlakteTotaalInHa": 596, "oppervlakteLandInHa": 516, "oppervlakteWaterInHa": 81, "jaarstatcode": "2021WK059903", "jaar": 2021 }, "geometry": { "type": "MultiPolygon", "coordinates": [<snipped> ] } }
]
}
For brevity I’ve snipped out the actual geometries, but you do get the full geometry of the Wijken as well.
Now it depends a bit on what you want to do with this result: if you want to display it on a map as well, you can request several different coordinate systems. Check the Capabilities document and the DescribeFeatureType to see exactly which ones.
If you want the buurten as well, either combine both featuretypes in one request, or send another request using the featuretypename wb2021:buurten (feature type names can be found in the Capabilities document - always check that one…)
I use this technique in several places using Javascript and Openlayers, to show stuff on the map, or get more information about interesting bits.
HTH,
Stefan
`