Oops sorry, that is what i get for writing code without looking. The QName
passed in is the Name of the root element to encode. In this case it would
be:

encoder.encode(features, org.geotools.wfs.v1_0.WFS.FeatureCollection,
output)



On Wed, Oct 17, 2012 at 10:40 AM, Leiche teich <[email protected]>wrote:

> Hi Justin,
>
> thanks for your very fast response :-)
>
> 2012/10/17 Justin Deoliveira <[email protected]>
>
>> You should be able to do this.
>>
>> Encoder e = new Encoder(new org.geotools.wfs.v1_0.WFSConfiguration());
>> e.encoder(features, output);
>>
> There are only encode methods, wich needs a QName. How do i have to do
> that?
>
> Matthias
>
>>
>> -Justin
>>
>> On Wed, Oct 17, 2012 at 8:54 AM, Leiche teich <[email protected]>wrote:
>>
>>> Hi,
>>>
>>> what is the prefered way to write a FeatureCollection into a GML file?
>>> Are there a GML DataStore implementation? I've found only this one:
>>> http://docs.geotools.org/latest/userguide/library/xml/geometry.html#gml2-encoding-example
>>> But there are some problems. With Version.GML2 i get
>>> an IllegalStateException "Cannot encode a feature collection using GML2
>>> (only WFS)" or is set the legacy mode flag. And with Version.GML3 the GML
>>> file is empty. If i look in org.geotools.GML.java, in
>>> the encode(OutputStream out, SimpleFeatureCollection collection) method, i
>>> see that Version.GML3 will be ignored.
>>> And at the last, there is a typo in the above document:
>>>
>>> encode2.encode(out2, collection);
>>>
>>> should IMHO be
>>>
>>> encode2.encode(xml, collection);
>>>
>>> Thanks for your help
>>>
>>> Matthias
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>>> _______________________________________________
>>> GeoTools-GT2-Users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>>
>>
>>
>> --
>> Justin Deoliveira
>> OpenGeo - http://opengeo.org
>> Enterprise support for open source geospatial.
>>
>>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>


-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to