Hi list, I have a collection of Point, and I want to create a GML document.
This is my code, I use geotools v2.6.1:
...
if(schemaLocation==null || namespace==null){
            namespace = "http://www.opengis.net/gml";;
            schemaLocation = "
http://schemas.opengis.net/gml/3.1.1/base/feature.xsd";;
            configuration = new GMLConfiguration();//new
ApplicationSchemaConfiguration(namespace, schemaLocation);

            encoder = new org.geotools.xml.Encoder(configuration );
            encoder.setNamespaceAware(true);
            encoder.setSchemaLocation("http://www.opengis.net/gml";, "
http://schemas.opengis.net/gml/3.1.1/base/feature.xsd";);

        }else{
            configuration = new ApplicationSchemaConfiguration(namespace,
schemaLocation);

            encoder = new org.geotools.xml.Encoder(configuration );
            encoder.setNamespaceAware(true);
            encoder.setSchemaLocation("http://www.opengis.net/gml
http://schemas.opengis.net/gml/3.1.1/base/feature.xsd";, namespace + " " +
schemaLocation);


        }

        fc.features().close();
        //use the gml namespace with the FeatureCollection element to start
parsing the collection
        QName ns = new QName("http://www.opengis.net/gml
","FeatureCollection","wfs");
        try{
            encoder.encode(correctFeatureCollection, ns, os);

        }catch(IOException e){
            throw new RuntimeException(e);
        }
...
And at encoder call it trows this exception:
...
Failed to get properties. Binding for {
http://www.opengis.net/gml}PointPropertyType

org.geotools.xml.impl.GetPropertiesExecutor.visit:70
org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute:216
org.geotools.xml.impl.BindingWalker.walk:182
org.geotools.xml.impl.BindingWalker.walk:186
org.geotools.xml.impl.BindingPropertyExtractor.properties:90
org.geotools.xml.Encoder.encode:902
org.geotools.xml.Encoder.encode:559
...
Previusly appears some WARNINGS:
...
WARNING: MULTIPOINT (426983.5189 4149847.7454)
(com.vividsolutions.jts.geom.MultiPoint)  is not of type
com.vividsolutions.jts.geom.Point
...
Any idea whats happening?
Thanks in advance.
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to