Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/themarex/deberg
- Owner: TheMarex
- License: bsd-2-clause
- Created: 2015-06-23T13:31:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-30T14:11:57.000Z (over 9 years ago)
- Last Synced: 2023-03-17T05:45:28.469Z (over 1 year ago)
- Language: C++
- Size: 4.33 MB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`.