[Geoserver-users] Geometry.Collection gml parsing failed

Hello List,

I have a problem to update my Geometry.Collection geometries.

My system is OL 2.7, GeoServer 1.6.3 and Oracle 10g.

I have some Geometry.Collections which are a bundle of some polygons and
other geometry objects. There are stored in the Oracle 10g database as
SDO_GEOMETRY-type: 2004, which meens a collection of geometries.

The GetFeature-Request shows me a right XML-structure of:

<NAMESPACE:THE_GEOM>
   <gml:GeometryCollection
srsName="http://www.opengis.net/gml/srs/epsg.xml#23032&quot;&gt;
      <gml:geometryMember>
         <gml:Polygon>
            <gml:outerBoundaryIs>
               <gml:LinearRing>
                  <gml:coordinates xmlns:gml="http://www.opengis.net/gml&quot;
decimal="." cs="," ts=" ">
                     some coordinates
                  </gml:coordinates>
               </gml:LinearRing>
            </gml:outerBoundaryIs>
            <gml:innerBoundaryIs>
               <gml:LinearRing>
                  <gml:coordinates xmlns:gml="http://www.opengis.net/gml&quot;
decimal="." cs="," ts=" ">
                     some coordinates
                  </gml:coordinates>
               </gml:LinearRing>
            </gml:innerBoundaryIs>
         </gml:Polygon>
      </gml:geometryMember>
   </gml:GeometryCollection>
</NAMESPACE:THE_GEOM>

but if I post a update transaction of a Geometry.Collection like this:

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS"
version="1.0.0" xsi:schemaLocation
="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd&quot; xmlns:xsi="http
://www.w3.org/2001/XMLSchema-instance"><wfs:Update
typeName="NAMESPACE:FEATURE" xmlns:NAMESPACE="URI">
<wfs:Property>
   <wfs:Name>THE_GEOM</wfs:Name>
   <wfs:Value>
      <gml:GeometryCollection xmlns:gml="http://www.opengis.net/gml&quot;
srsName="EPSG:23032">
         <gml:geometryMember>
            <gml:Polygon srsName="EPSG:23032">
               <gml:outerBoundaryIs>
                  <gml:LinearRing>
                     <gml:coordinates decimal="." cs="," ts=" ">
                        some coordinates
                     </gml:coordinates>
                  </gml:LinearRing>
               </gml:outerBoundaryIs>
               <gml:innerBoundaryIs>
                  <gml:LinearRing>
                     <gml:coordinates decimal="." cs="," ts=" ">
                        some coordinates
                     </gml:coordinates>
                  </gml:LinearRing>
               </gml:innerBoundaryIs>
           </gml:Polygon>
         </gml:geometryMember>
      </gml:GeometryCollection>
   </wfs:Value>
</wfs:Property>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
   <ogc:FeatureId fid="FEATUREID"/>
</ogc:Filter>
</wfs:Update>
</wfs:Transaction>

it will fail about a unknown declaration of gml-element:
gml:GeometryCollection.

The GeoServer log wrote out this error:

