1

Using a WFS service https://geo.onroerenderfgoed.be/geoserver/wfs I want to retrieve the features with a CQL INTERSECT query.

I need to get results from 2 TYPENAME: vioe_geoportaal:vast_htp,vioe_geoportaal:vast_dibe_relict

The problem is that the CQL query interacts with the geomtry object. In these 2 typenames they are defined different geom and geometry.

Request 1

Where the object is called geom is succesful according :

https://geo.onroerenderfgoed.be/geoserver/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&CRS=EPSG:31370&OUTPUTFORMAT=application/json&TYPENAME=vioe_geoportaal:vast_htp&CQL_FILTER=INTERSECTS(geom, POLYGON((123664.03100000322 210489.5150000006,123705.24599999934 210489.5150000006,123705.24599999934 210587.86800000072,123664.03100000322 210587.86800000072,123664.03100000322 210489.5150000006)))

Request 2

Where the object is called geometry is succesful according :

https://geo.onroerenderfgoed.be/geoserver/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&CRS=EPSG:31370&OUTPUTFORMAT=application/json&TYPENAME=vioe_geoportaal:vast_dibe_relict&CQL_FILTER=INTERSECTS(geometry, POLYGON((123664.03100000322 210489.5150000006,123705.24599999934 210489.5150000006,123705.24599999934 210587.86800000072,123664.03100000322 210587.86800000072,123664.03100000322 210489.5150000006)))

Now I want 1 request to encapsulate the 2 requests above.

I've tried concatenating them - but as a logical result of the difference in the name geom vs geometry

https://geo.onroerenderfgoed.be/geoserver/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&CRS=EPSG:31370&OUTPUTFORMAT=application/json&TYPENAME=vioe_geoportaal:vast_htp,vioe_geoportaal:vast_dibe_relict&CQL_FILTER=INTERSECTS(geometry, POLYGON((123664.03100000322 210489.5150000006,123705.24599999934 210489.5150000006,123705.24599999934 210587.86800000072,123664.03100000322 210587.86800000072,123664.03100000322 210489.5150000006)))

But raises a logical error :

<ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows https://geo.onroerenderfgoed.be:443/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">
    <ows:Exception exceptionCode="InvalidParameterValue">
        <ows:ExceptionText>Illegal property name: geometry</ows:ExceptionText>
    </ows:Exception>
</ows:ExceptionReport>

What can I do instead of launching 2 request?

2
  • Perhaps duplicate of gis.stackexchange.com/questions/132229/… – user30184 Nov 27 '17 at 17:40
  • leThanks for your remark. I'm not sure this is really the same. It does not explain any further on how to handle a CQL on the geometry with different names. Unless I'm unaware. Not really seeing a solution to my problem. Thanks anyhow! – daan.desmedt Nov 27 '17 at 18:30
1

It seems the CQL_FILTER can have a ; as delimiter. Specifiying a filter for each TYPENAME.

Using request :

https://geo.onroerenderfgoed.be/geoserver/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&CRS=EPSG:31370&OUTPUTFORMAT=application/json&TYPENAME=vioe_geoportaal:vast_htp,vioe_geoportaal:vast_dibe_relict&CQL_FILTER=INTERSECTS(geom, POLYGON((123664.03100000322 210489.5150000006,123705.24599999934 210489.5150000006,123705.24599999934 210587.86800000072,123664.03100000322 210587.86800000072,123664.03100000322 210489.5150000006)));INTERSECTS(geometry, POLYGON((123664.03100000322 210489.5150000006,123705.24599999934 210489.5150000006,123705.24599999934 210587.86800000072,123664.03100000322 210587.86800000072,123664.03100000322 210489.5150000006)))

I was able to address the different shape names like this. But it feels messy and long... Is there really not any other way in achieving this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.