deegree/deegree3

WMS GetFeatureInfo and WFS GetFeature request with BBOX filter returns error in blob mode

Closed this issue · 5 comments

  • Bug

  • Version: release deegree 3.5.1 and 3.5.2

  • Error wms GetFeatureInfo:
    ERROR o.d.f.p.s.SQLFeatureStore [http-nio-8080-exec-10] Error performing query by operator filter: FEHLER: Operation on mixed SRID geometries org.postgresql.util.PSQLException: FEHLER: Operation on mixed SRID geometries

  • Error wfs GetFeature with BBOX:
    error performing query by operator filter: FEHLER: Operation on mixed SRID geometries
    by request:
    localhost:8081/deegree-webservice/services/inspire_ps_download?service=WFS&request=GetFeature&version=2.0.0&typeName=ps:ProtectedSite&CRS=EPSG:25833&BBOX=402551,6008083,402600,6008999

  • Caused by: a19e559

  • Deegree SQL Feature Store in BLOB mode was used. XML and SQL-Create-Script generated with https://repo.deegree.org/service/rest/repository/browse/public/org/deegree/deegree-tools-gml/3.5.2/
    docker exec -it inspire_deegree_test35x java -jar /opt/GMLLoader/deegree-tools-gml-3.5.2.jar SqlFeatureStoreConfigCreator -schemaUrl=https://inspire.ec.europa.eu/schemas/ps/4.0/ProtectedSites.xsd -format=all -srid=25833 -idtype=uuid -mapping=blob
    SQL-script with EPSG:0
    SELECT ADDGEOMETRYCOLUMN('public','gml_objects','gml_bounded_by','0','GEOMETRY',2);

  • Solution: We built it without a19e559 and everything works fine. Or should the gml-tool generate the sql-script with the configured EPSG:25833?

lgoltz commented

@enatdvmv Can you provide the generated SQLFeatureStore configuration?

@lgoltz yes, created with the deegree-tools-gml-3.5.2

xml:
<SQLFeatureStore xmlns="http://www.deegree.org/datasource/feature/sql" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.deegree.org/datasource/feature/sql https://schemas.deegree.org/core/3.5/datasource/feature/sql/sql.xsd" xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3" xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0" xmlns:ps="http://inspire.ec.europa.eu/schemas/ps/4.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml/3.2"> <JDBCConnId>ProtectedSitesDS</JDBCConnId> <StorageCRS srid="25833" dim="2D">EPSG:25833</StorageCRS> <GMLSchema>https://inspire.ec.europa.eu/schemas/ps/4.0/ProtectedSites.xsd</GMLSchema> <BLOBMapping/> </SQLFeatureStore>

sql:
CREATE TABLE FEATURE_TYPES (id smallint PRIMARY KEY, qname text NOT NULL); COMMENT ON TABLE FEATURE_TYPES IS 'Ids and bboxes of concrete feature types'; SELECT ADDGEOMETRYCOLUMN('public', 'feature_types','bbox','0','GEOMETRY',2); INSERT INTO FEATURE_TYPES (id,qname) VALUES (0,'{http://inspire.ec.europa.eu/schemas/gn/4.0}NamedPlace'); INSERT INTO FEATURE_TYPES (id,qname) VALUES (1,'{http://inspire.ec.europa.eu/schemas/ps/4.0}ProtectedSite'); CREATE TABLE GML_OBJECTS (id serial PRIMARY KEY, gml_id text UNIQUE NOT NULL, ft_type smallint REFERENCES FEATURE_TYPES , binary_object bytea); COMMENT ON TABLE GML_OBJECTS IS 'All objects (features and geometries)'; SELECT ADDGEOMETRYCOLUMN('public', 'gml_objects','gml_bounded_by','0','GEOMETRY',2); ALTER TABLE GML_OBJECTS ADD CONSTRAINT gml_objects_geochk CHECK (ST_IsValid(gml_bounded_by)); CREATE INDEX gml_objects_sidx ON GML_OBJECTS USING GIST (gml_bounded_by);

lgoltz commented

@enatdvmv Thanks!
So we have a mismatch between configured CRS in the SQLFeatureStore configuration and the srid in the SQL Statements.

As suggested I prefer to fix this in the GmlTool.

@lgoltz That is now the question of price.

Table gml_objects, column gml_bounded_by = EPSG:0 (as before in deegree 3.4) or new with EPSG set (e.g. = EPSG:25833)?

As a test, I simply updated the gml_objects table.
ALTER TABLE inspire_test3.gml_objects ALTER COLUMN gml_bounded_by type geometry(Geometry,25833) USING ST_SetSRID(gml_bounded_by,25833);

After that GFI and GetFeature with BBOX works fine. WFS-T Transaction too.

Before I update my production database schemas, is this the final implementation?

Please note this in the Upgrade Guide

lgoltz commented

@enatdvmv We created a fix for the GmlTool wiith #1601. The fix adds the passed srid in the created SQL Statements creating the geometry columns.

The described bug occurs with deegree 3.5.1+ (PR #1555) with configurations created with deegree deegree 3.5.3 or less. Only SQLFeatureStores with blob mode are affected.
deegree 3.5.1+ requires an recreation of the configuration or update of the geometry columns as described in #1578 (comment).