[Geoserver-devel] Geometry type in DescribeFeatureType request /w Oracle datastore

Hi there,

I use Geoserver (with an Oracle datastore) to highlight features in an
OpenLayers app . The geometry type is determined via a DescribeFeatureType
request, but the request always returns "gml:GeometryPropertyType" for the
geometry attribute, which effectively highlights polygons as if they were
points.

My guess was that a custom schema.xml would help solve this problem, but the
functionality is broken and scheduled to be fixed in 1.7.3. So for now I
installed a 1.6.5 Geoserver, which picks up my schema.xml but always sets
the more generic "gml:GeometryPropertyType" instead of
"gml:PolygonPropertyType".

Comments on issue this http://jira.codehaus.org/browse/GEOS-1124
http://jira.codehaus.org/browse/GEOS-1124 suggest that this is not a bug
because Oracle allows storing multiple geometry types in one column.

Is there a way to specify the specific type of my geometry attribute in
Geoserver when using an Oracle datastore? More or less like the
'"gml_<column_name>_type" "polygon"' in the METADATA section of a MapServer
mapfile.

Thanks for helping me out!

Regards,
Robert van Drunen
--
View this message in context: http://www.nabble.com/Geometry-type-in-DescribeFeatureType-request--w-Oracle-datastore-tp22056270p22056270.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hi Robert,

We are currently trying to resurrect the current schema.xml behavior for 1.7.3. However for previous versions you can work around the problem by changing schema.xml to schema.xsd. But, the syntax for the two is somewhat different. schema.xml is just the complex type definition, whereas schema.xsd is an entire schema.

I suggest you do the following:

1) do a DFT against your feature type, and save the result to disk
2) manually change GeometryPropertyType to PolygonPropertyType
3) copy the file to schema.xsd inside of the featureType directory for your feature type (parallel to schema.xml)

And that should get across to openlayers the desired information. Try that and let me know if that works.

-Justin

Roberdt wrote:

Hi there,

I use Geoserver (with an Oracle datastore) to highlight features in an
OpenLayers app . The geometry type is determined via a DescribeFeatureType
request, but the request always returns "gml:GeometryPropertyType" for the
geometry attribute, which effectively highlights polygons as if they were
points.

My guess was that a custom schema.xml would help solve this problem, but the
functionality is broken and scheduled to be fixed in 1.7.3. So for now I
installed a 1.6.5 Geoserver, which picks up my schema.xml but always sets
the more generic "gml:GeometryPropertyType" instead of
"gml:PolygonPropertyType".

Comments on issue this http://jira.codehaus.org/browse/GEOS-1124
http://jira.codehaus.org/browse/GEOS-1124 suggest that this is not a bug
because Oracle allows storing multiple geometry types in one column.

Is there a way to specify the specific type of my geometry attribute in
Geoserver when using an Oracle datastore? More or less like the
'"gml_<column_name>_type" "polygon"' in the METADATA section of a MapServer
mapfile.

Thanks for helping me out!

Regards,
Robert van Drunen

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

I forgot to mention one step in the work around. When you save the schema out to disk, comment out the import of the gml namespace. I am working on the fix for this as well.

-Justin

Justin Deoliveira wrote:

Hi Robert,

We are currently trying to resurrect the current schema.xml behavior for 1.7.3. However for previous versions you can work around the problem by changing schema.xml to schema.xsd. But, the syntax for the two is somewhat different. schema.xml is just the complex type definition, whereas schema.xsd is an entire schema.

I suggest you do the following:

1) do a DFT against your feature type, and save the result to disk
2) manually change GeometryPropertyType to PolygonPropertyType
3) copy the file to schema.xsd inside of the featureType directory for your feature type (parallel to schema.xml)

And that should get across to openlayers the desired information. Try that and let me know if that works.

-Justin

Roberdt wrote:

Hi there,

I use Geoserver (with an Oracle datastore) to highlight features in an
OpenLayers app . The geometry type is determined via a DescribeFeatureType
request, but the request always returns "gml:GeometryPropertyType" for the
geometry attribute, which effectively highlights polygons as if they were
points.

My guess was that a custom schema.xml would help solve this problem, but the
functionality is broken and scheduled to be fixed in 1.7.3. So for now I
installed a 1.6.5 Geoserver, which picks up my schema.xml but always sets
the more generic "gml:GeometryPropertyType" instead of
"gml:PolygonPropertyType".

Comments on issue this http://jira.codehaus.org/browse/GEOS-1124
http://jira.codehaus.org/browse/GEOS-1124 suggest that this is not a bug
because Oracle allows storing multiple geometry types in one column.

Is there a way to specify the specific type of my geometry attribute in
Geoserver when using an Oracle datastore? More or less like the
'"gml_<column_name>_type" "polygon"' in the METADATA section of a MapServer
mapfile.

Thanks for helping me out!

Regards,
Robert van Drunen

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Roberdt ha scritto:

Hi there,

I use Geoserver (with an Oracle datastore) to highlight features in an
OpenLayers app . The geometry type is determined via a DescribeFeatureType
request, but the request always returns "gml:GeometryPropertyType" for the
geometry attribute, which effectively highlights polygons as if they were
points.

My guess was that a custom schema.xml would help solve this problem, but the
functionality is broken and scheduled to be fixed in 1.7.3. So for now I
installed a 1.6.5 Geoserver, which picks up my schema.xml but always sets
the more generic "gml:GeometryPropertyType" instead of
"gml:PolygonPropertyType".

Comments on issue this http://jira.codehaus.org/browse/GEOS-1124
http://jira.codehaus.org/browse/GEOS-1124 suggest that this is not a bug
because Oracle allows storing multiple geometry types in one column.

Is there a way to specify the specific type of my geometry attribute in
Geoserver when using an Oracle datastore? More or less like the
'"gml_<column_name>_type" "polygon"' in the METADATA section of a MapServer
mapfile.

Thanks for helping me out!

Hi Robert,
while one can use the schema.xml workaround, there is a direct
solution for your problem as well, that is, actually declaring the
geometry type in Oracle.

It is not well known, but you can declare the geometry type in Oracle
by adding a bit of metadata in your spatial index, and GeoServer will
pick it up and generate the proper schema by itself.

Here is an example of a spatial index creation for a point layer:

CREATE INDEX FT1_GEOMETRY_IDX ON FT1(GEOMETRY) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('SDO_INDX_DIMS=2 LAYER_GTYPE="POINT"')

Please refer to the Oracle documentation for more details.

Cheers
Andrea

PS: this question was for the users ml, the devel ml is for GS
core developers to talk to each other, not for users to ask
questions to developers (we're all subscribed to the users ml as
well).

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.