• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created over 12 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automatic repair of single polygons (according to the OGC Simple Features / ISO19107 rules) using a constrained triangulation.

What is prepair?

prepair β€” pronounce 'pee-repair' as in 'polygon repair' β€” permits us to easily repair "broken" GIS polygons according to the international standard ISO19107 (Geographic information β€” Spatial schema). Given one input polygon, it automatically repairs it and returns back a valid polygon (actually a MultiPolygon since the input can represent more than one polygon β€” think of a 'bowtie' for instance).

Automated repair methods can be considered as interpreting ambiguous or ill-defined polygons and giving a coherent and clearly defined output. Examples of errors are: polygon has a dangling edge; polygon is not closed; polygon self-intersects; an inner ring of the polygon is located outside the outer ring; etc.

prepair performs more or less the same as the PostGIS 2.0's function ST_MakeValid(), but is faster, scales better to massive polygons, and predicting its behaviour is simple (so one can guess how polygons will be repaired).

prepair is based on a constrained triangulation (CGAL is used) and GDAL is used to read/write WKT.

It is available under the GPLv3 licence, which allows you to use, copy and modify the software freely. However, if you incorporate prepair in your software, you must distribute the source code of your software, as well as any modifications made to pprepair, under the GPLv3 as well.

Note that prepair is only concerned with single polygons, and if you're interested in validating how different polygons interact with each other (to be precise: to check if they form a planar partition) have a look at our other project pprepair.

Details

Details of how we automatically repair broken polygons, and what results you can expect, are available in this scientific article:

Ledoux, H., Arroyo Ohori, K., and Meijers, M. (2014). A triangulation-based approach to automatically repair GIS polygons. Computers & Geosciences 66:121–131. [DOI] [PDF]

If you use prepair for a scientific project, please cite this article.

How to get it?

prepair is very easy to compile on Mac and Linux using the included CMake file. It should also work on other Unix-like systems and is possible to compile under Windows. To compile prepair, you need to have a recent version of the following three (free) libraries:

  1. CGAL
  2. GDAL
  3. CMake

On Mac, you can install it using Homebrew:

$ brew install tudelft3d/software/prepair

Once all the dependencies are met, just generate the makefile for your system and compile:

$ cmake -DCMAKE_BUILD_TYPE=Release .
$ make

How to run it?

You can run prepair from the command-line or through our QGIS plug-in, which you can get from the official QGIS repository.

A WKT or a path to a dataset (geopackage, geojson or shapefile for instance) is read as input, and a WKT or a path to a dataset is given as output:

$ ./prepair -w 'POLYGON((0 0, 0 10, 10 0, 10 10, 0 0))'  
MULTIPOLYGON (((0 0,5 5,0 10,0 0)),((5 5,10 0,10 10,5 5)))

$ ./prepair -w 'POLYGON((0 0, 0 10, 10 0, 10 10, 0 0))' -o myfile.gpkg
Writing GPKG file myfile.gpkg...

$ ./prepair -w 'POLYGON((0 0 0, 0 10 5, 10 0 10, 10 10 15, 0 0 0))'
MULTIPOLYGON (((0 0,5 5,0 10,0 0)),((5 5,10 0,10 10,5 5)))

Examples of invalid input you can try

The folder 'data' contains examples of relatively big invalid polygons. These are from the Corine Land Cover 2006 dataset.

A 'bowtie' polygon:

POLYGON((0 0, 0 10, 10 0, 10 10, 0 0))

Square with wrong orientation:

POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))

Inner ring with one edge sharing part of an edge of the outer ring:

POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 2,5 7,10 7, 10 2, 5 2))

Dangling edge:

POLYGON((0 0, 10 0, 15 5, 10 0, 10 10, 0 10, 0 0))

Outer ring not closed:

POLYGON((0 0, 10 0, 10 10, 0 10))

Two adjacent inner rings:

POLYGON((0 0, 10 0, 10 10, 0 10, 0 0), (1 1, 1 8, 3 8, 3 1, 1 1), (3 1, 3 8, 5 8, 5 1, 3 1))

Polygon with an inner ring inside another inner ring:

POLYGON((0 0, 10 0, 10 10, 0 10, 0 0), (2 8, 5 8, 5 2, 2 2, 2 8), (3 3, 4 3, 3 4, 3 3))

More Repositories

1

3dfier

The open-source tool for creating 3D models
C++
514
star
2

Random3Dcity

A basic procedural modelling engine for generating buildings and other features in CityGML
Python
204
star
3

AdTree

Accurate, detailed, and automatic modelling of laser-scanned trees
C++
178
star
4

City3D

Large-scale LoD2 Building Reconstruction from Airborne LiDAR Point Clouds
C++
126
star
5

terrainbook

"Computational modelling of terrains" book: source code + PDF
TeX
106
star
6

masbcpp

C++ implementation of the Medial Axis Shrinking Ball algorithm
C++
103
star
7

CityGML2OBJs

An experimental utility to convert CityGML data to OBJ, featuring decoupling of objects and conversion of attributes to colours
Python
93
star
8

val3dity

Validation of 3D primitives according to the international standard ISO19107
C++
92
star
9

azul

3D city model viewer for Mac
C++
89
star
10

City4CFD

Reconstruction of LoD2 3D city models for urban flow simulations
C++
76
star
11

ifc2citygml

Automatic conversion of IFC models 2x3 to CityGML LOD 1/2/3/4
C++
73
star
12

pprepair

Validation and Automatic Repair of Planar Partitions
C++
57
star
13

