Software for generating the 3D BAG
For creating the 3D BAG we wrote bag3d, which is an application that uses 3dfier for extruding the building footprints to LoD1 models. It is designed to run regularly as an automated process (eg. with a cron job), hence keeping the 3D BAG in line with the BAG updates. It is a multithreaded application, and it can process the whole Netherlands in a reasonable amount of time.
In short, the bag3d application can:
- Download and restore a BAG PostgreSQL backup from NLExtract.
- Download all the available AHN3 files and the tile index. When new tiles are available, download only those that are not stored locally. Additionally, append the AHN file creation date to each tile in the index.
- Import the tile indices for BAG and AHN to a PostgreSQL database and partition the BAG.
- Run several 3dfier jobs in parallel to process the given tiles. Currently the 3dfication output is attached to the 2D polygons as height attributes and the results are stored in the database.
- Export into CSV, GeoPackage or PostgreSQL backup.
- Report various quality metrics.
Although bag3d was made for the Dutch BAG data set (as its name implies), it started out as a more generic application, batch3dfier. Keeping the original spirit, we wrote an extensive documentation for bag3d so hopefully it will be is easier to adapt bag3d to other data sets.