Hello,
I am trying to encode a FeatureCollection to a gml Document using the code
snippet i found in the geotools user guid
(http://docs.codehaus.org/display/GEOTDOC/GML+XML+Support)
I'm using the code to parse a gml document without a schema which already
works quite fine. Now i'm trying to encode a featurecollection to a gml
document with the code posted at the end of this document. Streaming the
"xml" to a document returns the following result:

<?xml version="1.0" encoding="UTF-8"?>
<gml:_FeatureCollection xmlns:gml="http://www.opengis.net/gml";
xmlns:xlink="http://www.w3.org/1999/xlink"/>

But I know that the featurecollection is not empty since i used the
recentliy parsed featurecollection.
Can anyone help me out with this problem?
Thanks

Georg Walenciak


        public void createGmlFeatureCollection(FeatureCollection
featureCollection){     
                
                org.geotools.xml.Configuration configuration = new
org.geotools.gml2.GMLConfiguration();
                org.geotools.xml.Encoder encoder = new org.geotools.xml.Encoder(
configuration );

                //output stream to serialize to
                ByteArrayOutputStream xml = new ByteArrayOutputStream();

                        try {
                                
                        
encoder.encode(featureCollection,org.geotools.gml2.GML._FeatureCollection,xml);
                                
                        } catch (IOException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
               }
-- 
View this message in context: 
http://n2.nabble.com/Encoding-FeatureCollection-to-GML-returns-empty-GML-Document-tp3315115p3315115.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to