hajkmap / Hajk

A modern, full-featured OpenLayers based map viewer and editor
MIT License
123 stars 47 forks source link

Edit plugin: Problem since new QGIS-Server version #1357

Open eri-blan opened 1 year ago

eri-blan commented 1 year ago

Describe the bug

Since either the new release candidate or a new QGIS-Server version, edit-layers get a prefix qgs: under the edit tab. See screenshots and response message. This breaks any new or updated edit-layer.

image

<xsd:schema version="1.0" targetNamespace="http://www.qgis.org/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:qgs="http://www.qgis.org/gml" xmlns:gml="http://www.opengis.net/gml/3.2" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ogc="http://www.opengis.net/ogc">
  <xsd:import namespace="http://www.opengis.net/gml/3.2" />
  <xsd:element type="qgs:SA_MASSHANTERING_PType" substitutionGroup="gml:AbstractFeature" name="SA_MASSHANTERING_P" />
  <xsd:complexType name="SA_MASSHANTERING_PType">
    <xsd:complexContent>
      <xsd:extension base="gml:AbstractFeatureType">
        <xsd:sequence>
          <xsd:element type="gml:PointPropertyType" maxOccurs="1" name="geometry" minOccurs="0" />
          <xsd:element type="string" name="MH_PROJEKTNAMN" nillable="true" />
          <xsd:element type="string" name="MH_FASTIGHETSBETECKNING" nillable="true" />
          <xsd:element type="string" name="MH_STATUS" nillable="true" />
          <xsd:element type="integer" name="MH_MANGD_MASSA" nillable="true" />
          <xsd:element type="string" name="MH_BEHOV" nillable="true" />
          <xsd:element type="string" name="MH_MASSKVALITE" nillable="true" />
          <xsd:element type="string" name="MH_MASSTYP" nillable="true" />
          <xsd:element type="string" name="MH_MATERIAL_PROVTAGET" nillable="true" />
          <xsd:element type="string" name="MH_INVASIVA_ARTER" nillable="true" />
          <xsd:element type="string" name="MH_ANMALNINGSPLIKT" nillable="true" />
          <xsd:element type="string" name="MH_ANTECKNING" nillable="true" />
          <xsd:element type="string" name="MH_TIDSPLAN" nillable="true" />
          <xsd:element type="string" name="MH_INTERN_EXTERN_AKTOR" nillable="true" />
          <xsd:element type="string" name="MH_FORVALTNING" nillable="true" />
          <xsd:element type="string" name="MH_ENHET" nillable="true" />
          <xsd:element type="string" name="MH_KONTAKTPERSON" nillable="true" />
          <xsd:element type="string" name="MH_PRIORITET" nillable="true" />
          <xsd:element type="string" name="MH_MASSORNA_ANVANDS_TILL" nillable="true" />
          <xsd:element type="string" name="MH_VART_HAMNADE_MASSORNA" nillable="true" />
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

Hajk 3.12 RC2 QGIS-Server 3.24

jesade-vbg commented 1 year ago

Could you try using a previous (working) version of QGIS Server or Hajk so that so we can rule things out? It can be a bit tricky to update 2 co existing applications at the same time. Also... if the output of an old QGIS Server does not output the prefixes it would be easier to adress the issue (A little comparison?).

jacobwod commented 1 year ago

Admin UI only parses the response, so any changes to the contents of the response come from the WFS server.

Just to be clear, we're talking about the response to a describeFeature in the JSON format request, e.g. ?SERVICE=WFS&request=describeFeatureType&outputFormat=application%2Fjson&typename=my_feature_name

Apart from the JSON part being ignored (I guess it's a GeoServer vendor extension, not part of the WFS spec and as such, not implemented in QGIS Server), the results look correct.

I took a quick look at our test environment that has some (rather old) layers and the response looks different than yours:

<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:qgs="http://www.qgis.org/gml" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.0" xmlns:ogc="http://www.opengis.net/ogc" targetNamespace="http://www.qgis.org/gml" xmlns:gml="http://www.opengis.net/gml">
 <import namespace="http://www.opengis.net/gml"/>
 <element name="sitac_sektorgrans" substitutionGroup="gml:_Feature" type="qgs:sitac_sektorgransType"/>
 <complexType name="sitac_sektorgransType">
  <complexContent>
   <extension base="gml:AbstractFeatureType">
    <sequence>
     <element name="geometry" minOccurs="0" maxOccurs="1" type="gml:GeometryPropertyType"/>
     <element name="kategori" type="string" nillable="true"/>
     <element name="typ" type="string" nillable="true"/>
     <element name="beskrivning" type="string" nillable="true"/>
     <element name="kommentar" type="string" nillable="true"/>
     <element name="sektor" type="string" nillable="true"/>
     <element name="primary_key" type="int"/>
    </sequence>
   </extension>
  </complexContent>
 </complexType>
</schema>

Note that you have the xsd: prefix which we don't have. Regarding the qgs: prefix on <element type="">, we do have it too.

I'm on latest Hajk (if you're running 3.12 RC 2 it's pretty much the same). Detailed QGIS Server version output:

root@qgis_node:~# /usr/lib/cgi-bin/qgis_mapserv.fcgi --version
QGIS 3.26.3-Buenos Aires 'Buenos Aires' (65e4edfdad)
QGIS code revision 65e4edfdad
Qt version 5.12.8
Python version 3.8.10
GDAL/OGR version 3.0.4
PROJ version 6.3.1
EPSG Registry database version v9.8.6 (2020-01-22)
Compiled against GEOS 3.8.0-CAPI-1.13.1
Running against GEOS 3.8.0-CAPI-1.13.1 
SQLite version 3.31.1
OS Ubuntu 20.04.5 LTS