Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OGRVRTLayer throws CE_Failure with description ignoring it #11518

Closed
tcommandeur opened this issue Dec 19, 2024 · 2 comments · Fixed by #11537
Closed

OGRVRTLayer throws CE_Failure with description ignoring it #11518

tcommandeur opened this issue Dec 19, 2024 · 2 comments · Fixed by #11537
Assignees

Comments

@tcommandeur
Copy link

What is the bug?

I'm using Mapserver (v8.2.2) and a VRT file with a SrcRegion defined. And when performing a WMS getfeatureinfo request the request fails. To my opinion this is due to the type of error thrown in ogrvrtlayer.cpp.

Case:
I'm doing a WMS request that results in an error thrown by the OGR VRT layer: CPLError(CE_Failure, CPLE_AppDefined,"Spatial filter should be polygon when a SrcRegion is defined. Ignoring it");. However the poSrcRegion is correctly set and execution continues.

This exception is caught by mapserver with if (CPLGetLastErrorType() == CE_Failure) that results in failure.

Expected result:
OGR VRT layer to throw a CE_Warning like this: CPLError(CE_Warning, CPLE_AppDefined,"Spatial filter should be polygon when a SrcRegion is defined. Ignoring it");

Steps to reproduce the issue

Dataset:
BAG geopackage: https://service.pdok.nl/lv/bag/atom/bag.xml

VRT file:

<OGRVRTDataSource>
    <OGRVRTLayer name="pand">
        <SrcDataSource>bag-light.gpkg</SrcDataSource>
        <SrcLayer>pand</SrcLayer>
        <LayerSRS>EPSG:28992</LayerSRS>
        <GeometryField>
            <!-- Clip is only implemented at GeometryField level and not at OGRVRTLayer level -->
            <SrcRegion clip="false">POLYGON((120000 435000, 155000 435000, 155000 470000, 120000 470000, 120000 435000))</SrcRegion>
        </GeometryField>
    </OGRVRTLayer>
</OGRVRTDataSource>

No idea how to reproduce this with ogr2ogr since I cannot find out how the m_poFilterGeom is set that seems to be something different then a polygon.

Versions and provenance

GDAL 3.6, 3.9.3, 3.10.0 self-built from binaries.

Additional context

No response

@tcommandeur
Copy link
Author

I tested the PR and the results are as expected. Thanks for the incredible quick fix.
Looking at the label does it means we can expect this fix to be released in GDAL 3.10.1?

@rouault
Copy link
Member

rouault commented Dec 23, 2024

Looking at the label does it means we can expect this fix to be released in GDAL 3.10.1?

yes

rouault added a commit that referenced this issue Dec 26, 2024
…tSpatialFilter() (#11537)

Fixes #11518

Co-authored-by: Dan Baston <dbaston@gmail.com>
rouault added a commit that referenced this issue Dec 26, 2024
rouault added a commit that referenced this issue Dec 26, 2024
…metry type as well as SetSpatialFilter() (#11548)

Fixes #11518

Co-authored-by: Dan Baston <dbaston@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants