Skip to content

aninggo/3dfier

 
 

Repository files navigation

3dfier

Takes 2D GIS datasets (eg topographical datasets) and "3dfies" them (as in "making them three-dimensional") by lifting every polygon to 3D. The elevation is obtained from a point cloud (we support LAS/LAZ at this moment), and the semantics of every polygon is used to perform the lifting. That is, water polygons are extruded to horizontal polygons, buildings to LOD1, roads , etc. Every polygon is triangulated (constrained Delaunay triangulation) and the lifted polygons are "stitched" together so that one digital surface model (DSM) is constructed.

The lifting options can be configured in the YAML file (myconfig.yml) provided.

Output is at this moment in either OBJ or CityGML (and CVS for buildings only, ie their ID and height (ground+roof) are output). The ID of each polygon is preserved, and there is a 1-to-1 mapping between the input and the output.

Notice that this version is early alpha, and shouldn't really be used for anything except for testing.

Compiling

To build you'll normally do (from 3dfier root directory):

mkdir build && cd build
cmake ..
make

And on ubuntu systems that come with GDAL 2, make sure the libgdal1-dev package is installed and replace cmake .. with

cmake .. -DGDAL_CONFIG=/bin/gdal-config -DGDAL_LIBRARY=/usr/lib/libgdal.so -DGDAL_INCLUDE_DIR=/usr/include/gdal

To run:

$ ./3dfier myconfig.yml > output.obj

Dependencies:

Under Mac OSX they can all be installed with Homebrew.

  1. LIBLAS with LASzip support (brew install liblas --with-laszip)
  2. GDAL (brew install gdal)
  3. Boost (brew install boost)
  4. yaml-cpp (brew install yaml-cpp)
  5. Shewchuk's Triangle (brew install homebrew/science/triangle)

Data

The first application is to create a 3D version of TOP10NL. Get (2D) TOP10NL there:

Notice that OGR will not read it properly, it needs to be preprocessed with nlextract.

The LiDAR dataset AHN3 can be freely downloaded.

About

Takes 2D GIS datasets and "3dfies" them by lifting each polygon to its height (obtained with LiDAR)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 91.8%
  • CMake 5.5%
  • Python 2.6%
  • Batchfile 0.1%