2009-03-30 10:43:58,150 DEBUG [org.geotools.xml] - Could not find
declaration for: {http://www.opengis.net/gml\}GeometryCollection. Checking if
containing type declares a single particle.
2009-03-30 10:43:58,151 DEBUG [org.geotools.xml] - Could not find
declaration for: {http://www.opengis.net/gml\}GeometryCollection. Performing
lookup by ignoring namespace
2009-03-30 10:43:58,151 DEBUG [org.geotools.xml] - Could not find
declaration for: {http://www.opengis.net/gml\}GeometryCollection. Creating a
mock element declaration and parsing anyways...

I've took a look into the org.geotools.xml.gml and there is in the
GMLComplexTypes.js a GeometryCollection for parsing defined.

Realy I don't know what is wrong. The "gml:GeometryCollection" exists but
why the gml parser could not find it.

Has anyone a solution or part of answer how it could happend. Or has anyone
trigger the same problem?

Realy thanks 2StepForward
--
View this message in context: http://www.nabble.com/Geometry.Collection-gml-parsing-failed-tp22782921p22782921.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi all,

I have made an additionaly search and found out, that geoserver has some
gml-xsd schema files who represent the possible gml schemas.

After some viewings over the different gml schema version files in the
webapps\geoserver\schemas\gml\.... I have found that there is no definition
for the GeometryCollection type which was postet by openlayers as
<gml:GeometryCollection><gml:geometryMember>.......</gml:geometryMember></gml:GeometryCollection>

Maybe this is a part of the problem, or the problem himself?

I have read that the gml spezification hasn't any GeometryCollection
defined, but the OL post it definatly and there is no xsd schema definition
for it.
If I understand things right, the parserhandler has no schema definition for
that gml type....

Thanks 2StepForward
--
View this message in context: http://www.nabble.com/Geometry.Collection-gml-parsing-failed-tp22782921p22786986.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

I think this issue may have been solved in 1.7.2. See this bug report:

http://jira.codehaus.org/browse/GEOS-2276

I noticed you are running 1.6.3? Is there any chance you can update to 1.7.3 and see if the problem persists?

-Justin

2StepForward wrote:

Hi all,

I have made an additionaly search and found out, that geoserver has some
gml-xsd schema files who represent the possible gml schemas.

After some viewings over the different gml schema version files in the
webapps\geoserver\schemas\gml\.... I have found that there is no definition
for the GeometryCollection type which was postet by openlayers as
<gml:GeometryCollection><gml:geometryMember>.......</gml:geometryMember></gml:GeometryCollection>

Maybe this is a part of the problem, or the problem himself?

I have read that the gml spezification hasn't any GeometryCollection
defined, but the OL post it definatly and there is no xsd schema definition
for it.
If I understand things right, the parserhandler has no schema definition for
that gml type....

Thanks 2StepForward

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

Hi Justin,

thanks for reply. I've forgot to say that I had test it also with the new
geoserver 1.7.3 and it wrote out in the geoserver log:

2009-03-31 09:57:53,432 DEBUG [org.geotools.xml] - Found override for
http://www.opengis.net/wfs:
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd ==>
jar:file:/srv/geoserver/webapps/geoserver/WEB-INF/lib/wfs-1.7.3-SNAPSHOT.jar!/org/geoserver/wfs/xml/v1_0_0/WFS-transaction.xsd
2009-03-31 09:57:53,436 DEBUG [org.geotools.xml] - Could not find
declaration for: {http://www.opengis.net/gml\}GeometryCollection. Checking if
containing type declares a single particle.
2009-03-31 09:57:53,439 DEBUG [org.geotools.xml] - Could not find
declaration for: {http://www.opengis.net/gml\}GeometryCollection. Performing
lookup by ignoring namespace
2009-03-31 09:57:53,440 INFO [org.geotools.xml] - Could not find declaration
for: {http://www.opengis.net/gml\}GeometryCollection. Creating a mock element
declaration and parsing anyways...

Could it the false, that these post is only possible with wfs 1.1 service?
I have posted it with the wfs 1.0 service definition.

The schema definitions for "MultiGeometry" and the "MultigeometryType" are
existes, but not for the "GeometryCollection" and the
"GeometryCollectionType".

I have found a definition of the "GeometryCollection" in the
modules\library\xml\src\main\java\org\geotools\xml\gml\GMLSchema.java but
not an equivalent in the geoserver/webapps/schemas/gml/3.1.1

elements1[29] = new GMLElement("_Geometry",
GMLComplexTypes.AbstractGeometryType.getInstance(), 1, 1, true,null); //
gml:AbstractGeometryType

elements1[30] = new GMLElement("GeometryCollection",
GMLComplexTypes.GeometryCollectionType.getInstance(), 1, 1,true,
elements1[29]); // gml:GeometryCollectionType

I've try it with the new gs 1.7.3 and there should the problem also
persists.

Thanks 2StepForward

Justin Deoliveira-6 wrote:

Hi,

I think this issue may have been solved in 1.7.2. See this bug report:

http://jira.codehaus.org/browse/GEOS-2276

I noticed you are running 1.6.3? Is there any chance you can update to
1.7.3 and see if the problem persists?

-Justin

--
View this message in context: http://www.nabble.com/Geometry.Collection-gml-parsing-failed-tp22782921p22800385.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Actually you are right, there is no such element "GeometryCollection" in gml 2, it is named "_GeometryCollection". So the parser behavior seems ot be correct. I believe if you change GeometryCollection to MultiGeometry it should work as excepted.

2StepForward wrote:

Hi Justin,

thanks for reply. I've forgot to say that I had test it also with the new
geoserver 1.7.3 and it wrote out in the geoserver log:

2009-03-31 09:57:53,432 DEBUG [org.geotools.xml] - Found override for
http://www.opengis.net/wfs:
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd ==>
jar:file:/srv/geoserver/webapps/geoserver/WEB-INF/lib/wfs-1.7.3-SNAPSHOT.jar!/org/geoserver/wfs/xml/v1_0_0/WFS-transaction.xsd
2009-03-31 09:57:53,436 DEBUG [org.geotools.xml] - Could not find
declaration for: {http://www.opengis.net/gml\}GeometryCollection. Checking if
containing type declares a single particle.
2009-03-31 09:57:53,439 DEBUG [org.geotools.xml] - Could not find
declaration for: {http://www.opengis.net/gml\}GeometryCollection. Performing
lookup by ignoring namespace
2009-03-31 09:57:53,440 INFO [org.geotools.xml] - Could not find declaration
for: {http://www.opengis.net/gml\}GeometryCollection. Creating a mock element
declaration and parsing anyways...

Could it the false, that these post is only possible with wfs 1.1 service?
I have posted it with the wfs 1.0 service definition.

The schema definitions for "MultiGeometry" and the "MultigeometryType" are
existes, but not for the "GeometryCollection" and the
"GeometryCollectionType".

I have found a definition of the "GeometryCollection" in the
modules\library\xml\src\main\java\org\geotools\xml\gml\GMLSchema.java but
not an equivalent in the geoserver/webapps/schemas/gml/3.1.1

elements1[29] = new GMLElement("_Geometry",
GMLComplexTypes.AbstractGeometryType.getInstance(), 1, 1, true,null); //
gml:AbstractGeometryType

elements1[30] = new GMLElement("GeometryCollection",
GMLComplexTypes.GeometryCollectionType.getInstance(), 1, 1,true,
elements1[29]); // gml:GeometryCollectionType

I've try it with the new gs 1.7.3 and there should the problem also
persists.

Thanks 2StepForward

Justin Deoliveira-6 wrote:

Hi,

I think this issue may have been solved in 1.7.2. See this bug report:

http://jira.codehaus.org/browse/GEOS-2276

I noticed you are running 1.6.3? Is there any chance you can update to 1.7.3 and see if the problem persists?

-Justin

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