Question

extracting information from different folders in KML to convert to the shapefile

  • 21 August 2020
  • 7 replies
  • 25 views

Hi All,

 

I have a KML data which has many folder . Each folder is having different set of geometry eg route1 ,route 2 with other attributes . also each folder has unique number which i want to link to route information . herewith i have attached the screen shot of the KML highlighting the information which i am trying to fetch . Also attaching the KML file .

 

 

 

Things i have tried :

 

i mange to do the geometry extraction with KML description for each route but unable to link the route to the folder number .

 

 

 

Any suggestion on this ?

 

Thank you in advance.


7 replies

Userlevel 4
Badge +30

Hi @gis2020​ 

I exposed into your Reader the format attribute kml_name.

I used too the transformer HTMLToXHTMLConverter for extract description.

The transformer TesterFilter was used for separate the kml_name:

  • Route1
  • Route2
  • Others

 

Thanks in Advance,

Danilo

Userlevel 4
Badge +30

Hi @gis2020​ 

I exposed into your Reader the format attribute kml_name.

I used too the transformer HTMLToXHTMLConverter for extract description.

The transformer TesterFilter was used for separate the kml_name:

  • Route1
  • Route2
  • Others

 

Thanks in Advance,

Danilo

Workspace_KML

Userlevel 6
Badge +33

The Features with featuretype Folder have the attributes kml_id and kml_parent.

You can see those in the Inspector when you select a feature and check the Feature Information window. Use an AttributeExposer to expose them. .

With these attributes you should be able to rebuild the folder structure.

Workspace_KML

Image 4@danilo_fme​ i have tried this but this doen't give me the folder name/number for routes .

The Features with featuretype Folder have the attributes kml_id and kml_parent.

You can see those in the Inspector when you select a feature and check the Feature Information window. Use an AttributeExposer to expose them. .

With these attributes you should be able to rebuild the folder structure.

@nielsgerrits​ i have tried this option also but there is definite link between the folder and routes . as KML_id are different for each description line .

eg kml_id_batch_b_1_IDN_1.1.13 for folder and kml_id_batch_b_1_IDN_1.1.13.3 and kml_id_batch_b_1_IDN_1.1.13.4 for routes . Also there is no consistency of numbering.

Userlevel 6
Badge +33

@nielsgerrits​ i have tried this option also but there is definite link between the folder and routes . as KML_id are different for each description line .

eg kml_id_batch_b_1_IDN_1.1.13 for folder and kml_id_batch_b_1_IDN_1.1.13.3 and kml_id_batch_b_1_IDN_1.1.13.4 for routes . Also there is no consistency of numbering.

  • Folder "515552200" has id kml_id_batch_2_1.1.13 and parent kml_id_batch_2_1.1
  • Folder "Route1" has id kml_id_batch_2_1.1.13.3 and parent kml_id_batch_2_1.1.13
  • Placemark "Route1" has id kml_2 and parent kml_id_batch_2_1.1.13.3 and kml_description POS=0 DL=0 NEG=21 DL=20

The numbering is structured by points. Every point is a level deeper.

What I would do:

  • Determine the max number of levels.
  • Use BulkAttributeRenamers to add prefixes like Level1,Level2,etc to the attributenames. (Split features using the number of points in each id.)
  • User FeatureMergers to add the parent to each child, starting with the deepest level and work you way up.

@nielsgerrits​ i have tried this option also but there is definite link between the folder and routes . as KML_id are different for each description line .

eg kml_id_batch_b_1_IDN_1.1.13 for folder and kml_id_batch_b_1_IDN_1.1.13.3 and kml_id_batch_b_1_IDN_1.1.13.4 for routes . Also there is no consistency of numbering.

@nielsgerrits​ that's what exactly i am doing now . i am extracting the parent from the child eg 2_1.1.13 and then i am going to match it with folder parent.

Reply