Skip to content

Commit 5350e48

Browse files
committed
Merge branch 'develop'
2 parents 07b1c3c + e54816f commit 5350e48

File tree

203 files changed

+31746
-4103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+31746
-4103
lines changed

CMakeLists.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ if(COMMAND cmake_policy)
33
cmake_policy(SET CMP0011 NEW)
44
endif(COMMAND cmake_policy)
55

6+
cmake_minimum_required (VERSION 3.16)
67
project( val3dity )
78

8-
cmake_minimum_required (VERSION 3.16)
99

1010

1111
add_definitions(-std=c++14)
@@ -51,9 +51,7 @@ if ( NOT Boost_FOUND )
5151
endif()
5252

5353
# GEOS
54-
find_package( GEOS REQUIRED CONFIG)
55-
# if linux complains:
56-
# find_package( GEOS )
54+
find_package( GEOS REQUIRED )
5755
if ( NOT GEOS_FOUND )
5856
message(SEND_ERROR "val3dity requires the GEOS library")
5957
endif()
@@ -62,16 +60,16 @@ include_directories( ${GEOS_INCLUDE_DIR} )
6260
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty )
6361

6462
FILE(GLOB_RECURSE THIRDPARTY thirdparty/*.cpp)
65-
add_library(thirdparty STATIC ${THIRDPARTY})
63+
add_library(val3dity_thirdparty STATIC ${THIRDPARTY})
6664

6765
FILE(GLOB SRC_FILES src/*.cpp)
6866

69-
if ( LIBRARY )
67+
if ( VAL3DITY_LIBRARY )
7068
message(STATUS "Building val3dity library")
7169
list(REMOVE_ITEM SRC_FILES src/main.cpp)
7270
add_library(val3dity STATIC ${SRC_FILES})
7371
target_include_directories(val3dity PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
74-
set_property(TARGET thirdparty PROPERTY POSITION_INDEPENDENT_CODE ON)
72+
set_property(TARGET val3dity_thirdparty PROPERTY POSITION_INDEPENDENT_CODE ON)
7573
set_property(TARGET val3dity PROPERTY POSITION_INDEPENDENT_CODE ON)
7674
else()
7775
message(STATUS "Building val3dity executable")
@@ -80,8 +78,6 @@ else()
8078
endif()
8179

8280

83-
target_link_libraries(val3dity CGAL::CGAL CGAL::Eigen3_support GEOS::geos_c thirdparty Boost::filesystem)
84-
# if linux complains:
85-
# target_link_libraries(val3dity CGAL::CGAL CGAL::Eigen3_support ${GEOS_LIBRARY} thirdparty Boost::filesystem)
81+
target_link_libraries(val3dity CGAL::CGAL CGAL::Eigen3_support ${GEOS_LIBRARY} val3dity_thirdparty Boost::filesystem)
8682

8783
install(TARGETS val3dity DESTINATION bin)

Dockerfile

Lines changed: 0 additions & 115 deletions
This file was deleted.

README.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# val3dity
55

66
val3dity---pronounced 'val-three-dity'---allows us to validate 3D primitives according to the international standard ISO19107.
7-
Think of it as [PostGIS ST_IsValid](http://postgis.net/docs/ST_IsValid.html), but for 3D primitives (PostGIS only validates 2D primitives).
7+
Think of it as [PostGIS ST_IsValid](http://postgis.net/docs/ST_IsValid.html), but for 3D primitives.
88

9-
In short, it verifies whether a 3D primitive respects the definition as given in [ISO19107](http://www.iso.org/iso/catalogue_detail.htm?csnumber=26012) and [GML](https://en.wikipedia.org/wiki/Geography_Markup_Language).
9+
In short, it verifies whether a 3D primitive respects the definition as given in [ISO19107](https://www.iso.org/standard/66175.html).
1010

1111
The validation of the following 3D primitives is fully supported:
1212

@@ -17,13 +17,14 @@ The validation of the following 3D primitives is fully supported:
1717
- ``CompositeSolid``
1818

1919
Unlike many other validation tools in 3D GIS, inner rings in polygons/surfaces are supported and so are cavities in solids (also called voids or inner shells).
20+
2021
However, as is the case for many formats used in practice, only planar and linear primitives are allowed: no curves or spheres or other parametrically-modelled primitives are supported.
2122
There is no plan to support these geometries.
2223

2324
val3dity accepts as input:
2425

2526
- [CityJSON](http://www.cityjson.org)
26-
- [CityJSON Lines (CityJSONL)](https://www.cityjson.org/specs/#text-sequences-and-streaming-with-cityjsonfeature)
27+
- [CityJSON Sequences (CityJSONSeq)](https://www.cityjson.org/cityjsonseq/)
2728
- [tu3djson](https://github.com/tudelft3d/tu3djson)
2829
- [JSON-FG (OGC Features and Geometries JSON)](https://github.com/opengeospatial/ogc-feat-geo-json)
2930
- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)
@@ -33,22 +34,6 @@ val3dity accepts as input:
3334
For the CityJSON and IndoorGML formats, extra validations are performed (specific to the format), eg the overlap between different parts of a building, or the validation of the navigation graph in IndoorGML.
3435

3536

36-
## Usage
37-
38-
val3dity is a command-line interface (CLI) programme only, with [several options](https://val3dity.readthedocs.io/en/latest/usage/#options-for-the-validation).
39-
40-
[![val3dity cli demo](./misc/cli.svg)](https://asciinema.org/a/329835)
41-
_No demo visible here? View it on [asciinema](https://asciinema.org/a/329835)._
42-
43-
44-
## Web application
45-
46-
If you don't want to go through the troubles of compiling and/or installing val3dity, we suggest you use the [web application](http://geovalidation.bk.tudelft.nl/val3dity).
47-
Simply upload your file to our server and get a validation report back.
48-
We delete the file as soon as it has been validated (promised!).
49-
However, a file is limited to 50MB.
50-
51-
5237
## Installation of the command-line tool
5338

5439
### macOS
@@ -81,7 +66,7 @@ and then
8166
$ make
8267

8368

84-
### linux
69+
### Linux
8570

8671
Under Linux (at least Ubuntu), CGAL has to be compiled because apt-get doesn't give you a version with Eigen.
8772
Thus, in a nutshell,
@@ -98,45 +83,52 @@ Thus, in a nutshell,
9883
For Windows, we offer [an executable](https://github.com/tudelft3d/val3dity/releases).
9984

10085
It's also possible to compile val3dity yourself with the CMake file we offer, but it's slightly more complex with the dependencies.
101-
We suggest you look at [how we build it on GitHub Actions](https://github.com/tudelft3d/val3dity/blob/main/.github/workflows/build_exe.yml) to get some inspirate (and help).
86+
We suggest you look at [how we build it on GitHub Actions](https://github.com/tudelft3d/val3dity/blob/main/.github/workflows/build_exe.yml) to get some inspiration (and help).
10287

10388

10489
## Usage
10590

106-
To compile and run val3dity (from the val3dity folder):
91+
To run val3dity:
10792

108-
$ ./val3dity /data/cityjson/cube.json
93+
val3dity ./data/cityjson/cube.json
10994

11095
The summary of the validation is reported, and you should see that `cube.json` contains one valid primitive.
11196

11297
Finally, to see all the options possible:
11398

114-
$ ./val3dity --help
99+
val3dity --help
115100

101+
To validate a [CityJSONSeq stream](https://www.cityjson.org/cityjsonseq/), you need to pipe the stream into val3dity and use ``stdin`` for the input.
102+
If you have a CityJSONSeq serialised in a file, then you can cat it:
116103

117-
## Using val3dity as a library
104+
cat myfile.city.jsonl | val3dity stdin
118105

119-
val3dity can be compiled as a library:
106+
The output shows, line by line, what the errors are.
107+
If the list of error is empty (``[]``) this means the feature is geometrically valid 🎉
120108

121-
$ cmake .. -DLIBRARY=true
122109

123-
There is a simple example in `./demo_lib` with instructions to compile it.
110+
## Using val3dity as a library
124111

112+
val3dity can be compiled and used as a library:
125113

126-
## Unit tests
114+
cmake .. -DVAL3DITY_LIBRARY=true
115+
116+
There is a simple example in `./demo_lib` with instructions to compile it.
127117

128-
To verify that everything went fine during the compilation, run the unit tests (from the root folder of val3dity) (this requires `pip install pytest pyyaml`):
129118

130-
$ python -m pytest --runfull
119+
## Web application
131120

132-
You shouldn't get any errors.
121+
If you don't want to go through the troubles of compiling and/or installing val3dity, we suggest you use the [web application](http://geovalidation.bk.tudelft.nl/val3dity).
122+
Simply upload your file to our server and get a validation report back.
123+
We delete the file as soon as it has been validated (promised!).
124+
However, a file is limited to 50MB.
133125

134126

135127
## Simple visualiser for the errors: viz3dity
136128

137129
![](./tools/viz3dity/screenshot.png)
138130

139-
In the folder `tools/viz3dity/`, there is a simple Python script where you load a CityJSON file with geometries and one with the val3dity report, and you can see which objects have specific errors (each error gets a colour).
131+
In the folder `tools/viz3dity/`, there is a simple Python script where you can load a CityJSON file with geometries and one with the val3dity report, and you can see which objects have specific errors (each error gets a colour).
140132

141133
However, it's not possible to see where in an object the error is (eg which surface is not planar).
142134
This tool helps to quickly visualise where the errors are in a large dataset, for instance a city.
@@ -151,7 +143,16 @@ If you have a question or came across a bug, please submit an issue there.
151143
However we ask you check first whether your problem has already been solved by someone else.
152144

153145

154-
## If you use val3dity in a scientific context, please cite these articles:
146+
## Unit tests
147+
148+
To verify that everything went fine during the compilation, run the unit tests (from the root folder of val3dity) (this requires `pip install pytest pyyaml`):
149+
150+
python -m pytest --runfull
151+
152+
You shouldn't get any errors, if you do then let us know by opening an issue.
153+
154+
155+
## If you use val3dity in a scientific context, please cite these two articles:
155156

156157
```bibtex
157158
@article{Ledoux18,

bumpver.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpver]
2-
current_version = "2.4.0"
2+
current_version = "2.5.0b2"
33
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
44
commit = false
55
tag = false

changelog.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@
33

44
## [Unreleased]
55
- validation of topological relationships between features, eg ensuring that buildings in a city do not overlap
6-
- support for all GML3 primitives (for IndoorGML): the so-called "Compact Geometries" (http://schemas.opengis.net/gml/3.3/geometryCompact.xsd)
6+
7+
8+
## [2.5.0] -
9+
### Added
10+
- val3dity now accepts a stream of CityJSONSeq as input from stdin: `cat myfile.jsonl | val3dity stdin` and it validates each line and outputs the result to stdout
11+
- a new error was added: error 905--INVALID_JSON for handling wrong JSON lines in a CityJSONSeq stream
12+
### Changed
13+
- the validation report in JSON has been greatly simplified. Now the errors are a flat list of errors and the "id" gives the position of the error in the feature.
14+
- the library/API has a new way to accept parameters for the validation (named parameters), it's more flexible and simpler to use. If you used v2.4 with defaults then nothing needs to be changed, if you passed them then a small change is required.
15+
- the library/API now accepts arrays of points/faces (including with inner-rings) as input
16+
- the library/API does not cout or clog anything anymore, so you can manage your own log without val3dity polluting it
17+
- the val3dity binary doesn't output to clog anymore, instead the logger "spdlog" is used (when `--verbose` is activated) and a few logs are output
18+
- the CMake should now compile directly on macOS/Linux/Windows if GEOS is installed on your machine
719

820

921
## [2.4.0] - 2023-06-27
@@ -97,3 +109,16 @@
97109
- CompositeSolid, MultiSolid
98110
- CityObjects in the report
99111
- support for CityJSON
112+
113+
114+
[2.5.0]: https://github.com/tudelft3d/val3dity/compare/2.4.0...2.5.0
115+
[2.4.0]: https://github.com/tudelft3d/val3dity/compare/2.3.1...2.4.0
116+
[2.3.1]: https://github.com/tudelft3d/val3dity/compare/2.3.0...2.3.1
117+
[2.3.0]: https://github.com/tudelft3d/val3dity/compare/2.2.0...2.3.0
118+
[2.2.0]: https://github.com/tudelft3d/val3dity/compare/2.1.1...2.2.0
119+
[2.1.1]: https://github.com/tudelft3d/val3dity/compare/2.1.0...2.1.1
120+
[2.1.0]: https://github.com/tudelft3d/val3dity/compare/2.0.4...2.1.0
121+
[2.0.4]: https://github.com/tudelft3d/val3dity/compare/2.0.3...2.0.4
122+
[2.0.3]: https://github.com/tudelft3d/val3dity/compare/2.0.2...2.0.3
123+
[2.0.2]: https://github.com/tudelft3d/val3dity/compare/2.0.1...2.0.2
124+
[2.0.1]: https://github.com/tudelft3d/val3dity/compare/2.0.0...2.0.1

cmake/FindGEOS.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ ELSE(WIN32)
7474

7575
IF (GEOS_CONFIG)
7676

77-
EXEC_PROGRAM(${GEOS_CONFIG}
78-
ARGS --version
77+
EXECUTE_PROCESS(COMMAND ${GEOS_CONFIG}
78+
--version
7979
OUTPUT_VARIABLE GEOS_VERSION)
8080
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" GEOS_VERSION_MAJOR "${GEOS_VERSION}")
8181
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" GEOS_VERSION_MINOR "${GEOS_VERSION}")
@@ -85,8 +85,8 @@ ELSE(WIN32)
8585
ENDIF (GEOS_VERSION_MAJOR LESS 3)
8686

8787
# set INCLUDE_DIR to prefix+include
88-
EXEC_PROGRAM(${GEOS_CONFIG}
89-
ARGS --prefix
88+
EXECUTE_PROCESS(COMMAND ${GEOS_CONFIG}
89+
--prefix
9090
OUTPUT_VARIABLE GEOS_PREFIX)
9191

9292
FIND_PATH(GEOS_INCLUDE_DIR
@@ -97,8 +97,8 @@ ELSE(WIN32)
9797
)
9898

9999
## extract link dirs for rpath
100-
EXEC_PROGRAM(${GEOS_CONFIG}
101-
ARGS --libs
100+
EXECUTE_PROCESS(COMMAND ${GEOS_CONFIG}
101+
--libs
102102
OUTPUT_VARIABLE GEOS_CONFIG_LIBS )
103103

104104
## split off the link dirs (for rpath)

0 commit comments

Comments
 (0)