This is a set of Tilemill projects now migrated to use Kosmtik that demonstrate various types of advanced functionality. The examples are mostly self-contained and should mostly work offline. See the instructions below for project-specific setup that might be needed in a few places.
You can either download this directory and point Kosmtik's documents setting at it.
Or you can use git to set the projects up within an existing documents directory.
cd your_directory
git clone https://github.com/ThomasG77/kosmtik-examples.git
nvm use lts/carbon
cd kosmtik-examples
npm i
cd node_modules/kosmtik/
npm i
cd ../..
Then for each project, do run the following and open http://localhost:6789
Alternate setup could be using docker in particular on Windows (because mapnik/node-mapnik#848) e.g
docker run --rm -it \
-p 6789:6789 -v your_absolute_path_to_tilemill_examples_repo/city-name:/opt/project \
-e USER_ID=1000 \
joxit/kosmtik \
kosmtik serve /opt/project/project.mml --host 0.0.0.0
Be careful as we don't plan to document heavily docker usage (in particular how to use PostGIS samples with kosmtik) except if we got contributions (PS: working on Linux box hence this viewpoint).
cd arrrrrrr
sh download.sh
cd ..
npx kosmtik serve arrrrrrr/project.mml
cd city-name
sh download.sh
cd ..
npx kosmtik serve city-name/project.mml
cd colorize-alpha
sh download.sh
cd ..
npx kosmtik serve colorize-alpha/project.mml
cd color-variables-and-functions
sh download.sh
cd ..
npx kosmtik serve color-variables-and-functions/project.mml
cd compositing-circles
sh download.sh
cd ..
npx kosmtik serve compositing-circles/project.mml
cd custom-map-projection
sh download.sh
cd ..
npx kosmtik serve custom-map-projection/project.mml
cd data-driven-markers
sh download.sh
cd ..
npx kosmtik serve data-driven-markers/project.mml
Not working on kosmtik at the moment
cd enhance-low-res-raster
sh download.sh
cd ..
npx kosmtik serve enhance-low-res-raster/project.mml
npx kosmtik serve fancy-formatted-label/project.mml
cd feature-dependent-desaturation
sh download.sh
cd ..
npx kosmtik serve feature-dependent-desaturation/project.mml
cd hand-drawn-patterns
sh download.sh
cd ..
npx kosmtik serve hand-drawn-patterns/project.mml
cd intensity-map
sh download.sh
cd ..
npx kosmtik serve intensity-map/project.mml
cd labels-along-lines
sh download.sh
cd ..
npx kosmtik serve labels-along-lines/project.mml
cd labels-no-significant-digits
sh download.sh
cd ..
npx kosmtik serve labels-no-significant-digits/project.mml
cd maki-amenities
sh download.sh
cd ..
npx kosmtik serve maki-amenities/project.mml
cd octocat-mask
sh download.sh
cd ..
npx kosmtik serve octocat-mask/project.mml
# Optional, you can take a look if curious
# cd osm-data-browser
# sh processing.sh
# cd ..
npx kosmtik serve osm-data-browser/project.mml
cd pattern-compositing-smoothing
sh download.sh
cd ..
npx kosmtik serve pattern-compositing-smoothing/project.mml
# Need a PostgreSQL database with PostGIS (if PostGIS 3, uncomment line mentioning it in `pgraster-source/download.sh`)
cd pgraster-source
sh download.sh
cd ..
npx kosmtik serve pgraster-source/project.mml
cd proportional-symbol
sh download.sh
cd ..
npx kosmtik serve proportional-symbol/project.mml
cd shield-placements
sh download.sh
cd ..
npx kosmtik serve shield-placements/project.mml
cd single-tint-band
sh download.sh
cd ..
npx kosmtik serve single-tint-band/project.mml
cd smart-halos
sh download.sh
cd ..
npx kosmtik serve smart-halos/project.mml
# Need a PostgreSQL database with PostGIS
cd sql-on-the-fly
sh download.sh
sh process.sh
cd ..
npx kosmtik serve sql-on-the-fly/project.mml
cd stars
sh download.sh
cd ..
npx kosmtik serve stars/project.mml
This project depends from one of the "Colorize alpha" layer. Run it before or the sample will not work!
cd svg-transforms
sh download.sh
cd ..
npx kosmtik serve svg-transforms/project.mml
# cd tint-bands
# sh download.sh
# cd ..
# npx kosmtik serve tint-bands/project.mml
# You could run previous commented code but to avoid downloading again
# `10m-admin-0-countries.shp`, you can use a `localconfig.js` file to
# overload default configuration to reuse `arrrrrrr/data/10m-admin-0-countries.shp`. It's done by running the following:
npx kosmtik serve --localconfig localconfig.js tint-bands/project.mml
You can see an example below:
# Using kosmtik
npx kosmtik export tint-bands/project.mml --format xml > tint-bands/project.xml
# Using carto (if `npm i carto`)
npx carto tint-bands/project.mml > tint-bands/project.xml
npx kosmtik export tint-bands/project.mml --localconfig localconfig.js --width 4000 --height 2400 --output /tmp/out.png --bounds=-180,-35,180,70 --format png --scale 4 --zoom 4
Some project directories contain setup scripts (e.g. convert.py
) and other notes (e.g. notes.md
)
If you encounter a project that does not load and is missing a README with setup instructions, then feel free to create an issue and I will add some details.
These projects specifically require setup:
dynamic-http
requires running a local python server in order to support data refresh:
python dynamic-http/server.py
- Dane Springmeyer for most work at original repository https://github.com/ThomasG77/kosmtik-examples/ (PS: we made some additional samples but this repo is more an update at the moment)