Skip to main content
Question

KML writer - missing values


Forum|alt.badge.img

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

david_r
Evangelist
  • November 22, 2018

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.


Forum|alt.badge.img
  • Author
  • November 22, 2018

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.


david_r
Evangelist
  • November 22, 2018

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


Forum|alt.badge.img
  • Author
  • November 22, 2018

Here one is joiner.zip


david_r
Evangelist
  • November 22, 2018

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?


david_r
Evangelist
  • November 22, 2018

Here's from importing the KML in Google Earth:


Forum|alt.badge.img
  • Author
  • November 22, 2018

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

 


david_r
Evangelist
  • November 22, 2018

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.


Forum|alt.badge.img
  • Author
  • November 22, 2018

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


david_r
Evangelist
  • November 22, 2018
ianashley wrote:

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.


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • November 22, 2018

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.


Forum|alt.badge.img
  • Author
  • November 26, 2018
daveatsafe wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings