Skip to main content

I just would like to convert CityGML files to json files. When checking the converted json file in the FME Data Inspector, I get the errors shown below. Maybe I missed some parameters during reading/writing. Thank you for your help!

These errors are shown when checking the json file:

CITYJSON reader: An error occurred. FME will attempt to provide more information on the error, but this may cause the translation to be terminated

Read Metadata Feature Command caught exception: stk::ex::FatalError

[0] CITYJSON reader: [json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal

[1] auto __cdecl STFReader::openDataSet::<lambda_45ec89e6ecf0932b901acf3bedceb848>::operator ()(void) const(C:\\code\\fme\\foundation\\framework\\engine\\reader.cpp:80)

 

My initial CityGML file:

Cool that you are trying this.

 

 

By going from CityGML to JSON are you meaning CityJSON? did you try out the new CityJSON writer?

Perhaps you can share your workspace and output CityJSON file.

 

 

Definitely looks like there is an issue somewhere there - but the CityGML looks ok

Thank you very much for your help. You are right, I haven't tried the new CityJSON writer. I tried to use it now in a second attempt, but I wasn't able to run a successful data conversion as I have problems with the 'fid' ("CityJSON features must have an attribute named 'fid' to uniquely identify them."). Unfortunately I couldn't figure out how to set this paremeter.

My workspace and log file:citygml2cityjson.fmw


Thank you very much for your help. You are right, I haven't tried the new CityJSON writer. I tried to use it now in a second attempt, but I wasn't able to run a successful data conversion as I have problems with the 'fid' ("CityJSON features must have an attribute named 'fid' to uniquely identify them."). Unfortunately I couldn't figure out how to set this paremeter.

My workspace and log file:citygml2cityjson.fmw

Ahh right - the fid is an attribute which need to be unique - like the gmlid for CityGML or oid for ESRI products.

 

 

I would use an AttributeManager to rename 'gml_id' to 'fid' for both the building and BuildingPart features. That would be the most simple option.

 

 

 


Reply