Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into imgeo
Browse files Browse the repository at this point in the history
# Conflicts:
#	Bridge.cpp
#	Bridge.h
#	Building.h
#	Forest.cpp
#	Map3d.cpp
#	Map3d.h
#	Road.cpp
#	Separation.cpp
#	Terrain.cpp
#	TopoFeature.cpp
#	TopoFeature.h
#	Water.cpp
#	main.cpp
  • Loading branch information
Tom Commandeur committed Nov 23, 2016
1 parent 23b58c9 commit dbd0b2f
Show file tree
Hide file tree
Showing 20 changed files with 247 additions and 220 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if ( COMMAND cmake_policy )
endif()

# Boost
find_package( Boost REQUIRED locale)
find_package( Boost REQUIRED locale chrono)
if ( NOT Boost_FOUND )
message(SEND_ERROR "3dfier requires the Boost library")
return()
Expand Down Expand Up @@ -60,3 +60,5 @@ link_directories(${YamlCpp_LIBRARY_DIRS})
# Creating entries for target: 3dfier
add_executable( 3dfier main.cpp io.cpp Map3d.cpp TopoFeature.cpp Bridge.cpp Separation.cpp Building.cpp Road.cpp Terrain.cpp Forest.cpp Water.cpp geomtools.cpp)
target_link_libraries( 3dfier ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${BOOST_LIBRARIES} ${GDAL_LIBRARY} ${LIBLAS_LIBRARY} ${LASZIP_LIBRARY} ${YAMLCPP_LIBRARY} ${Boost_LIBRARIES})

install(TARGETS 3dfier DESTINATION bin)
15 changes: 6 additions & 9 deletions Forest.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
3dfier: takes 2D GIS datasets and "3dfies" to create 3D city models.
Copyright (C) 2015-2016 3D geoinformation research group, TU Delft
This file is part of 3dfier.
Expand All @@ -19,7 +19,7 @@
along with 3difer. If not, see <http://www.gnu.org/licenses/>.
For any information or further details about the use of 3dfier, contact
Hugo Ledoux
Hugo Ledoux
<[email protected]>
Faculty of Architecture & the Built Environment
Delft University of Technology
Expand All @@ -31,22 +31,19 @@

#include "TopoFeature.h"

