#5834 closed defect (fixed)
WFS Driver is not correctly setting Geometry Type
Reported by: | jpalmer | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.0.0 |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: |
Description
WFS Driver is not correctly setting Geometry Type to WkbNone for featureTypes without a geometry column. Currently it sets the type as WkbUnknown.
In the example below the WFS featuretype does not contain a geometry column, yet it's setting the geometry type to WkbUnknown and assigning a coordinate system:
ogrinfo -so -al wfs:'http://wfs.data.linz.govt.nz/59f2aaa148bd4818994fa0d3ca36f7e1/v/x1211/wfs' <pre> ERROR 1: Server is read-only WFS; no WFS-T feature advertized Had to open data source read-only. INFO: Open of `wfs:http://wfs.data.linz.govt.nz/59f2aaa148bd4818994fa0d3ca36f7e1/v/x1211/wfs' using driver `WFS' successful. Layer name: v:x1211 Geometry: Unknown (any) Feature Count: 77 Layer SRS WKT: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0, AUTHORITY["EPSG","8901"]], UNIT["degree",0.0174532925199433, AUTHORITY["EPSG","9122"]], AUTHORITY["EPSG","4326"]] gml_id: String (0.0) NOT NULL code: String (0.0) name: String (0.0) processing_centre: String (0.0) abbreviation: String (0.0) modified: String (0.0) id: Integer (0.0)
If you look at the schema for the featuretype you can see there are no attributes with a GML geometry type.
<xsd:schema xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:v="http://wfs.data.linz.govt.nz" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://wfs.data.linz.govt.nz"> <xsd:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://wfs.data.linz.govt.nz/schemas/gml/3.2.1/gml.xsd"/> <xsd:complexType name="x1211Type"> <xsd:complexContent> <xsd:extension base="gml:AbstractFeatureType"> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="0" name="code" nillable="true" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="name" nillable="true" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="processing_centre" nillable="true" type="xsd:short"/> <xsd:element maxOccurs="1" minOccurs="0" name="abbreviation" nillable="true" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="modified" nillable="true" type="xsd:dateTime"/> <xsd:element maxOccurs="1" minOccurs="0" name="id" nillable="true" type="xsd:int"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:element name="x1211" substitutionGroup="gml:AbstractFeature" type="v:x1211Type"/> </xsd:schema>
Change History (5)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Milestone: | → 2.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:4 by , 9 years ago
Note that the service does still advertize in the GetCapabilities that the geometryless feature type covers the whole world in EPSG:4326. I wouldn't be surprised if many other clients will have some troubles with this feature type.
<ows:Keywords> <ows:Keyword>New Zealand</ows:Keyword> <ows:Keyword>Roads and Addresses</ows:Keyword> <ows:Keyword>Street and Places Index</ows:Keyword> </ows:Keywords> <DefaultSRS>urn:ogc:def:crs:EPSG::4326</DefaultSRS> <ows:WGS84BoundingBox> <ows:LowerCorner>-180.0 -90.0</ows:LowerCorner> <ows:UpperCorner>180.0 90.0</ows:UpperCorner> </ows:WGS84BoundingBox>
I am not sure but I believe that GetCapabilities is actually wrong. If I can read http://schemas.opengis.net/wfs/1.1.0/wfs.xsd is says that there should be either DefaultSRS and WGS84BoiundingBox or <xsd:element name="NoSRS">.
There may a connection with this issue in the Geoserver Jira http://jira.codehaus.org/browse/GEOS-3233.
Here is a minimal GML file that is created by ogr2ogr from a CSV file which proofs that GDAL can handle GML that lacks geometry attribute and this issue is special for WFS.