Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dfyz/osm-renderer
OpenStreetMap raster tile renderer written in Rust
https://github.com/dfyz/osm-renderer
openstreetmap rust
Last synced: 3 months ago
JSON representation
OpenStreetMap raster tile renderer written in Rust
- Host: GitHub
- URL: https://github.com/dfyz/osm-renderer
- Owner: dfyz
- License: mit
- Created: 2018-09-08T12:06:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-03T00:15:46.000Z (12 months ago)
- Last Synced: 2024-08-01T22:57:57.805Z (6 months ago)
- Topics: openstreetmap, rust
- Language: Rust
- Homepage:
- Size: 120 MB
- Stars: 126
- Watchers: 6
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
An OpenStreetMap raster tile renderer that compiles to a native Windows/Linux/macOS binary with no external dependencies.
You do have to install [Rust](https://rustup.rs) to compile the binary, but other than that, all you need is an `*.xml` file with raw OSM data.
## Importing data
This command takes a `city.xml` data file (get one from [Geofabrik](https://download.geofabrik.de) or a simliar service) and outputs `city.bin`, which will be used for rendering.
```
$ cargo run --release --bin importer city.xml city.bin
```## Rendering data
```
$ cat city.conf
[http]
address = localhost:8080[geodata]
file = city.bin[style]
file = mapcss/osmosnimki-minimal.mapcss
type = josm$ cargo run --release --bin renderer city.conf
```Raster tiles are now being served from `http://localhost:8080/{z}/{x}/{y}.png`. This URL template should work out of the box with leaflet.js, MKTileOverlay, or any map library that supports [slippy tile layers](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames).
You can use the `@2x` suffix to request [high-resolution tiles](https://wiki.openstreetmap.org/wiki/High-resolution_tiles) (i.e. change your URL template to `http://localhost:8080/{z}/{x}/{y}{r}.png` for leaflet.js).
## Rendering sample
The rendering style is based on [MAPS.ME](https://github.com/mapsme/omim).
![London centre](/samples/london_2x.png)
## Caveats
The font renderer used in this project is very rudimentary, and only supports a limited number of scripts that are included in [Noto Sans](https://fonts.google.com/noto/specimen/Noto+Sans) (namely, Latin, Greek, and Cyrillic).