Skip to main content
Question

Split a CityGML file based on gml_id

  • November 21, 2019
  • 6 replies
  • 45 views

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!

6 replies

sigtill
Contributor
Forum|alt.badge.img+24
  • Contributor
  • November 21, 2019

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

 


  • Author
  • November 21, 2019
sigtill wrote:

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?


sigtill
Contributor
Forum|alt.badge.img+24
  • Contributor
  • November 21, 2019
sebeauvoir wrote:

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


virtualcitymatt
Celebrity
Forum|alt.badge.img+34
sebeauvoir wrote:

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

  • Author
  • November 21, 2019
sigtill wrote:

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!


  • Author
  • November 21, 2019
virtualcitymatt wrote:
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


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