Question

Reading KML with Tracks


Badge

I am trying to read some kml files that were exported from Avenza PDF maps. The KMLs contain Lines, Points, and Tracks. I am able to read the lines and points just fine but the tracks are not output from the reader. Is there some way of exposing the Tracks?


12 replies

Badge +22
Can you post a sample of the output KML?

 

 

Badge

avalanche-paths-botreatment-map-008-w-plots.kml

Badge
Can you post a sample of the output KML?

 

 

I have uploaded one of the kml's containing several tracks

 

 

Userlevel 4

Based on your sample kml file, the tracks seem to be output as a Placemark feature, but they do not have any geometry. You can isolate them using a GeometryFilter and by connecting an Inspector to the Null geometry output.

In the Inspector, click on one of the <no schema> features and inspect the format attributes in the Feature Information window:

0684Q00000ArJesQAF.png

As you can see, the tracks have several attribute lists (some of them nested) that you'll have to expose manually in your workspace (AttributeExposer) and then also process manually.

Some of the attribute names you should (or could) expose include:

kml_gx_track_extendeddata_schemadata_gx_simplearraydata{}_name
kml_gx_track_extendeddata_schemadata_gx_simplearraydata{}_gx_value{}
kml_gx_track_gx_angles{}
kml_gx_track_gx_coord{}
kml_gx_track_when{}
kml_name
kml_parent

If you need to construct the track geometry, you will probably have to build the track line manually using the kml_gx_track_gx_coord{} list, e.g. using a combination of the ListExploder, AttributeSplitter and VertexCreator.

Badge

Based on your sample kml file, the tracks seem to be output as a Placemark feature, but they do not have any geometry. You can isolate them using a GeometryFilter and by connecting an Inspector to the Null geometry output.

In the Inspector, click on one of the <no schema> features and inspect the format attributes in the Feature Information window:

0684Q00000ArJesQAF.png

As you can see, the tracks have several attribute lists (some of them nested) that you'll have to expose manually in your workspace (AttributeExposer) and then also process manually.

Some of the attribute names you should (or could) expose include:

kml_gx_track_extendeddata_schemadata_gx_simplearraydata{}_name
kml_gx_track_extendeddata_schemadata_gx_simplearraydata{}_gx_value{}
kml_gx_track_gx_angles{}
kml_gx_track_gx_coord{}
kml_gx_track_when{}
kml_name
kml_parent

If you need to construct the track geometry, you will probably have to build the track line manually using the kml_gx_track_gx_coord{} list, e.g. using a combination of the ListExploder, AttributeSplitter and VertexCreator.

I'm still having trouble exposing any of the lists including the kml_gx_track_gx_coord{} list.  Its not in the format attributes dialog so I have tried to expose it with the AttributeExposer but when it gets to the ListExploder all features come out of the rejected port. I am assuming it is rejected because it is not finding the list.

 

 

Badge +22

That's because the first element in the coord list is not 0.

 

rename kml_gx_track_gx_coord to kml_gx_track_gx_coord{0} prior to exploding
Badge +22

Try the following workspace kml-extendedschema.fmw.

Badge

Thanks renaming kml_gx_track_gx_coord to kml_gx_track_gx_coord{0} prior to exploding was the ticket but the complete workbench was much appreciated!

Badge +3

Try the following workspace kml-extendedschema.fmw.

Without having seen this reply, I got to exactly the same solution! The only difference being that I was just using the more generic XML reader:

 

 

Userlevel 4
Badge +25

Looks like tracks aren't yet (officially) supported. It's already filed as PR#37822 - I'm going to add a link to this thread and increase the priority.

Hi Mark,

Could you confirm by when the feature PR37822 is officially supported in FME?

Thanks,

Ruchi

Userlevel 4
Badge +25

Hi Mark,

Could you confirm by when the feature PR37822 is officially supported in FME?

Thanks,

Ruchi

Not yet I'm afraid. I've added your details to the request so you are informed when it is done. I honestly don't know when that will be. If you have a solid business case for implementing this, then please let us know via either support (safe.com/support) or your sales contact/reseller.

 

Reply