I have a set of the CityGML data (LoD2). I have to add the missing ground floor layer “building footprint”. Also, repair other errors in the geometry. Is there an automatic way to do that?
Hi @susan,
Have a look at the GeometryValidator transformer for fixing geometry issues.
For the missing GroundSurface, if you have the building footprint as a shapefile/other format then you can add these to the CityGML Building by assigning them the correct gml_parent_id. The gml_parent_id should match the gml_id of the building.
Writing out CityGML can be very complicated with FME. Here is the tutorial for how you can get started on it. https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/citygml/Tutorial/writing_citygml_from_fme.htm
And as @itay has suggested the GeometryValidator can fix errors with the geometries, however, it will not fix other issues which are specific to the CityGML structure but it is the best place to start.
Some things which can't easily be done with FME which are specific to CityGML are things like removing internal surfaces, ensuring that all surfaces are oriented correctly, creating xlinks between the lod2solids and Wall, Ground and Roof Surfaces.
For the missing GroundSurface, if you have the building footprint as a shapefile/other format then you can add these to the CityGML Building by assigning them the correct gml_parent_id. The gml_parent_id should match the gml_id of the building.
Writing out CityGML can be very complicated with FME. Here is the tutorial for how you can get started on it. https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/citygml/Tutorial/writing_citygml_from_fme.htm
And as @itay has suggested the GeometryValidator can fix errors with the geometries, however, it will not fix other issues which are specific to the CityGML structure but it is the best place to start.
Some things which can't easily be done with FME which are specific to CityGML are things like removing internal surfaces, ensuring that all surfaces are oriented correctly, creating xlinks between the lod2solids and Wall, Ground and Roof Surfaces.
Listen to @virtualcitymatt, he knows his CityGML...
@ virtualcitymatt and @itay thanks for your comments! I tried to create the GML file for the GroundSurface from the shapefile and connected it few samples to the existing CityGML file. but the data spatial allocation is not consistent, although, I unified the projection system of both databases. In other words, I have to find a way to parse the lower coordinate of the wall surfaces and added to the existing CityGML file.
As for the validate geometry by FME, I used it, However, this didn't change the validation result that I processed it by CityDoctor. Kindly see the summary of the error reports:
Before Running GeometryVlidator by FME
Error Total: C_BS_COPLANAR_SURFACES = 3275 CP_SELFINT = 2 CS_CONCOMP = 1 CS_SELFINTNATIVE = 53 CP_PLANNATIVE = 6
C_BNBPIFSOLID = 704 CS_FACEORIENT = 36 CS_NUMFACES = 1 CS_OUTEREDGE = 3115
After Running GeometryVlidator by FME
Error Total: C_BNBPIFSOLID = 704 CS_SELFINTNATIVE = 53 CS_FACEORIENT = 36 CS_CONCOMP = 1 CS_NUMFACES = 1
CP_SELFINT = 2 CP_PLANNATIVE = 6 C_BS_COPLANAR_SURFACES = 3275 CS_OUTEREDGE = 3115
Any other suggestions?
@ virtualcitymatt and @itay thanks for your comments! I tried to create the GML file for the GroundSurface from the shapefile and connected it few samples to the existing CityGML file. but the data spatial allocation is not consistent, although, I unified the projection system of both databases. In other words, I have to find a way to parse the lower coordinate of the wall surfaces and added to the existing CityGML file.
As for the validate geometry by FME, I used it, However, this didn't change the validation result that I processed it by CityDoctor. Kindly see the summary of the error reports:
Before Running GeometryVlidator by FME
Error Total: C_BS_COPLANAR_SURFACES = 3275 CP_SELFINT = 2 CS_CONCOMP = 1 CS_SELFINTNATIVE = 53 CP_PLANNATIVE = 6
C_BNBPIFSOLID = 704 CS_FACEORIENT = 36 CS_NUMFACES = 1 CS_OUTEREDGE = 3115
After Running GeometryVlidator by FME
Error Total: C_BNBPIFSOLID = 704 CS_SELFINTNATIVE = 53 CS_FACEORIENT = 36 CS_CONCOMP = 1 CS_NUMFACES = 1
CP_SELFINT = 2 CP_PLANNATIVE = 6 C_BS_COPLANAR_SURFACES = 3275 CS_OUTEREDGE = 3115
Any other suggestions?
Can you supply a sample? that would make it much easier to assist.
@ virtualcitymatt and @itay thanks for your comments! I tried to create the GML file for the GroundSurface from the shapefile and connected it few samples to the existing CityGML file. but the data spatial allocation is not consistent, although, I unified the projection system of both databases. In other words, I have to find a way to parse the lower coordinate of the wall surfaces and added to the existing CityGML file.
As for the validate geometry by FME, I used it, However, this didn't change the validation result that I processed it by CityDoctor. Kindly see the summary of the error reports:
Before Running GeometryVlidator by FME
Error Total: C_BS_COPLANAR_SURFACES = 3275 CP_SELFINT = 2 CS_CONCOMP = 1 CS_SELFINTNATIVE = 53 CP_PLANNATIVE = 6
C_BNBPIFSOLID = 704 CS_FACEORIENT = 36 CS_NUMFACES = 1 CS_OUTEREDGE = 3115
After Running GeometryVlidator by FME
Error Total: C_BNBPIFSOLID = 704 CS_SELFINTNATIVE = 53 CS_FACEORIENT = 36 CS_CONCOMP = 1 CS_NUMFACES = 1
CP_SELFINT = 2 CP_PLANNATIVE = 6 C_BS_COPLANAR_SURFACES = 3275 CS_OUTEREDGE = 3115
Any other suggestions?
Yeah a sample would help for sure here, however, one other trick could be to use the SurfaceFootprintReplacer to create the ground surface. You can try aggregating the Wall and Roof Surfaces together (Group by gml_parent_id), use the bounds extractor to get the _zmin of the aggregates and then use the SurfaceFootprintReplacer using the _zmin attribute as the Elevation. This will get you a matching GroundSurface for each building. This could result in some odd artifacts in the case for buildings with donuts so be sure to check these cases.
Also the GeometryValidator in FME can also try to repair things, I think it should be called GeometryRepairer...Sometimes not everything get repaired and you need to run the same geometry through several GeometryValidators.
Also with CityDoctor is there anyway to set the precision on checks? Typically FME has a very high precision wich is way too much here. In many cases the coordinates might be nanometers off, if you can revalidate with only 3 decimal places you might get better results. I would recommend working with 3 decimal precision to anyone working with CityGML. Check out the CoordinateRounder to help with setting the data here - just be sure that you don't do any geometry changes after rounding (buffer/reprojection) or you will be back where you started.