Skip to content

Commit

Permalink
Merge branch 'release/v2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed May 14, 2020
2 parents 4b7f83c + 28aa15a commit ad6d666
Show file tree
Hide file tree
Showing 61 changed files with 2,784 additions and 2,055 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -36,6 +36,8 @@ x86/
/build
/buildx
/docs/_build
/docs/build


# Vagrant
.vagrant/
Expand All @@ -48,3 +50,6 @@ x86/
.settings/
/.cache
/buildx

.idea/
cmake-build-debug/
32 changes: 32 additions & 0 deletions .travis.yml
@@ -0,0 +1,32 @@
os: linux

language: cpp

services:
- docker

install: skip

script:
- echo "skipping tests"
- echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin
- docker pull tudelft3d/val3dity:latest || true
- docker build . --cache-from tudelft3d/val3dity:latest -t tudelft3d/val3dity:latest


deploy:
- provider: script
script: docker push tudelft3d/val3dity:latest
cleanup: false
on:
branch: master
- provider: script
script: docker tag tudelft3d/val3dity:latest tudelft3d/val3dity:dev ; docker push tudelft3d/val3dity:dev
cleanup: false
on:
branch: develop
- provider: script
script: docker tag tudelft3d/val3dity:latest tudelft3d/val3dity:${TRAVIS_TAG} ; docker push tudelft3d/val3dity:${TRAVIS_TAG}
cleanup: false
on:
tags: true
10 changes: 5 additions & 5 deletions CMakeLists.txt
Expand Up @@ -3,11 +3,10 @@ project( val3dity )

cmake_minimum_required (VERSION 3.2)

add_definitions(-std=c++11)
add_definitions(-std=c++14)

set(CMAKE_CXX_FLAGS "-O2")

set(CMAKE_BUILD_TYPE "Release")
set( CMAKE_BUILD_TYPE "Release")
set( CMAKE_CXX_FLAGS "-O2" )

set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )

Expand All @@ -20,7 +19,7 @@ if (MSVC)
endif(MSVC)

# CGAL
find_package( CGAL QUIET COMPONENTS core )
find_package( CGAL QUIET COMPONENTS )
if ( CGAL_FOUND )
include( ${CGAL_USE_FILE} )
message(STATUS "CGAL found")
Expand All @@ -35,6 +34,7 @@ endif()
find_package(Eigen3)
include( ${EIGEN3_USE_FILE} )


# Boost
find_package( Boost REQUIRED COMPONENTS filesystem)

Expand Down
115 changes: 115 additions & 0 deletions Dockerfile
@@ -0,0 +1,115 @@
FROM alpine:3.10
LABEL maintainer.email="b.dukai@tudelft.nl" maintainer.name="Balázs Dukai"

ENV CXX="g++ -std=c++98"

# Install geos
RUN apk --update add --virtual .geos-deps \
which \
make \
gcc \
g++ \
file \
git \
autoconf \
automake \
libtool && \
cd /tmp && \
git clone https://git.osgeo.org/gitea/geos/geos.git geos && \
cd geos && \
git checkout 3.7.1 && \
./autogen.sh && \
./configure && \
make && \
make check && \
make install && \
cd / && \
apk del .geos-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man

# install CGAL
RUN apk --update add --virtual .cgal-deps \
which \
make \
cmake \
gcc \
g++ \
eigen-dev \
boost-dev \
gmp-dev \
mpfr-dev \
zlib-dev && \
cd /tmp && \
wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-5.0.2/CGAL-5.0.2.tar.xz && \
tar xf CGAL-5.0.2.tar.xz && \
rm -f CGAL-5.0.2.tar.xz && \
cd CGAL-5.0.2 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_Eigen3=ON .. && \
make && \
make install && \
cd / && \
apk del .cgal-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man

