Skip to main content

Hello,

I'm trying to split a CityGML file into multiple OBJ files based on gml_id. For exemple I have a gml_id like this : "BU_69381A"(A to Z)"39" and I want to split at every letter in brackets.

Do you have an idea of how to do this?

Thank you in advance!

Use a StringSearcher and regular expression on the gml_id:

\D{2}_\d{5}(\D)

Explanation:

\D{2} = 2 letters - not digits = BU
_ = underscore = _
\d{5} = 5 digits = 69381
(\D) = any letters at the end of the string = A 

All data within () will be saved in a list

 

Can be tested here: rubular.com

0684Q00000ArKjlQAF.png

 


Use a StringSearcher and regular expression on the gml_id:

\D{2}_\d{5}(\D)

Explanation:

\D{2} = 2 letters - not digits = BU
_ = underscore = _
\d{5} = 5 digits = 69381
(\D) = any letters at the end of the string = A 

All data within () will be saved in a list

 

Can be tested here: rubular.com

0684Q00000ArKjlQAF.png

 

This is exactly what I need, thanks @sigtill!

And after how to separate each building letters in 26 OBJ files according to the StringSearcher result? With a Tiler?


This is exactly what I need, thanks @sigtill!

And after how to separate each building letters in 26 OBJ files according to the StringSearcher result? With a Tiler?

Use "fanout" on the writer according to this new attribute. Fanout is described here: https://knowledge.safe.com/articles/565/fanout-1.html


This is exactly what I need, thanks @sigtill!

And after how to separate each building letters in 26 OBJ files according to the StringSearcher result? With a Tiler?

If your CityGML has textures/appearances you might need to be a little careful and put each obj in a separate folder. FME will create a materials file on the same level as the obj so if you write all your objs to the same directory then each time the material file will get overwritten, losing the Information. Just a heads up

Use "fanout" on the writer according to this new attribute. Fanout is described here: https://knowledge.safe.com/articles/565/fanout-1.html

It works perfectly, thank you very much @sigtill!


If your CityGML has textures/appearances you might need to be a little careful and put each obj in a separate folder. FME will create a materials file on the same level as the obj so if you write all your objs to the same directory then each time the material file will get overwritten, losing the Information. Just a heads up

Thanks for the information @virtualcitymatt!


Reply