Closed robhawkes closed 8 years ago
Thanks for this report and for trying the code. I intend to work on improving the converter to support CityGML 1.0, and also to improve the detection of the invalid geometries to avoid such crashes. The error that you have experienced has likely been caused by invalid geometry in the dataset, which is not surprising considering that public datasets are usually full of invalid geometries. The built-in geometry validator is a basic one, and in some public datasets I have encountered nastier errors that cause the embedded triangulator to crash (sometimes also with a C error that cannot be excepted in Python). However, that's not an excuse not to improve this converter to detect them better and skip them. I will come back to you in a few weeks.
Thanks for the update Filip! This is a great tool and it will be very useful for myself and the people who use ViziCities and other services that I work on that utilise CityGML models.
If it helps, the same CityGML models that fail converting using CityGML2OBJs actually import into 3DCityDB ok and can be exported out as collada models. Perhaps 3DCityDB fixes broken geometry as I noticed it had detected polygons without an endpoint and used the start point to create a new one. I suppose in this case, it's more useful to fix the geometry if we can than it is to just detect and ignore it (especially if the errors are common and known).
Same issue here with data from http://suche.transparenz.hamburg.de/dataset/3d-stadtmodell-hamburg using a re-written header.
Here is an example file (with the header for 2.0, hopefully correct): http://pastebin.com/FPMpgrga (https://www.govdata.de/dl-de/by-2-0)
Noted, thanks for the report. It seems that the demand for solving this shortcoming is increasing, so I'll investigate and work on it as soon as I'll have time.
Hello,
Sorry for the long break, busy times. I've worked on solving the errors which you have encountered. Probably you've already managed to convert the data with some other utility (I also know that Rob has been developing his tool). If you are interested, I've updated the code, and while it still has some hiccups and it returns errors in some files, many data sets that previously didn't work are now supported. The code now works with CityGML 1.0. I tried it with Rotterdam, Lyon, and Hamburg (see the picture below). Let me know of data sets that do not work, so I'll take a look.
I've been trying to convert the CityGML models listed by yourselves on the CityGML wiki but have had no luck to date. I assumed it was because they are using version 1.0 of CityGML, but even when changing the schema to 2.0 the converter crashes.
Here's an example crash (the others fail at the same point when changed to a 2.0 schema):
I don't know much about CityGML but the geometry seems ok and the fact that this occurs for all the real cities I've tried makes me think that it's either some part of the 1.0 schema that I've missed, or there's an issue converting these files at the moment. For the record, the converter works fine for the random CityGML data generator you created.
Can you enlighten me on whether this is indeed an issue because of 1.0 (and what specifically might be causing it), or whether there is something else going wrong? I'd be happy to try and fix it but I don't know what I'm looking for right now (I'm new to CityGML).