Hi,
just accidentally stumbled upon this today. I might be missing something really obvious but the GML-based output formats for (none of the versions of) WFS seem to return columns with the names:
- name
- description
while e.g. application/json returns them just fine. Turning up logging to GEOTOOLS_DEVELOPER shows that the query executed for GetFeature in the database is ok for GML outputs too (see end of this e-mail) although the "offending" columns are not returned in output.
So I quess this is simply a GML shortcoming of "thou shalt not use these column names"?
For example on localhost:5432
create table fs (
oid serial not null,
geom geometry(point, 4326),
name text,
description text,
f_name text,
f_description text
);
alter table fs add constraint pk__fs primary key (oid);
and then publishing the layer on GeoServer (2.21.1, using the kartofsa docker image), see basic config for layer at https://drive.google.com/drive/folders/110Py1Od8VZZvPQTtvfECXg_PPfYdRuej?usp=sharing
This will have in DescribeFeatureType (and GetFeature aswell):
a) for "application/json" all as expected:
$ curl -o - "http://localhost:8080/geoserver/fs/ows?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName=fs%3Afs&outputFormat=application/json"
{"elementFormDefault":"qualified","targetNamespace":"https://localhost/fs","targetPrefix":"fs","featureTypes":\[\{"typeName":"fs","properties":\[\{"name":"oid","maxOccurs":1,"minOccurs":1,"nillable":false,"type":"xsd:int","localType":"int"\},\{"name":"geom","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"gml:Point","localType":"Point"\},\{"name":"name","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"\},\{"name":"description","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"\},\{"name":"f\_name","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"\},\{"name":"f\_description","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"\}\]\}]}
b) but for "application/gml+xml; version=3.2":
$ curl -o - "http://localhost:8080/geoserver/fs/ows?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName=fs%3Afs&outputFormat=application%2Fgml%2Bxml%3B%20version%3D3.2"
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fs="https://localhost/fs" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wfs="http://www.opengis.net/wfs/2.0" elementFormDefault="qualified" targetNamespace="https://localhost/fs">
<xsd:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://localhost:8080/geoserver/schemas/gml/3.2.1/gml.xsd"/>
<xsd:complexType name="fsType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="oid" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:PointPropertyType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="f_name" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="f_description" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="fs" substitutionGroup="gml:AbstractFeature" type="fs:fsType"/>
</xsd:schema>
c) and also for "text/xml; subtype=gml/3.1.1":
$ curl -o - "http://localhost:8080/geoserver/fs/ows?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName=fs%3Afs&outputFormat=text/xml;%20subtype=gml/3.1.1"
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fs="https://localhost/fs" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" targetNamespace="https://localhost/fs">
<xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://localhost:8080/geoserver/schemas/gml/3.1.1/base/gml.xsd"/>
<xsd:complexType name="fsType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="oid" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:PointPropertyType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="f_name" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="f_description" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="fs" substitutionGroup="gml:_Feature" type="fs:fsType"/>
</xsd:schema>
If logging is turned up to GEOTOOLS_DEVELOPER the GetFeature request produces this into the logs regardless of outputformat.
10 027 16:27:03 DEBUG [geotools.jdbc] - CREATE CONNECTION
10 027 16:27:03 DEBUG [geotools.jdbc] - SELECT "oid",encode(ST_AsEWKB("geom"), 'base64') as "geom","name","description","f_name","f_description" FROM "public"."fs" LIMIT 1000000
10 027 16:27:03 DEBUG [geotools.jdbc] - CLOSE CONNECTION
So everything is seemingly as it should be
All the best,
Tõnis
--
@tkardi