Skip to content

Commit

Permalink
Merge branch 'release/v2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed Feb 22, 2018
2 parents 436a966 + 0d6074f commit 7934daa
Show file tree
Hide file tree
Showing 28 changed files with 2,525 additions and 646 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ x86/
/build
/docs/_build

# Vagrant
.vagrant/

# Balázs (Visual Studio etc)
.vscode/
.cproject
Expand Down
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# val3dity
# 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).
Expand All @@ -7,7 +7,7 @@ In short, it verifies whether a 3D primitive respects the definition as given in
All the 3D primitives of GML are supported:

- `<gml:MultiSurface>`
- `<gml:CompositeSurface>`
- `<gml:CompositeSurface>`
- `<gml:Solid>`
- `<gml:MultiSolid>`
- `<gml:CompositeSolid>`
Expand All @@ -17,16 +17,16 @@ However, as is the case for CityGML, only planar and linear primitives are allow

val3dity accepts as input:

- [CityGML](https://www.citygml.org)
- [CityGML](https://www.citygml.org)
- [CityJSON](http://www.cityjson.org)
- [GML files](https://en.wikipedia.org/wiki/Geography_Markup_Language) of any flavour
- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)
- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)
- [OFF](https://en.wikipedia.org/wiki/OFF_(file_format))


## Installation of the command-line tool

We provide the source code that you need to compile with CMake.
We provide the source code that you need to compile with CMake.
This is relatively easy under Mac and Linux.

[For Windows, we offer an executable](https://github.com/tudelft3d/val3dity/releases), although it's also possible to compile val3dity yourself.
Expand All @@ -35,13 +35,13 @@ To compile val3dity yourself, you first need to install the following free libra

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. [GEOS](http://trac.osgeo.org/geos/)
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 --with-eigen
$ brew install cmake
$ brew install cmake
$ brew install geos

Under Linux (at least Ubuntu), CGAL has to be compiled because apt-get doesn't give you a version with Eigen.
Expand Down Expand Up @@ -72,18 +72,22 @@ Finally, to see all the options possible:

$ ./val3dity --help

## Vagrant development environment

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

## 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).
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.

## 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 [http://geovalidation.bk.tudelft.nl/val3dity/docs/](http://geovalidation.bk.tudelft.nl/val3dity/docs/).

The primary channel to communicate with the developers is the Issues section.
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 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.
63 changes: 63 additions & 0 deletions VAGRANT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Installing Vagrant

To download Vagrant for supported platforms, see [here](https://www.vagrantup.com/downloads.html)

# Installing VirtualBox

If choosing VirtualBox as your virtualization provider, see [here](https://www.virtualbox.org/wiki/Downloads).

You may have to enable hardware virtualization extensions in your BIOS before using it.

If running on Ubuntu, you may have to install a newer version of VirtualBox than what is available in the public repositories in order for it to work correctly with Vagrant.

# Setting up val3dity with Vagrant & VirtualBox
Once Vagrant has been installed, you can start an environment by checking out the val3dity code, then changing to the directory which contains the Vagrantfile by typing:

# Windows users will need to uncomment the line ending configuration option.
git clone [email protected]:tudelft3d/val3dity.git val3dity #--config core.autocrlf=input
cd val3dity
vagrant up

# Other Virtualization Providers

If you would like to use Parallels instead of VirtualBox, please run the following command:
```
vagrant up --provider=parallels
```
Please note that this requires the Parallels Vagrant plugin, which can be installed:
```
vagrant plugin install vagrant-parallels
```

Similarly, if you would like to use VMware Workstation instead of VirtualBox, please run the following command:
```
vagrant up --provider vmware_workstation
```
Please note that this requires the VMware Vagrant plugin, which can be installed:
```
vagrant plugin install vagrant-vmware-workstation
```

# Vagrant Provisioning

The initialization of the vagrant vm (`vagrant up`) will take about an hour at first.

You should be able to log into the running VM by typing:

vagrant ssh

Within this login shell, you can build the code, run the server or the tests. For example, to run the tests:

```
vagrant ssh
cd ~/val3dity_build
cmake ../val3dity
make
make install
```

The val3dity root folder (on host) is mapped to the `/home/vagrant/val3dity` folder on the guest. Note that # Vagrant shared folders (e.g. `/home/vagrant/val3dity`) incur a heavy performance penalty within the virtual machine when there is heavy I/O, so they should only be used for source files. Any compilation step, database files, and so on should be done outside the shared folder filesystem inside the guest filesystem itself.

**Acknowledgement**

The majority of this description was taken from the [Hootenanny project](https://github.com/ngageoint/hootenanny/blob/master/VAGRANT.md)
102 changes: 102 additions & 0 deletions VagrantProvisionUbuntu1604.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/usr/bin/env bash

# Set environment variables
BUILDS="/opt"
HOME="/home/vagrant"
echo HOME: $HOME

apt-get update >/dev/null 2>&1

# CMake, C/++ compiler ---------------------------------------------------------
echo "Installing C/++ compiler and CMake..."
apt-get install -y cmake gcc g++ >/dev/null 2>&1

# pip --------------------------------------------------------------------------
echo "Installing pip..."
apt-get install -y python3-pip >/dev/null 2>&1

# CGAL requirements ------------------------------------------------------------
echo "Installing Eigen3, Boost, GMP, MPFR..."
# get Boost
apt-get install -y libboost-all-dev >/dev/null 2>&1
# get Eigen3
apt-get install -y libeigen3-dev >/dev/null 2>&1
# get GMP and MPFR
apt-get install -y libgmp10 libgmp-dev libmpfr-dev libmpfr4 >/dev/null 2>&1

apt-get update >/dev/null 2>&1
apt-get upgrade -y >/dev/null 2>&1

# GEOS -------------------------------------------------------------------------
echo "Downloading and building GEOS 3.6.2 ..."
cd $BUILDS
wget https://git.osgeo.org/gitea/geos/geos/archive/3.6.2.tar.gz >/dev/null 2>&1
tar xf 3.6.2.tar.gz
rm 3.6.2.tar.gz
mkdir $BUILDS/geos/build && cd $BUILDS/geos/build
cmake ..
make
geos_test=$(make check | grep -o '100% tests passed')
if [ "$geos_test" = "100% tests passed" ]; then
make install
ldconfig
make clean
else
echo "GEOS test failed, exiting provisioning"
exit 1
fi


# CGAL -------------------------------------------------------------------------
# For some reason CGAL cannot link Eigen3 to boost_thread when the release tarball
# is used for compilation. However, everything works when CGAL is compiled from
# the source tarball (copy of GitHub master branch). Only the md5sum is not
# correct in the provided md5sum.txt
echo "Downloading and building CGAL 4.10.2 ..."
cd $BUILDS
wget https://github.com/CGAL/cgal/archive/releases/CGAL-4.10.2.tar.gz >/dev/null 2>&1
#wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.10.2/md5sum.txt >/dev/null 2>&1

#CGAL_TAR=$(md5sum CGAL-4.10.2.tar.xz)
#CGAL_MD5=$(cat md5sum.txt | grep CGAL-4.10.2.tar.xz)
#if [ "$CGAL_TAR" = "$CGAL_MD5" ]; then
# tar -xf CGAL-4.10.2.tar.xz
# rm CGAL-4.10.2.tar.xz
# rm md5sum.txt
#else
# echo "md5sum of CGAL not matching, exiting provisioning"
# exit 1
#fi

tar -xf CGAL-4.10.2.tar.gz
rm CGAL-4.10.2.tar.gz

mkdir $BUILDS/cgal-releases-CGAL-4.10.2/build && cd $BUILDS/cgal-releases-CGAL-4.10.2/build
cmake .. -DWITH_Eigen3=ON
make
make install
make clean
ldconfig


# pytest -----------------------------------------------------------------------
echo "Installing pytest..."
pip3 install pytest

# val3dity ---------------------------------------------------------------------
echo "Building val3dity..."
# Vagrant shared folders incur a heavy performance penalty within the
# virtual machine when there is heavy I/O, so they should only be used for
# source files. Any compilation step, database files, and so on should be done
# outside the shared folder filesystem inside the guest filesystem itself.
mkdir $HOME/val3dity_build && cd $HOME/val3dity_build
cmake $HOME/val3dity
make
make install
cd $HOME

val3dity --version

chown vagrant:vagrant $HOME/val3dity_build

echo "See VAGRANT.md for additional configuration instructions and then run 'vagrant ssh' to log into the val3dity virtual machine."
74 changes: 74 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
# config.vm.box = "debian/stretch64"
config.vm.box = "ubuntu/xenial64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# VirtualBox Guest Additions plugin
config.vbguest.auto_update = true

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder ".", "/home/vagrant/val3dity"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:

config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
# vb.gui = true

# Customize the amount of memory and CPUs on the VM:
vb.memory = 2048
vb.cpus = 2
end

# View the documentation for the provider you are using for more
# information on available options.

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", path: "VagrantProvisionDebian9.sh"
config.vm.provision "shell", path: "VagrantProvisionUbuntu1604.sh"
end
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@

# Changelog

## [Unreleased]
- validation of IndoorGML features

## [2.1.0] - 2018-02-14
### Changed
- the report is slightly changed: the CityObjects/Primitives subdivision in the report is replaced by Features having Primitives, where Features are the top-level objects, containing one or many Primitives. This is done to allow other data model to be used as input, eg IndoorGML is coming soon!
### Added
- pytest allows to specify the binary to use if not under 'build/'

## [2.0.4] - 2018-01-26
### Changed
- fixed bug where inner rings of gml:Polygon wasn't read properly when that polygon is referenced by an XLink.
Expand Down
Loading

0 comments on commit 7934daa

Please sign in to comment.