Kothic MapCSS renderer and style/drules processor.
This branch keeps the original Kothic/Kontur renderer and MVT/Mapbox helpers, while also carrying the MapsMe, Organic Maps, and CoMaps style compiler behaviour in the shared MapCSS/libkomwm path.
Dependencies:
- Python >= 3.8
Python dependencies:
pip3 install -r requirements.txtTo run all unittests execute next command from project root folder:
python3 -m unittest discover -s teststhis will search for all test*.py files within tests directory
and execute tests from those files.
Before pushing changes, run the same checks as GitHub Actions:
python3 integration-tests/run_ci_checks.pyThis includes fork drules compatibility. The MAPS.ME oracle still needs
Python's lib2to3, so use the same Python 3.9 runtime as CI for a full local
run.
File integration-tests/full_drules_gen.py is intended to generate drules
files for all 6 themes from main CoMaps repo. It could be used to understand
which parts of the project are actually used by CoMaps repo.
Usage:
cd integration-tests
python3 full_drules_gen.py -d ../../../data -o drules --txtThis command will run generation for styles - default light, default dark,
outdoors light, outdoors dark, vehicle light, vehicle dark and put *.bin
and *.txt files into 'drules' subfolder.
To compare generated files with an Organic Maps / CoMaps style-data baseline, pass the matching compatibility profile, filename prefix, and baseline directory explicitly:
python3 full_drules_gen.py -d path-to/data -o drules --txt \
--compatibility-profile organicmaps \
--name-prefix drules_proto_ --compare-baseline path-to/dataThe repository intentionally supports several consumers that diverged in forks:
src/libkomwm.pykeeps MapsMe/Organic Maps/CoMaps drules generation, including priority file imports and--format-priorities-only.- Drules generation uses feature profiles:
mapcss,organicmaps,comaps,mapsme,mapsme-fallback, andomim-2016. The defaultmapcssprofile is the spec-first target for new shared work; the fork-named profiles are compatibility harnesses. The older--priority-modeand--runtime-condition-modeflags remain as explicit overrides for experiments. src/libkomb.pyandsrc/mvt_sql.pykeep the original Kothic MVT/Mapbox paths. The MapCSS package still exports_test_feature_compatibilityfor these legacy helpers.- Runtime-condition filtering is opt-in: callers that pass no runtime filter get the old unfiltered Kothic style resolution, while drules generation can ask for exact runtime-selector variants.
See docs/fork-reconciliation.md for the current fork-by-fork compatibility
matrix, the canonical mapcss profile, and the status of checked-in MapsMe
drules.
See docs/kothic-js-lineage.md for the relationship between this repository,
kothic-js, the old in-tree JavaScript files, and the historical
kothic-js-mapcss converter.