Ik heb het aan de praat gekregen op basis van filtermogelijkheden die bij mapserver beschreven staan:
https://www.mapserver.org/ogc/filter_encoding.html
je moet een ogc filter gebruiken.
Voorbeeld als hieronder met intersects werkt bij mij:
api = “https://geodata.nationaalgeoregister.nl/bag/wfs/v1_1?request=GetFeature&service=WFS&version=2.0.0&typeName=bag:pand&SRSNAME=EPSG:28992&outputFormat=json”
filter =<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>{coordinates}</gml:coordinates> </gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>
In de {coordinates} plak je je polygon.
dan plak je de boel aan elkaar:
api&Filter=filter
dan wordt het zoiets als hieronder…
"https://geodata.nationaalgeoregister.nl/bag/wfs/v1_1?request=GetFeature&service=WFS&version=2.0.0&typeName=bag:pand&SRSNAME=EPSG:28992&outputFormat=json&Filter=Geometrygml:Polygongml:outerBoundaryIsgml:LinearRinggml:coordinates111947.001 399580.449,111940.032 399573.474,111959.584 399567.403,111966.611 399565.507,111978.229 399563.368,111983.2 399562.67,111986.589 399562.681,112025.555 399563.94,112051.398 399565.167,112069.922 399565.589,112103.472 399566.57,112171.514 399713.486,112162.993 399717.305,112153.097 399721.331,112121.022 399732.728,112108.418 399737.316,112086.95 399745.033,112067.624 399751.791,112065.46 399752.218,112063.004 399752.423,112061.425 399752.054,112059.829 399751.638,112057.339 399750.345,112055.743 399748.688,112054.19 399746.531,112041.656 399718.098,112035.349 399704.542,112027.017 399688.4,112020.803 399677.13,112013.892 399665.401,112005.813 399652.784,112000.805 399645.463,111990.042 399630.218,111981.81 399619.487,111976.636 399613.086,111960.123 399594.121,111947.001 399580.449</gml:coordinates> </gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>’
in de praktijk moet het wel uit url leesbare tekens bestaan, dus geen spaties.
Dan wordt het als volgt:
https://geodata.nationaalgeoregister.nl/bag/wfs/v1_1?request=GetFeature&service=WFS&version=2.0.0&typeName=bag:pand&SRSNAME=EPSG:28992&outputFormat=json&Filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>111947.001+399580.449,111940.032+399573.474,111959.584+399567.403,111966.611+399565.507,111978.229+399563.368,111983.2+399562.67,111986.589+399562.681,112025.555+399563.94,112051.398+399565.167,112069.922+399565.589,112103.472+399566.57,112171.514+399713.486,112162.993+399717.305,112153.097+399721.331,112121.022+399732.728,112108.418+399737.316,112086.95+399745.033,112067.624+399751.791,112065.46+399752.218,112063.004+399752.423,112061.425+399752.054,112059.829+399751.638,112057.339+399750.345,112055.743+399748.688,112054.19+399746.531,112041.656+399718.098,112035.349+399704.542,112027.017+399688.4,112020.803+399677.13,112013.892+399665.401,112005.813+399652.784,112000.805+399645.463,111990.042+399630.218,111981.81+399619.487,111976.636+399613.086,111960.123+399594.121,111947.001+399580.449</gml:coordinates>+</gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>
‘https://geodata.nationaalgeoregister.nl/bag/wfs/v1_1?request=GetFeature&service=WFS&version=2.0.0&typeName=bag:pand&SRSNAME=EPSG:28992&outputFormat=json&Filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>111947.001+399580.449,111940.032+399573.474,111959.584+399567.403,111966.611+399565.507,111978.229+399563.368,111983.2+399562.67,111986.589+399562.681,112025.555+399563.94,112051.398+399565.167,112069.922+399565.589,112103.472+399566.57,112171.514+399713.486,112162.993+399717.305,112153.097+399721.331,112121.022+399732.728,112108.418+399737.316,112086.95+399745.033,112067.624+399751.791,112065.46+399752.218,112063.004+399752.423,112061.425+399752.054,112059.829+399751.638,112057.339+399750.345,112055.743+399748.688,112054.19+399746.531,112041.656+399718.098,112035.349+399704.542,112027.017+399688.4,112020.803+399677.13,112013.892+399665.401,112005.813+399652.784,112000.805+399645.463,111990.042+399630.218,111981.81+399619.487,111976.636+399613.086,111960.123+399594.121,111947.001+399580.449</gml:coordinates>+</gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>’
Multipolygonen werkt vermoed ik niet. Ook niet in Qgis denk ik.