Opened 10 years ago

Last modified 10 years ago

#5476 closed defect

OGR2OGR choosing incorrect datatype — at Initial Version

Reported by: adcgis Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords: ogr2ogr
Cc:

Description

When using OGR2OGR to connect to WFS service pulling down GML, an incorrect data type is chosen. Chooses integer when should be string.

I understand that this has been an issue in the past, due to data sampling levels, maybe this needs to be adjusted again....

OGR is being utilised as part of MS4W 3.0.6

Using Linz data service, connecting direct from GIS system shows and downloads correct data type.

Connection string is as follows for testing purposes.

Variables populated in system WFS_SRS=EPSG:4167 NZTM_SRS=EPSG:2193 BBOX=-44.209572,170.607051,-43.189952,172.220523

Linz WFS layer that comes down incorrectly is Title,x804 Field that is incorrect is title_no

"%OGR_HOME%\ogr2ogr.exe" -s_srs %WFS_SRS% -t_srs %WFS_SRS% -a_srs %WFS_SRS% -f "GML" "%DEST%\gml\%%A.gml" "WFS:http://wfs.data.linz.govt.nz/%LDS_KEY%/v/%%B/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=v:%%B&bbox=%BBOX%&SRSNAME=%WFS_SRS%" -skipfailures

XSD file that is created by OGR2OGR when connecting to the wfs for this layer is as follows.

<?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0"> <xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/> <xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/> <xs:complexType name="FeatureCollectionType">

<xs:complexContent>

<xs:extension base="gml:AbstractFeatureCollectionType">

<xs:attribute name="lockId" type="xs:string" use="optional"/> <xs:attribute name="scope" type="xs:string" use="optional"/>

</xs:extension>

</xs:complexContent>

</xs:complexType> <xs:element name="v_x804" type="ogr:v_x804_Type" substitutionGroup="gml:_Feature"/> <xs:complexType name="v_x804_Type">

<xs:complexContent>

<xs:extension base="gml:AbstractFeatureType">

<xs:sequence>

<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/> <xs:element name="gml_id" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:string"> </xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:integer">

<xs:totalDigits value="16"/>

</xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="title_no" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:integer">

<xs:totalDigits value="16"/>

</xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="status" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:string"> </xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="type" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:string"> </xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="land_district" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:string"> </xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="issue_date" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:string"> </xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="guarantee_status" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:string"> </xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="estate_description" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:string"> </xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="number_owners" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:integer">

<xs:totalDigits value="16"/>

</xs:restriction>

</xs:simpleType>

</xs:element> <xs:element name="spatial_extents_shared" nillable="true" minOccurs="0" maxOccurs="1">

<xs:simpleType>

<xs:restriction base="xs:string"> </xs:restriction>

</xs:simpleType>

</xs:element>

</xs:sequence>

</xs:extension>

</xs:complexContent>

</xs:complexType> </xs:schema>

Change History (1)

by adcgis, 10 years ago

Attachment: Title.xsd added
Note: See TracTickets for help on using tickets.