[Geoserver-devel] [JIRA] (GEOS-10776) Honoring "Customize Attributes" in choice of correct geometry column in WFS requests to PostGIS

Rune Aasgaard created an issue

GeoServer / BugGEOS-10776

Honoring “Customize Attributes” in choice of correct geometry column in WFS requests to PostGIS

Issue Type:

BugBug

Assignee:

Unassigned

Created:

08/Dec/22 12:13 PM

Priority:

MediumMedium

Reporter:

Rune Aasgaard

When using a table with several geometry columns as a data source it is possible to use “Customize attributes” in the Layer dialog panel to restrict geoserver to use only one of them. This works well for WMS layers, but not for WFS layers.

The following SQL examples were extracted from geoserver in “VERBOSE” logging mode. Only the column “geometry” was selected in “Customize attributes”. In both cases the correct geometry column (“geometry“) was selected for the result set, but in the request for the WFS server the wrong geometry column (“solid_geometry“) was used for the BBOX search, but this is done correctly for the WMS request.

This is the database request from the WFS, using the wrong geometry column for BBOX filtering:

SELECT "id","gmlid_codespace","is_triangulated","cityobject_id","parent_id","is_reverse","is_composite","root_id",encode(ST_AsEWKB("geometry"), 'base64') as "geometry","is_solid","gmlid","is_xlink" 
FROM "bygg_norge_2022_10_20"."surface_geometry" 
WHERE 
"solid_geometry" && ST_GeomFromText('POLYGON ((269800 7041800, 269800 7042000, 270000 7042000, 270000 7041800, 269800 7041800))', 0) 
AND 
ST_Intersects("solid_geometry", ST_GeomFromText('POLYGON ((269800 7041800, 269800 7042000, 270000 7042000, 270000 7041800, 269800 7041800))', 0)) 
LIMIT 1000000

This is the database request from the WMS using the correct geometry column for BBOX filtering:

SELECT "id",encode(ST_AsBinary(ST_Force2D("geometry")), 'base64') as "geometry" 
FROM "bygg_norge_2022_10_20"."surface_geometry" 
WHERE 
"geometry" && ST_GeomFromText('POLYGON ((269798.4 7041798.4, 269798.4 7042001.6, 270001.6 7042001.6, 270001.6 7041798.4, 269798.4 7041798.4))', 25833) 
AND 
ST_Intersects("geometry", ST_GeomFromText('POLYGON ((269798.4 7041798.4, 269798.4 7042001.6, 270001.6 7042001.6, 270001.6 7041798.4, 269798.4 7041798.4))', 25833))

Is it possible to make the BBOX filtering for the WFS behave like for the WMS?

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100212-sha1:8cdcfbb)

Atlassian logo