Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/themarex/deberg

Map simplification using the deberg algorithm
https://github.com/themarex/deberg

Last synced: about 1 month ago
JSON representation

Map simplification using the deberg algorithm

Awesome Lists containing this project

README

        

# DeBerg

This project implement a variation of the DeBerg line simplification algorithm.

The algortithm enables you to simplify lines without introducing self-intersections.
You can also define an additional set of points that will stay consitent with regard to the line simplification:
They will not change the 'side' of the line (e.g. when simplifying country borders cities will not suddently be in different countries).

This variation always computes the strongest simplification possible using the fewest edges.
![Example picture](example.png?raw=true "Optional Title")

# Building

All dependencies (other than `boost`) should be included in `third_party/`.

```
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
```

# Running

`./deberg MAX_NUMBER_EDGES lines.txt points.txt output_lines.txt`

Will write the result in `output_lines.txt` and print number of used edges in the console.

## Input format

[osm-admin-bounds](https://github.com/TheMarex/osm-admin-bounds) is a tool to generate the input data from OpenStreetMap data.

You can use `utils/data_to_geojson.py` to convert files to geojson for easy visualization.

### lines.txt

```
id:graphml_string
```

Example:

```
1:-7984749.593824852,5368675.690126911 -7984392.035620423,5367570.791302501 -7983220.843257783,5366848.500158152
```

### points.txt

```
id:graphml_string
```

Example:

```
115:-7878323.0399299,5218629.93044479
```

### output.txt

Same format as `lines.txt`.