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

Server LTR: OAPIF/WFS3 describe collections malfunction - empty pg layer with UTM zone SRID #60686

Open
2 tasks done
lorenzogrv opened this issue Feb 20, 2025 · 1 comment
Open
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@lorenzogrv
Copy link

lorenzogrv commented Feb 20, 2025

What is the bug or the crash?

OAPIF/WFS3 Service can't handle properly empty PostGIS layers with "UTM-SRID-based" geometries

Steps to reproduce the issue

Reproduction which may serve as test sequence:

  • Create an empty project

  • Add a PostgreSQL vector layer having no features. Here I'm using a table which has EPSG:25829 Points

    CREATE TABLE test_empty_25829 (
      id serial not null primary key,
      geom geometry(Point, 25829)
    )
    Screenshot - layer datasource info

    Image

  • Enable QGIS Server capabilitites and publish layer at QGIS Server settings

  • Hit WMS/GetProjectSettings and WFS/GetCapabilities to ensure our server config works

    GET /?service=WMS&version=1.3.0&request=GetProjectSettings
    GET /?service=WFS&version=1.1.0&request=GetCapabilities
    
  • Hit WFS3/OAPIF describe Collections endpoint → results on 500 Internal Server Error

    GET /wfs3/collections.json
    

    At server logs whe can see Error: Point outside of projection domain:

    09:46:02 CRITICAL Server[24]: Forward transform (EPSG:25829 to EPSG:4326) of (179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000) Error: Point outside of projection domain
    09:46:02 WARNING [24]: finish() called twice
    
  • Workaround:

    • Remove the layer from the project

    • Transform the original layer to EPSG:4326. Here I'm using a simple view - i.e:

      CREATE VIEW test_empty_4326
       SELECT id, ST_Transform(geom, 4326)::geometry(Point, 4326) AS geom
          FROM test_empty_25829
      ``
      
    • Add the new layer to the project, and publish it through QGIS Server settings

      Screenshot - layer datasource info

      Image

    • Hit again de /wfs3/collections.json endpoint → Observe it works as expected

Versions

QGIS 3.34.15-Prizren 'Prizren' (exported)
QGIS code branchRelease 3.34
Qt version 5.15.15
Python version 3.13.2
GDAL/OGR version 3.10.2
PROJ version 9.5.1
EPSG Registry database version v11.022 (2024-11-05)
GEOS version 3.13.0-CAPI-1.19.0
SQLite version 3.46.1
OS Debian GNU/Linux trixie/sid

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

May be related to #45073

I also tried to work-around setting up the qgis_layer_metadata table extent to ensure it is within the UTM zone extent, but did not work either.

@lorenzogrv lorenzogrv added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 20, 2025
@lorenzogrv
Copy link
Author

I forget mentioning the #45073 issue, which may be related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

No branches or pull requests

1 participant