WFS filter request met veel ORs gaat mis

Bij het uitvoeren van een POST request op de BAG WFS service met veel OR’s in het statement krijg ik een foutmelding.

Als ik bijvoorbeeld de verblijfsobjecten bij een aantal panden opvraag in Amsterdam krijg ik een fout.

Het filter wat ik uitvoer is:

<wfs:GetFeature service="WFS" version="1.1.0" outputFormat="json"
	xmlns:gml="http://www.opengis.net/gml"
	xmlns:wfs="http://www.opengis.net/wfs"
	xmlns:ogc="http://www.opengis.net/ogc"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" maxFeatures="1000" startIndex="0">
	<wfs:Query srsName="EPSG:28992" typeName="verblijfsobject">
		<wfs:PropertyName>fuuid</wfs:PropertyName>
		<wfs:PropertyName>identificatie</wfs:PropertyName>
		<wfs:PropertyName>oppervlakte</wfs:PropertyName>
		<wfs:PropertyName>status</wfs:PropertyName>
		<wfs:PropertyName>gebruiksdoel</wfs:PropertyName>
		<wfs:PropertyName>openbare_ruimte</wfs:PropertyName>
		<wfs:PropertyName>huisnummer</wfs:PropertyName>
		<wfs:PropertyName>huisletter</wfs:PropertyName>
		<wfs:PropertyName>toevoeging</wfs:PropertyName>
		<wfs:PropertyName>postcode</wfs:PropertyName>
		<wfs:PropertyName>woonplaats</wfs:PropertyName>
		<wfs:PropertyName>bouwjaar</wfs:PropertyName>
		<wfs:PropertyName>pandidentificatie</wfs:PropertyName>
		<wfs:PropertyName>pandstatus</wfs:PropertyName>
		<wfs:PropertyName>rdf_seealso</wfs:PropertyName>
		<wfs:PropertyName>geom</wfs:PropertyName>
		<wfs:PropertyName>geom</wfs:PropertyName>
		<wfs:PropertyName>pandidentificatie</wfs:PropertyName>
		<wfs:PropertyName>geom</wfs:PropertyName>
		<ogc:Filter
			xmlns:gml="http://www.opengis.net/gml"
			xmlns:ogc="http://www.opengis.net/ogc">
			<ogc:Or>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012164989</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012164994</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012167626</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012169024</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012170874</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171289</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171297</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171299</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171300</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171302</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171303</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171895</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171901</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012171902</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012172054</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012172055</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012172056</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176321</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176322</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176323</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176324</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176325</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176326</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176327</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176330</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176331</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176332</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176333</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176334</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176335</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176336</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176337</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176660</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176661</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176663</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176674</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176722</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176723</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176724</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176728</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176731</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176733</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176734</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176735</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176736</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176740</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176846</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176861</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176862</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176863</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012176864</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177106</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177150</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177151</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177164</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177165</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177166</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177167</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177168</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177169</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177170</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177171</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177172</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177173</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177174</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177175</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177176</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177177</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177178</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177179</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177180</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177181</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177182</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177183</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177184</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177237</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177238</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177239</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177240</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177241</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177242</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177244</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177383</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177456</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177457</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177458</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177459</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012177466</ogc:Literal>
				</ogc:PropertyIsEqualTo>
				<ogc:PropertyIsEqualTo>
					<ogc:PropertyName>pandidentificatie</ogc:PropertyName>
					<ogc:Literal>0363100012253759</ogc:Literal>
				</ogc:PropertyIsEqualTo>
			</ogc:Or>
		</ogc:Filter>
		<ogc:SortBy>
			<ogc:SortProperty>
				<ogc:PropertyName>fuuid</ogc:PropertyName>
				<ogc:SortOrder>ASC</ogc:SortOrder>
			</ogc:SortProperty>
		</ogc:SortBy>
	</wfs:Query>
</wfs:GetFeature>

Het resultaat is:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows" version="1.1.0" language="en-US" xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
  <ows:Exception exceptionCode="NoApplicableCode" locator="mapserv">
    <ows:ExceptionText>msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed
msOGRFileWhichShapes(): OGR error. ExecuteSQL() failed. Check logs.</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

Als ik minder pandidentificaties toevoeg gaat het wel goed. De exacte grens heb ik alleen nog niet gevonden.

Is hiervoor een verklaring?

1 like

Dit levert een te lange query voor de onderliggende database op. Daardoor wordt deze afgekapt en krijg je de betreffende foutmelding.

Los daarvan - als de database deze wel zou uitvoeren - zou dit naar alle waarschijnlijkheid geen geweldige performance geven. Veel OR’s in een query is vrij zwaar voor de meeste (relationele) databases.

Aangezien je enkel op pandidentificatie wilt zoeken is ons advies om meerdere kleinere verzoeken uit te voeren.

Als achtergrond een ouder topic met een soortgelijk probleem: WFS request met lang filter geeft foutmelding

2 likes