class Forest : public TIN
{
class Forest: public TIN {
public:
Forest (char *wkt, std::string pid, int simplification, float innerbuffer, bool only_ground_points);
Forest(char *wkt, std::string pid, int simplification, float innerbuffer, bool only_ground_points);
bool lift();
bool add_elevation_point(double x, double y, double z, float radius, LAS14Class lasclass, bool lastreturn);
bool add_elevation_point(Point2 p, double z, float radius, LAS14Class lasclass, bool lastreturn);
std::string get_citygml();
std::string get_citygml_imgeo();
std::string get_mtl();
bool get_shape(OGRLayer * layer);
TopoClass get_class();
bool is_hard();
private:
static bool _use_ground_points_only;
static bool _use_ground_points_only;
};



#endif /* Forest_h */
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

# 3dfier

![](https://dl.dropboxusercontent.com/s/tojiay8cmomu2v5/Delft_3dfier-3.png)


Takes 2D GIS datasets (eg topographical datasets) and "3dfies" them (as in "making them three-dimensional") by lifting every polygon to 3D.
Takes 2D GIS datasets (e.g. 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 blocks, roads as smooth surfaces, etc.
Every polygon is triangulated (constrained Delaunay triangulation) and the lifted polygons are "stitched" together so that one digital surface model (DSM) is constructed.
Our aim is to obtain one DSM that is error-free, ie no intersecting triangles, no holes (the surface is watertight), where buildings are integrated in the surface, etc.
Our aim is to obtain one DSM that is error-free, i.e. no intersecting triangles, no holes (the surface is watertight), where buildings are integrated in the surface, etc.
This surface will then be used as input in simulation software for instance.

<a href="https://vimeo.com/181421237">This video</a> illustrates the process and what 3dfier is about.

The lifting options can be configured in the YAML file (`myconfig.yml`) provided.
Any 2D input (which should be a planar partition) can be used as input, and each class must be mapped to one of the following:

Expand All @@ -24,7 +25,7 @@ Any 2D input (which should be a planar partition) can be used as input, and each

It is possible to define new classes, although that would require a bit of programming.

Output is at this moment in either OBJ or CityGML (and CVS for buildings only, ie their ID and height (ground+roof) are output).
Output is at this moment in either OBJ or CityGML (and CSV for buildings only, i.e. their ID and height (ground+roof) are output in a tabular format).
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 very much a beta version, although it is in our opinion usable.
Expand All @@ -34,20 +35,20 @@ If you use it, feedback is very much appreciated.

We expect the LAS/LAZ to be classified according to the ASPRS Standard LIDAR Point Classes v1.4 (Table 4.9 of this [PDF](http://www.asprs.org/wp-content/uploads/2010/12/LAS_1-4_R6.pdf)), and at a minimum these should be defined:

- 0-1 : Created, never classified and/or Unclassified
- 2 : Ground
- 0-1: Created, never classified and/or unclassified
- 2: Ground
- 3-5: Vegetation

If the vegetation is not classified or not filtered out, then buildings will be taller and there will be artefacts in the terrain.
If the vegetation is not classified or not filtered out, then buildings might be taller and there might be artefacts in the terrain.

## Compiling
## Compiling Mac OS X/Linux

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

```
mkdir build && cd build
cmake ..
cmake ..
cmake ..
make
```

Expand All @@ -63,15 +64,21 @@ The dependencies that are necessary (under Mac we suggest using [Homebrew](http:
1. CGAL (`brew install cgal`)
4. yaml-cpp (`brew install yaml-cpp`)

## Compiling Windows 10 using Visual Studio

1. Download and install Boost precompiled binaries https://sourceforge.net/projects/boost/files/boost-binaries (`Visual Studio 2015, 64-bit; boost_1_62_0-msvc-14.0-64.exe`)
2. Download and install OSGeo4W64 https://trac.osgeo.org/osgeo4w/
3. Compile your own copies of Yaml-cpp and CGAL
4. Set the path to the include folders in `Project->C/C++->General->Additional Include Directories`
5. Set the path to the boost binaries in `Project->Linker->General->Additional Library Directories`
6. Set the path to other libraries in `Project->Linker->Input->Additional Dependencies`
7. Build solution

## To run:

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

In the folder `example_data` there is a small part of the [BGT datasets](http://www.kadaster.nl/web/Themas/Registraties/BGT.htm) (2D 1:1k topographic datasets of the Netherlands) and a part of the [AHN3 LIDAR dataset](https://www.pdok.nl/nl/ahn3-downloads) that can be used for testing.
The resulting model (in OBJ) can be seen in `example_data/output/test_area.obj`



## Test data


In the folder `example_data` there is a small part of the [BGT datasets](http://www.kadaster.nl/web/Themas/Registraties/BGT.htm) (2D 1:1k topographic datasets of the Netherlands), and a part of the [AHN3 LIDAR dataset](https://www.pdok.nl/nl/ahn3-downloads) that can be used for testing.
The resulting model (in OBJ) can be found in `example_data/output/test_area.obj`
14 changes: 5 additions & 9 deletions Road.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
3dfier: takes 2D GIS datasets and "3dfies" to create 3D city models.
Copyright (C) 2015-2016 3D geoinformation research group, TU Delft
This file is part of 3dfier.
Expand All @@ -19,26 +19,23 @@
along with 3difer. If not, see <http://www.gnu.org/licenses/>.
For any information or further details about the use of 3dfier, contact
Hugo Ledoux
Hugo Ledoux
<[email protected]>
Faculty of Architecture & the Built Environment
Delft University of Technology
Julianalaan 134, Delft 2628BL, the Netherlands
*/


#ifndef Road_h
#define Road_h

#include "TopoFeature.h"


class Road : public Boundary3D
{
class Road: public Boundary3D {
public:
Road (char *wkt, std::string pid, float heightref);
Road(char *wkt, std::string pid, float heightref);
bool lift();
bool add_elevation_point(double x, double y, double z, float radius, LAS14Class lasclass, bool lastreturn);
bool add_elevation_point(Point2 p, double z, float radius, LAS14Class lasclass, bool lastreturn);
std::string get_citygml();
std::string get_citygml_imgeo();
std::string get_mtl();
Expand All @@ -48,5 +45,4 @@ class Road : public Boundary3D
bool is_hard();
};


#endif /* Road_h */
13 changes: 5 additions & 8 deletions Separation.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
3dfier: takes 2D GIS datasets and "3dfies" to create 3D city models.
Copyright (C) 2015-2016 3D geoinformation research group, TU Delft
This file is part of 3dfier.
Expand All @@ -19,25 +19,23 @@
along with 3difer. If not, see <http://www.gnu.org/licenses/>.
For any information or further details about the use of 3dfier, contact
Hugo Ledoux
Hugo Ledoux
<[email protected]>
Faculty of Architecture & the Built Environment
Delft University of Technology
Julianalaan 134, Delft 2628BL, the Netherlands
*/


#ifndef Separation_h
#define Separation_h

#include "TopoFeature.h"

class Separation : public Flat
{
class Separation: public Flat {
public:
Separation(char *wkt, std::string pid, float heightref);
Separation(char *wkt, std::string pid, float heightref);
bool lift();
bool add_elevation_point(double x, double y, double z, float radius, LAS14Class lasclass, bool lastreturn);
bool add_elevation_point(Point2 p, double z, float radius, LAS14Class lasclass, bool lastreturn);
std::string get_citygml();
std::string get_citygml_imgeo();
std::string get_mtl();
Expand All @@ -48,5 +46,4 @@ class Separation : public Flat
static float _heightref;
};


#endif /* Separation_h */
14 changes: 5 additions & 9 deletions Terrain.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
3dfier: takes 2D GIS datasets and "3dfies" to create 3D city models.
Copyright (C) 2015-2016 3D geoinformation research group, TU Delft
This file is part of 3dfier.
Expand All @@ -19,25 +19,23 @@
along with 3difer. If not, see <http://www.gnu.org/licenses/>.
For any information or further details about the use of 3dfier, contact
Hugo Ledoux
Hugo Ledoux
<[email protected]>
Faculty of Architecture & the Built Environment
Delft University of Technology
Julianalaan 134, Delft 2628BL, the Netherlands
*/


#ifndef Terrain_h
#define Terrain_h

#include "TopoFeature.h"

class Terrain : public TIN
{
class Terrain: public TIN {
public:
Terrain (char *wkt, std::string pid, int simplification, float innerbuffer);
Terrain(char *wkt, std::string pid, int simplification, float innerbuffer);
bool lift();
bool add_elevation_point(double x, double y, double z, float radius, LAS14Class lasclass, bool lastreturn);
bool add_elevation_point(Point2 p, double z, float radius, LAS14Class lasclass, bool lastreturn);
std::string get_citygml();
std::string get_mtl();
std::string get_citygml_imgeo();
Expand All @@ -46,6 +44,4 @@ class Terrain : public TIN
bool is_hard();
};



#endif /* Terrain_h */
14 changes: 5 additions & 9 deletions Water.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
3dfier: takes 2D GIS datasets and "3dfies" to create 3D city models.
Copyright (C) 2015-2016 3D geoinformation research group, TU Delft
This file is part of 3dfier.
Expand All @@ -19,26 +19,23 @@
along with 3difer. If not, see <http://www.gnu.org/licenses/>.
For any information or further details about the use of 3dfier, contact
Hugo Ledoux
Hugo Ledoux
<[email protected]>
Faculty of Architecture & the Built Environment
Delft University of Technology
Julianalaan 134, Delft 2628BL, the Netherlands
*/



#ifndef Water_h
#define Water_h

#include "TopoFeature.h"

class Water : public Flat
{
class Water: public Flat {
public:
Water(char *wkt, std::string pid, float heightref);
Water(char *wkt, std::string pid, float heightref);
bool lift();
// bool add_elevation_point(double x, double y, double z, float radius, LAS14Class lasclass, bool lastreturn);
bool add_elevation_point(Point2 p, double z, float radius, LAS14Class lasclass, bool lastreturn);
std::string get_citygml();
std::string get_citygml_imgeo();
std::string get_mtl();
Expand All @@ -49,5 +46,4 @@ class Water : public Flat
static float _heightref;
};


#endif /* Water_h */
41 changes: 0 additions & 41 deletions cmake/Modules/FindTriangle.cmake

This file was deleted.

Loading

0 comments on commit dbd0b2f

Please sign in to comment.