geotools kml 2.1 and kml 2.2 encoding problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

geotools kml 2.1 and kml 2.2 encoding problem

Birke Heeren

Hi,

we are using the newest geotools version 17.1

When encoding our data into kml we encounter the following problems:

1.) When encoding as kml 2.1 then the Metadata is missing (import org.geotools.kml.*;)

2.) When encoding as kml 2.2 then the geometry is missing (import org.geotools.kml.v22.*;)

This is our feature type:

SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder();
      typeBuilder.setName("occurrences");
      typeBuilder.add("geometry", Geometry.class, DefaultGeographicCRS.WGS84);
      typeBuilder.add("name", String.class);
      typeBuilder.add("description", String.class);
      typeBuilder.add("uuid", String.class);
      SimpleFeatureType type = typeBuilder.buildFeatureType();

Anybody any ideas? We appreciate any help.

With kind regards,

Birke


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Reply | Threaded
Open this post in threaded view
|

Re: geotools kml 2.1 and kml 2.2 encoding problem

jody.garnett
I think you will need to dig a bit more, can you step through with the debugger and watch it ignore metadata or geometry and report back?

You could try explicilty setting the default geometry to "geometry", you also chose the generic Geometry.class - I am not sure what KML supports (some formats such as shapefile are limited to a specific subclass of geometry).

--
Jody Garnett

On 7 June 2017 at 04:51, Birke Heeren <[hidden email]> wrote:

Hi,

we are using the newest geotools version 17.1

When encoding our data into kml we encounter the following problems:

1.) When encoding as kml 2.1 then the Metadata is missing (import org.geotools.kml.*;)

2.) When encoding as kml 2.2 then the geometry is missing (import org.geotools.kml.v22.*;)

This is our feature type:

SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder();
      typeBuilder.setName("occurrences");
      typeBuilder.add("geometry", Geometry.class, DefaultGeographicCRS.WGS84);
      typeBuilder.add("name", String.class);
      typeBuilder.add("description", String.class);
      typeBuilder.add("uuid", String.class);
      SimpleFeatureType type = typeBuilder.buildFeatureType();

Anybody any ideas? We appreciate any help.

With kind regards,

Birke


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users