In this section, we are going to host terrain RGB raster tileset which we generated in previous section.
For hosting tiles, you will have two choices.
In Rwanda’s case, our size of tilesets are below 1GB, so we hosted it on our Github pages.
We named rw-terrain as our hosted repository on Github.
git clone git@github.com:WASAC/rw-terrain.git
cd rw-terrain
docs directory.mkdir docs
cd docs
mv ../../dem2terrainrgb/data/tiles tiles
You may delete unnecessary *.html files from tiles folder.
tiles foldervi metadata.json
{
"name": "Rwanda 10m Terrain RGB Tileset",
"description": "Rwanda 10m Terrain RGB Tileset, CC-BY-4.0: Water and Sanitation Corporation (WASAC), Rwanda",
"version": "1"
}
LICENSE file under root directoryWe are using Creative Commons Attribution 4.0 International License. You may copy our license file to your repository.
cd ..
wget https://raw.githubusercontent.com/WASAC/rw-terrain/main/LICENSE
README.mdFinally, do not forget to write README.md for users. You may modify our [README.md(https://github.com/WASAC/rw-terrain/blob/main/README.md) for your data.
Now, you can push this repository to Github, then please configure Github pages setting.
You can access tilesets from the below URL.
https://wasac.github.io/rw-terrain/tiles/{z}/{x}/{y}.png
mbtiles from raster tilesetsIf you want to host tilesets on your own server, first you need to create mbtiles container by using mb-utils tool.
Go back to dem2terrainrgb repository folder.
cd ~/dem2terrainrgb
Then, create metadata.json under tiles directory.
vi tiles/metadata.json
{
"name": "Rwanda 10m Terrain RGB Tileset",
"description": "Rwanda 10m Terrain RGB Tileset, CC-BY-4.0: Water and Sanitation Corporation (WASAC), Rwanda",
"version": "1"
}
Finally, you can execute mb-utils to create mbtiles under tilesets folder.
mb-util --image_format=png --scheme=xyz ./tiles/ ./tilesets/rwanda_dem_EPSG3857_10m.mbtiles
You may be able to use mbtilesserver.
After installing mbtileserver,
~/go/bin/mbtileserver --verbose
it will automatically find mbtiles under tilesets folder, then access to http://localhost:8000/services. You will see the following response.
[
{
"imageType": "png",
"url": "http://localhost:8000/services/rwanda_dem_EPSG3857_10m",
"name": "Rwanda 10m Terrain RGB Tileset"
}
]
After that, continue to access http://localhost:8000/services/rwanda_dem_EPSG3857_10m and see more detailed information.
{
"description": "Rwanda 10m Terrain RGB Tileset, CC-BY-4.0: Water and Sanitation Corporation (WASAC), Rwanda",
"format": "png",
"map": "http://localhost:8000/services/rwanda_dem_EPSG3857_10m/map",
"maxzoom": 15,
"minzoom": 5,
"name": "Rwanda 10m Terrain RGB Tileset",
"scheme": "xyz",
"tilejson": "2.1.0",
"tiles": [
"http://localhost:8000/services/rwanda_dem_EPSG3857_10m/tiles/{z}/{x}/{y}.png"
],
"version": "1"
}
Tileset URL will be as below.
http://localhost:8000/services/rwanda_dem_EPSG3857_10m/tiles/{z}/{x}/{y}.png
You can use QGIS’s xyz tile layer funciton to validate your tile hosting.
