Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
/target/
*.png
!docs/*.png
*.jpg
*.jpeg
.env
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ overlays. Rust CLI and library, CPU rendering with tiny-skia. No browser,
Node.js, GUI, GPU, or async runtime. The executable does not download code or
assets at startup.

## Berlin from GeoJSON

![Berlin Mitte in four basemap styles with the same GeoJSON overlay](docs/berlin-basemaps.png)

mapshoot is built for **automatic, reproducible screenshots of GeoJSON data**:
give it a center and radius (or a bbox), a basemap, and a GeoJSON file, and it
writes the finished PNG. No browser, screenshot service, manual tile stitching,
or post-processing step is involved. The image above renders the same overlay
data (`examples/berlin.geojson`) over four basemaps.

```sh
# HERE, with the bundled Berlin overlay:
export MAPSHOOT_HERE_API_KEY='your-key' # legacy: HERE_API_KEY
mapshoot --center 13.405,52.52 --radius 2600 --width 800 --height 450 \
--basemap here --here-style explore.day \
--geojson examples/berlin.geojson --style examples/berlin-style.json \
--output berlin-here.png

# The same data and framing with OpenStreetMap, no key required:
mapshoot --center 13.405,52.52 --radius 2600 --width 800 --height 450 \
--basemap osm \
--geojson examples/berlin.geojson --style examples/berlin-style.json \
--output berlin-osm.png
```

Swap `--basemap` and the style flag to compare providers; the basemap, style,
and key tables are below. The overlay is drawn in the same projected coordinate
space as the tiles, so points, lines, and polygons line up at every zoom and
fractional scale.

## Build

```sh
Expand Down
Binary file added docs/berlin-basemaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions examples/berlin-style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"color": "#ff3b30",
"fillColor": "#ff3b30",
"weight": 4,
"opacity": 1,
"fillOpacity": 0.18,
"radius": 7
}
82 changes: 82 additions & 0 deletions examples/berlin.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": { "name": "Museum Island" },
"geometry": {
"type": "Polygon",
"coordinates": [
[
[13.393, 52.514],
[13.403, 52.514],
[13.403, 52.522],
[13.393, 52.522],
[13.393, 52.514]
]
]
}
},
{
"type": "Feature",
"properties": { "name": "Unter den Linden" },
"geometry": {
"type": "LineString",
"coordinates": [
[13.3777, 52.5163],
[13.3835, 52.517],
[13.39, 52.5176],
[13.397, 52.5184],
[13.405, 52.5194],
[13.4094, 52.5208],
[13.4132, 52.5219]
]
}
},
{
"type": "Feature",
"properties": { "name": "Hauptbahnhof" },
"geometry": { "type": "Point", "coordinates": [13.3694, 52.5251] }
},
{
"type": "Feature",
"properties": { "name": "Brandenburg Gate" },
"geometry": { "type": "Point", "coordinates": [13.3777, 52.5163] }
},
{
"type": "Feature",
"properties": { "name": "Potsdamer Platz" },
"geometry": { "type": "Point", "coordinates": [13.376, 52.5095] }
},
{
"type": "Feature",
"properties": { "name": "Checkpoint Charlie" },
"geometry": { "type": "Point", "coordinates": [13.3904, 52.5075] }
},
{
"type": "Feature",
"properties": { "name": "Gendarmenmarkt" },
"geometry": { "type": "Point", "coordinates": [13.392, 52.513] }
},
{
"type": "Feature",
"properties": { "name": "Museum Island" },
"geometry": { "type": "Point", "coordinates": [13.3975, 52.5186] }
},
{
"type": "Feature",
"properties": { "name": "TV Tower" },
"geometry": { "type": "Point", "coordinates": [13.4094, 52.5208] }
},
{
"type": "Feature",
"properties": { "name": "Alexanderplatz" },
"geometry": { "type": "Point", "coordinates": [13.4132, 52.5219] }
},
{
"type": "Feature",
"properties": { "name": "East Side Gallery" },
"geometry": { "type": "Point", "coordinates": [13.4397, 52.505] }
}
]
}
Loading