# install val3dity
COPY . /tmp
RUN apk --update add --virtual .val3dity-deps \
make \
cmake \
gcc \
g++ \
boost-dev \
eigen-dev \
gmp-dev \
mpfr-dev \
python3 \
pytest \
py-yaml \
py-lxml \
py3-setuptools && \
cd /tmp && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install && \
cd .. &&\
ls -ls . && \
val3dity data/cityjson/cube.json && \
python3 -m pytest --runfull && \
apk del .val3dity-deps && \
cd / && \
apk --update add \
make \
gcc \
g++ \
boost \
eigen \
gmp \
bash \
mpfr3 && \
rm -rf /tmp/* && \
rm -rf /user/local/man

RUN mkdir /data && \
chown 1001 /data && \
chgrp 0 /data && \
chmod g=u /data && \
chgrp 0 /etc/passwd && \
chmod g=u /etc/passwd

RUN val3dity --version

COPY --chown=1001:0 uid_entrypoint.sh /usr/local/bin/

USER 1001

WORKDIR /data

ENTRYPOINT ["/usr/local/bin/uid_entrypoint.sh"]

CMD ["--version"]
101 changes: 71 additions & 30 deletions README.md
@@ -1,28 +1,52 @@

[![GitHub license](https://img.shields.io/github/license/tudelft3d/val3dity)](https://github.com/tudelft3d/val3dity/blob/master/LICENSE) [![webapp](https://img.shields.io/badge/webapp-geovalidation.bk.tudelft.nl%2Fval3dity%2F-fea93b)](http://geovalidation.bk.tudelft.nl/val3dity/) [![DOI](https://img.shields.io/badge/DOI-10.1186%2Fs40965--018--0043--x-blueviolet)](http://dx.doi.org/10.1186/s40965-018-0043-x)

# val3dity

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

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/CityGML.
All the 3D primitives of GML are supported:
In short, it verifies whether a 3D primitive respects the definition as given in [ISO 19107](http://www.iso.org/iso/catalogue_detail.htm?csnumber=26012) and [GML](https://en.wikipedia.org/wiki/Geography_Markup_Language).

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

- `<gml:MultiSurface>`
- `<gml:CompositeSurface>`
- `<gml:Solid>`
- `<gml:MultiSolid>`
- `<gml:CompositeSolid>`
- ``MultiSurface``
- ``CompositeSurface``
- ``Solid``
- ``MultiSolid``
- ``CompositeSolid``

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).
However, as is the case for CityGML, only planar and linear primitives are allowed: no curves or spheres or other parametrically-modelled primitives are supported. There is no plan to support these geometries, because val3dity is developed with 3D city models in focus.
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.
There is no plan to support these geometries.

val3dity accepts as input:

- [CityGML](https://www.citygml.org)
- [CityJSON](http://www.cityjson.org)
- [GML files](https://en.wikipedia.org/wiki/Geography_Markup_Language) of any flavour
- [CityJSON](http://www.cityjson.org)
- [CityGML (v1 & v2 only; v3 will not be supported)](https://www.citygml.org)
- [IndoorGML](http://indoorgml.net/)
- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)
- [OFF](https://en.wikipedia.org/wiki/OFF_(file_format))

For the City/JSON/GML and IndoorGML formats, extra validations (specific to the format) are performed, eg the overlap between different parts of a building, or the validation of the navigation graph in IndoorGML.


## Usage

val3dity is a command-line interface (CLI) programme only, with [several options](https://val3dity.readthedocs.io/en/latest/usage/#options-for-the-validation).

[![val3dity cli demo](./misc/cli.svg)](https://asciinema.org/a/329835)
_No demo visible here? View it on [asciinema](https://asciinema.org/a/329835)._


## Web application

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).
Simply upload your file to our server and get a validation report back.
We delete the file as soon as it has been validated (promised!).
However, a file is limited to 50MB.


## Installation of the command-line tool

Expand All @@ -33,24 +57,26 @@ This is relatively easy under Mac and Linux.

To compile val3dity yourself, you first need to install the following free libraries:

1. [CGAL v4.10+](http://www.cgal.org) (<v4.10 will compile and run, but wrong results for one test (error 405))
1. (CGAL needs to be compiled with the [Eigen library](http://eigen.tuxfamily.org))
1. [CGAL v5.0+](http://www.cgal.org)
1. [Eigen library](http://eigen.tuxfamily.org)
1. [GEOS](http://trac.osgeo.org/geos/)
1. [CMake](http://www.cmake.org)

Under macOS, it's super easy, we suggest using [Homebrew](http://brew.sh/):

$ brew install cgal
$ brew install cmake
$ brew install eigen
$ brew install geos
$ brew install cmake

Under Linux (at least Ubuntu), CGAL has to be compiled because apt-get doesn't give you a version with Eigen.
Thus, in a nutshell,

1. download [latest CGAL code](https://github.com/CGAL/cgal/releases)
1. install Eigen library: `$ sudo apt-get install libeigen3-dev`
1. compile CGAL by first activating the Eigen option in the CMake (`$ cmake . -DWITH_Eigen3=ON`), or use [cmake-gui](https://cmake.org/runningcmake/) and activate it (option is called `WITH_Eigen3`)
1. `export CGAL_DIR=/path/to/CGAL-4.1x` which will tell your shell to use that version of CGAL (thus more version of CGAL can be installed on the same computer; see that [handy manual](https://github.com/CGAL/cgal/wiki/Branch-Build))
1. install Eigen library: `$ sudo apt install libeigen3-dev`
1. install GEOS library: `$ sudo apt install libgeos++-dev`
1. install CGAL: `$ sudo apt-get install libcgal-dev`
- if it's not CGAL5 that is installed, download [latest CGAL code](https://github.com/CGAL/cgal/releases) and unzip somewhere
- set `CGAL_DIR` to that folder, eg `export CGAL_DIR=/home/hledoux/software/CGAL-5.0.2`, this will tell your shell to use that version of CGAL (thus more version of CGAL can be installed on the same computer; see that [handy manual](https://github.com/CGAL/cgal/wiki/Branch-Build))

To compile and run val3dity (from the val3dity folder):

Expand All @@ -62,32 +88,47 @@ To compile and run val3dity (from the val3dity folder):

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

To verify that everything went fine during the compilation, run the unit tests (from the root folder of val3dity; must use Python3):
Finally, to see all the options possible:

$ python3 -m pytest --runfull
$ ./val3dity --help

You shouldn't get any errors

Finally, to see all the options possible:
## Unit tests

$ ./val3dity --help
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`):

## Vagrant development environment
$ python -m pytest --runfull

If you are eager to contribute but do not want to fiddle with setting up the required libraries, Vagrant can take care of that. It creates a development environment in a virtual machine, which you can use to compile and run val3dity. For details see VAGRANT.md
You shouldn't get any errors.

## Web application

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).
Simply upload your file to our server and get a validation report back.
We delete the file as soon as it has been validated (promised!).
However, a file is limited to 50MB.
## Usage of Docker

To run val3dity over Docker simply execute:

$ docker run --rm -v <local path where your files are>:/data tudelft3d/val3dity:<tag> <name of the dedicated file>

Where `<tag>` is docker image tag from [https://hub.docker.com/r/tudelft3d/val3dity/tags](https://hub.docker.com/r/tudelft3d/val3dity/tags)

If you are using the `--report` option, then **keep in mind that `<local path where your files are>` need to be writable by any user, otherwise your output won't be saved.**


## Documentation and help

Read the full documentation at [http://geovalidation.bk.tudelft.nl/val3dity/docs/](http://geovalidation.bk.tudelft.nl/val3dity/docs/).
Read the full documentation at [https://val3dity.rtfd.io](https://val3dity.rtfd.io).

The primary channel to communicate with the developers is the Issues section.

If you have a question or came across a bug, please submit an issue there.
However we ask you check first whether your problem has already been solved by someone else.


## If you use val3dity in a scientific context, please cite these articles:

Ledoux, Hugo (2019). val3dity: validation of 3D GIS primitives according to the international standards. *Open Geospatial Data, Software and Standards*, 3(1), 2018, pp.1 [[DOI](http://dx.doi.org/10.1186/s40965-018-0043-x)]

Ledoux, Hugo (2013). On the validation of solids represented with the international standards for geographic information. Computer-Aided Civil and Infrastructure Engineering, 28(9):693-706. [[PDF](https://3d.bk.tudelft.nl/hledoux/pdfs/13_cacaie.pdf)] [[DOI](http://dx.doi.org/10.1111/mice.12043)]

## Error codes

![](./docs/_static/errorcodes.png)

0 comments on commit ad6d666

Please sign in to comment.