Hey Oliver,

At the moment the kml encoder will only encode feature attributes "name"
and "description". The rationale being those are the only attributes we can
map directly to whats support in kml.

Hopwever, kml 2.2 added support for "schema data", and the ability to
attach extra attributes. At the moment the kml module only supports parsing
kml that has these attributes, it won't encode feature attributes as schema
data. But it would be a great to have that so feel free to open a feature
request in jira. Or better yet work on a patch for it if you are keen :)

-Justin



On Thu, Oct 3, 2013 at 1:11 AM, Oliver May <[email protected]> wrote:

> Hi All,
>
> As this is my first post on the mailing-list, I should thank you for the
> great library first! :)
>
> That said, I am using geotools (9.5) to write out KML this way:
>  Encoder encoder = new Encoder(new KMLConfiguration());
> encoder.setIndenting(true);
> encoder.encode(obj, KML.kml, output);
> obj, being a MemoryFeatureCollection with SimpleFeatures. My output starts
> als follows:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <kml:kml xmlns:kml="http://earth.google.com/kml/2.1";>
>     <kml:Document id="featureCollection">
>         <kml:Placemark id="activiteiten.fid-2cb48210_141799a03d5_-63af">
>             <kml:Point>
>
> <kml:coordinates>3.765177178775156,50.987571210123946</kml:coordinates>
>             </kml:Point>
>         </kml:Placemark>
> ...
>
> Now my problem is that the output only contains the geometry, but no
> attributes. Is this by design, or is there something wrong? Is there a way
> to fill the name and description fields in the kml Encoder?
>
> kind regards,
>
> --
> Oliver May
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>


-- 
*Justin Deoliveira*
Vice President, Engineering | Boundless
[email protected]
@j_deolive <https://twitter.com/j_deolive>
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to