[Geoserver-devel] [jira] Created: (GEOS-1052) Other PostgreSQL data types could be better represented in the DescribeFeatureType XSD as well

Other PostgreSQL data types could be better represented in the DescribeFeatureType XSD as well
----------------------------------------------------------------------------------------------

                 Key: GEOS-1052
                 URL: http://jira.codehaus.org/browse/GEOS-1052
             Project: GeoServer
          Issue Type: Sub-task
          Components: WFS
    Affects Versions: 1.4.0
         Environment: PostgreSQL 8.2.3 / PostGIS 1.2.1
            Reporter: Frank Steggink
            Assignee: Andrea Aime
            Priority: Minor

The data types which could be represented better in the XSD are decimal(precision), decimal(precision, scale), date, time.

The type "decimal" has among its constraining facets the following facets: totalDigits and fractionDigits. These can be mapped directly to precision and scale.
Also, the types xsd:date and xsd:time exist, which can be used for the identically named PostgreSQL data types.

I'll show the table description and the resulting XSD generated by Geoserver (1.4.0)

Table description:
      Column | Type | Modifiers
------------------+-----------------------------+--------------------------------------------------------------
gid | integer | not null default nextval('single_polygon_gid_seq'::regclass)
prop_varchar10 | character varying(10) |
prop_varchar20 | character varying(20) |
prop_varchar50 | character varying(50) |
prop_bool | boolean |
prop_int2 | smallint |
prop_int4 | integer |
prop_int8 | bigint |
prop_float4 | real |
prop_float8 | double precision |
prop_decimal | numeric |
prop_decimal_4 | numeric(4,0) |
prop_decimal_6_2 | numeric(6,2) |
prop_date | date |
prop_time | time without time zone |
prop_timestamp | timestamp without time zone |
the_geom | geometry |

Result of DescribeFeatureType:
<?xml version="1.0" encoding="UTF-8"?><xs:schema targetNamespace="http://www.example.org/pgtest&quot; xmlns:pgtest="http://www.example.org/pgtest&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:xs="http://www.w3.org/2001/XMLSchema&quot; elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"><xs:import namespace="http://www.opengis.net/gml&quot; schemaLocation="http://127.0.0.1:8080/geoserver/schemas/gml/2.1.2/feature.xsd&quot;/&gt;&lt;xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema&quot; name="single_polygon_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="prop_varchar10" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>

</xs:simpleType>
</xs:element>
<xs:element name="prop_varchar20" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

<xs:element name="prop_varchar50" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="prop_bool" minOccurs="0" nillable="true" type="xs:boolean"/>
<xs:element name="prop_int2" minOccurs="0" nillable="true" type="xs:short"/>

<xs:element name="prop_int4" minOccurs="0" nillable="true" type="xs:int"/>
<xs:element name="prop_int8" minOccurs="0" nillable="true" type="xs:long"/>
<xs:element name="prop_float4" minOccurs="0" nillable="true" type="xs:float"/>
<xs:element name="prop_float8" minOccurs="0" nillable="true" type="xs:double"/>
<xs:element name="prop_decimal" minOccurs="0" nillable="true" type="xs:decimal"/>
<xs:element name="prop_decimal_4" minOccurs="0" nillable="true" type="xs:decimal"/>
<xs:element name="prop_decimal_6_2" minOccurs="0" nillable="true" type="xs:decimal"/>
<xs:element name="prop_date" minOccurs="0" nillable="true" type="xs:dateTime"/>
<xs:element name="prop_time" minOccurs="0" nillable="true" type="xs:dateTime"/>

<xs:element name="prop_timestamp" minOccurs="0" nillable="true" type="xs:dateTime"/>
<xs:element name="the_geom" minOccurs="0" nillable="true" type="gml:PolygonPropertyType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name='single_polygon' type='pgtest:single_polygon_Type' substitutionGroup='gml:_Feature'/></xs:schema>

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira