Question

KML writer - missing values

  • 22 November 2018
  • 12 replies
  • 33 views

Badge

Hi folks,

I have a workspace that

  • reads in an Excel file
  • joins it with a KML file to Georeference the entries
  • uses an AttributeManager to keep just the values from the Excel file
  • writes the output as a KML file

Most of the attributes end up as blank/missing.

Does anyone know what is happening and how I fix this?

Thanks in advance,

Ian


12 replies

Userlevel 4

Have you tried sending the feaures to the Inspector and check for the presence of the attributes there?

Try connecting the Inspector to the last transformer before the writer.

Badge

I have inspected the values there and they are fine. If I rename attributes to be shorter and use a ShapeFile writer then I can get the values but would rather use a KML (or other format) that copes with longer attribute name.

Userlevel 4

Can you post a minimal workspace that reproduces the behavior here?

Badge

Here one is joiner.zip

Userlevel 4

As far as I can tell, the attributes are all there in the KML, inside the CDATA block of the <description> tag. Or am I missing something?

Userlevel 4

Here's from importing the KML in Google Earth:

Badge

When I look the FME Data Inspector or QGIS I see the following in the table.

 

Userlevel 4

The attributes are visible in the FME Inspector by looking at the "kml_description" attribute:

 

I don't know how QGIS handles KML attributes, however.

Badge

David,

Thanks for looking into this. Do you know why the INSPIREID is shown in the attribute table and the other values end up in the kml_description instead?

And why there are columns shown in the table that don't contain the data?

I have some other workflows that just read in a Shapefiles, filter the features using the clipper and then write a KML. In these cases all the values are visible in the data inspector's table.

It would be great if the FME could always put the values into the table.

Ian

Userlevel 4

David,

Thanks for looking into this. Do you know why the INSPIREID is shown in the attribute table and the other values end up in the kml_description instead?

And why there are columns shown in the table that don't contain the data?

I have some other workflows that just read in a Shapefiles, filter the features using the clipper and then write a KML. In these cases all the values are visible in the data inspector's table.

It would be great if the FME could always put the values into the table.

Ian

Unfortunately I don't know, I very rarely use KML. Let's hope someone else can chime in here.

Userlevel 2
Badge +17

Hi @ianashley,

There is a list attribute from the source KML (kml_schema_data{}) that is overriding the User Attributes set on the output feature type. We are working on correcting this, but in the meantime removing this list will ensure your attributes are written correctly.

Please open the source KML feature type Properties and select the Format Attribute tab. Click the boxes next to kml_schema_data{}.name and kml_schema_data{}.value. This will expose the list to the workspace.

Next, add an AttributeRemover transformer (the AttributeManager cannot remove lists), and select kml_schema_data{} in Lists to Remove. You can leave Attributes to Remove unset.

Run the workspace again - the attributes in the output should now be properly filled.

Badge

Hi @ianashley,

There is a list attribute from the source KML (kml_schema_data{}) that is overriding the User Attributes set on the output feature type. We are working on correcting this, but in the meantime removing this list will ensure your attributes are written correctly.

Please open the source KML feature type Properties and select the Format Attribute tab. Click the boxes next to kml_schema_data{}.name and kml_schema_data{}.value. This will expose the list to the workspace.

Next, add an AttributeRemover transformer (the AttributeManager cannot remove lists), and select kml_schema_data{} in Lists to Remove. You can leave Attributes to Remove unset.

Run the workspace again - the attributes in the output should now be properly filled.

Thanks very much. That worked perfectly.

BTW I think outputting as GML suffers from the same problem, they could be related.

Reply