3DCityDB-Tools-for-QGIS

This repository contains code of a QGIS plugin that facilitates data handling of the CityGML 3D City Database.
PLpgSQL
55
star
14

masbpy

Medial Axis Shrinking Balls - Python implementation of the Shrinking Ball algorithm to construct the Medial Axis Transform
Python
49
star
15

Solar3Dcity

An experimental utility to estimate the yearly solar irradiation of roof surfaces in CityGML
Python
48
star
16

3D_Urban_Mesh_Annotator

A tool for annotating textured urban meshes
C++
43
star
17

3d-building-metrics

Tool to compute shape metrics from 3D geometries for buildings
Jupyter Notebook
32
star
18

SUMS-Semantic-Urban-Mesh-Segmentation-public

SUMS: Semantic Urban Mesh Segmentation.
Python
25
star
19

website

Website for the group
HTML
25
star
20

3dbag-viewer

Vue
22
star
21

PSSNet

PSSNet: Planarity-sensible Semantic Segmentation of Large-scale Urban Meshes
C++
21
star
22

msc_geomatics_thesis_template

A template for the TU Delft MSc Geomatics thesis (P4+P5)
TeX
13
star
23

lod2plus

Automatic generation of simple interiors for CityGML LOD2
C++
13
star
24

geogeeks

The place where geogeeks go to know "how to do X"
HTML
12
star
25

indoorjson

IndoorJSON is like IndoorGML but without the GML
Python
11
star
26

esri_geobim

C++
11
star
27

IfcLocator

JavaScript
10
star
28

Roofline-extraction-from-orthophotos

Roofline extraction from orthophotos
C++
9
star
29

bag3d

Software for generating a 3D version of the BAG dataset and more. Python + PostgreSQL + 3dfier
Python
9
star
30

CityGML-schema-validation

small script to validate a CityGML file against the XSD schemas of CityGML (all versions supported)
Python
7
star
31

prepair-qgis

QGIS plugin for prepair
Python
7
star
32

3dbook

Book for the course GEO1004: 3D modelling of the built environment
TeX
6
star
33

CityJSON2glTF

An experimental python utility to convert CityJSON datasets to glTF 2.0 and schematically validate glTF datasets
Python
5
star
34

cityjson-versioning-prototype

A prototype implementation of interaction with versioned CityJSON files
Python
5
star
35

geo1101.2020.ahn3

An improved AHN3 gridded DTM/DSM done as university project for the MSc Geomatics @ TU Delft
Python
5
star
36

cityjsonToRevit

A plugin for importing CityJSON geometries to Autodesk Revit
C#
5
star
37

city2InfraGML

An experimental python utility to convert CityGML datasets to InfraGML and vice versa.
Python
5
star
38

carriageways-creator

Carriageways Creator
Jupyter Notebook
4
star
39

val3ditypy

Python bindings for the award-winning val3dity software
C++
4
star
40

geovalidation.server

Web server for val3dity/prepair
HTML
4
star
41

Random3DTIN

A python utility to generate terrain models at different LODs in CityGML.
Python
3
star
42

CityGML-QIE-3Dvalidation

repository for the test datasests for the OGC CityGML QIE Experiment #2: 3D geometric validation
HTML
3
star
43

ocm-downloader

A script to download the data of opencitymodel
Python
3
star
44

geo1004_handouts

Handouts for the course GEO1004: 3D modelling of the built environment
TeX
3
star
45

geo2020

Website for the MSc Geomatics graduation thesis (GEO2010+GEO2020)
CSS
3
star
46

geoflow-nodes

Various nodes for geoflow
C++
2
star
47

eNoiseModel

Data model for standardising the input/output data for noise simulations using CNOSSOS-EU
2
star
48

Testbed4UBEM

A Repository of an Urban Energy Modeling testbed based on the OGC CityGML v2.0 standard
2
star
49

valsem

Validation of the semantic of CityGML LOD2 (based on normal orientations)
C++
2
star
50

3dgeoinfo2018

Website for the 3D Geoinfo 2018 conference
HTML
2
star
51

homebrew-software

homebrew formulas for some of our software
Ruby
2
star
52

isochrones-mexico

C++
2
star
53

Symmetrization

C++
2
star
54

matahn

Download tool for AHN2 that delivers a LAZ file with the points inside a bounding box drawn by the user.
Python
2
star
55

git-course-material

TeX
2
star
56

latex-getting-started

Quick LaTeX course
TeX
1
star
57

EnergyADEv1_toCityGMLv3

This repository contains the work for mapping the Energy ADE v1.0 to the CityGML v3.0 data model
1
star
58

InfraJSON

JSON encoding for LandInfra Conceptual Model 1.0.0
Python
1
star
59

3D_Metadata_ADE

CityGML ADE for storing metadata about the 3D city models.
Python
1
star
60

citygml-solidifier

takes a CityGML file with Buildings stored as gml:MultiSurfaces and creates gml:Solids
Python
1
star
61

citygmlinfo

Prints out all sort of useful information about a CityGML file
C++
1
star
62

city3d_valpy

citygml valid
Python
1
star
63

abe-latex

LaTeX template for the TU Delft A+BE PhD thesis series
TeX
1
star
64

cityjson-lcc-reconstructor

A tool to topologically reconstruct a CityJSON model
C++
1
star
65

citygml2poly

Converts the solids of a CityGML file to POLY files.
Java
1
star
66

nl3d

XSLT
1
star
67

website-3d4em

Source code for
HTML
1
star
68

IDEA-Taskforce

Collection of notes from the 3DEI-working group
1
star