xsd-gml2 cannot encode a generic geometry collection
----------------------------------------------------

                 Key: GEOT-3312
                 URL: http://jira.codehaus.org/browse/GEOT-3312
             Project: GeoTools
          Issue Type: Bug
          Components: ext xml-xsd
    Affects Versions: 2.7-M3
            Reporter: Andrea Aime
            Assignee: Justin Deoliveira
             Fix For: 2.7-M4


The problem at first appears to be a simple missing element in the bindings 
that a simple patch like:

{code}
diff --git 
a/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/bindings/GMLAbstractGeometryCollectionBaseTypeBinding.java
 
b/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/bindings/GMLAbstractGeometryCollectionBaseTypeBinding.java
index 1baf3a6..f8bc4b5 100644
--- 
a/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/bindings/GMLAbstractGeometryCollectionBaseTypeBinding.java
+++ 
b/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/bindings/GMLAbstractGeometryCollectionBaseTypeBinding.java
@@ -25,6 +25,7 @@ import org.geotools.xml.Node;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 
 import com.vividsolutions.jts.geom.GeometryCollection;
+import com.vividsolutions.jts.geom.MultiPoint;
 
 
 /**
@@ -100,6 +101,8 @@ public class GMLAbstractGeometryCollectionBaseTypeBinding 
extends AbstractComple
             if ( crs != null ) {
                 return GML2EncodingUtils.toURI(crs,true);
             }
+        } else if (GML.geometryMember.equals(name)) {
+            return GML2ParsingUtils.asCollection((GeometryCollection) object);
         }
         return null;
     }
{code}

should be able to cure.

Unfortunately that does not work properly, it results in specific geometry 
collections like, for example, PointGeometryCollection to have every geometry 
encoded twice, first as a geometryMember, and then as pointMember.

I believe the real patch would then be to make all the specific collection 
bindings override the base one so that the base 
GMLAbstractGeometryCollectionBaseTypeBinding is not called at all? And then 
replicate the base abstract bidning behavior in the specific binding classes?

-- 
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

        

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to