{"id":13555885,"url":"https://github.com/kosmtik/kosmtik","last_synced_at":"2025-05-14T15:11:27.772Z","repository":{"id":43148754,"uuid":"24325238","full_name":"kosmtik/kosmtik","owner":"kosmtik","description":"Make maps with OpenStreetMap and Mapnik","archived":false,"fork":false,"pushed_at":"2025-03-13T15:53:26.000Z","size":3227,"stargazers_count":734,"open_issues_count":106,"forks_count":88,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-04-05T19:06:15.810Z","etag":null,"topics":["cartocss","javascript","kosmtik","mapnik","nodejs","openstreetmap"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kosmtik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-09-22T11:03:33.000Z","updated_at":"2025-03-25T21:38:46.000Z","dependencies_parsed_at":"2022-09-06T18:50:09.589Z","dependency_job_id":"94508e32-23cf-4d0e-bdd6-3db31d8b9166","html_url":"https://github.com/kosmtik/kosmtik","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosmtik%2Fkosmtik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosmtik%2Fkosmtik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosmtik%2Fkosmtik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosmtik%2Fkosmtik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kosmtik","download_url":"https://codeload.github.com/kosmtik/kosmtik/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631627,"owners_count":21136553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cartocss","javascript","kosmtik","mapnik","nodejs","openstreetmap"],"created_at":"2024-08-01T12:03:29.019Z","updated_at":"2025-04-12T20:37:57.286Z","avatar_url":"https://github.com/kosmtik.png","language":"JavaScript","readme":"# Kosmtik\n\n[![Join the chat at https://gitter.im/kosmtik/kosmtik](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kosmtik/kosmtik?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Dependency Status](https://david-dm.org/kosmtik/kosmtik.svg)](https://david-dm.org/kosmtik/kosmtik)\n[![Node.js CI](https://github.com/kosmtik/kosmtik/actions/workflows/node.js.yml/badge.svg)](https://github.com/kosmtik/kosmtik/actions/workflows/node.js.yml)\n\nVery lite but extendable mapping framework to create Mapnik ready maps with\nOpenStreetMap data (and more).\n\nFor now, only Carto based projects are supported (with .mml or .yml config),\nbut in the future we hope to plug in MapCSS too.\n\n\n## Lite\n\nOnly the core needs:\n\n- project loading\n- local configuration management\n- tiles server for live feedback when coding\n- exports to common formats (Mapnik XML, PNG…)\n- hooks everywhere to make easy to extend it with plugins\n\n\n## Screenshot\n\n![screenshot](https://raw.github.com/kosmtik/kosmtik/master/screenshot.png \"Screenshot of Kosmtik\")\n\n\n## Install or Update\n\nNote: Node.js versions are moving very fast, kosmtik and its dependencies may not be compatible\nwith a current release and the npm package may be out of date.\n\n### Install from source (recommended)\n\nClone this repository and install with `npm`:\n\n```\ngit clone https://github.com/kosmtik/kosmtik.git\nnpm install -g\n```\n\nThis might need root/Administrator rights. If you cannot install globally\nyou can also install in a local Node environment with\n\n    npm install\n\nThis will create a `node_modules/kosmtik` folder. You then have to replace all occurences of `kosmtik`\nbelow with `node node_modules/kosmtik/index.js`.\n\n### Install package:\n\nRequires Node.js v9.3.0. Using [npm](https://github.com/creationix/nvm) (a Node.js version manager):\n\n```\nnvm install v9.3.0\nnvm use v9.3.0\nnpm install -g kosmtik\n```\nThis will install Node.js v9.3.0 and kosmtik for the current user.\n\n## Usage\n\nTo get command line help, run:\n\n    kosmtik -h\n\nTo run a Carto project (or `.yml`, `.yaml`):\n\n    kosmtik serve \u003cpath/to/your/project.mml\u003e\n\nThen open your browser at http://127.0.0.1:6789/.\n\n\nYou may also want to install plugins. To see the list of available ones, type:\n\n    npm search kosmtik\n\n\n## Configuration file\n\nBy default Kosmtik places a configuration file into `$HOMEDIR/.config/kosmtik.yml`\nwhere $HOMEDIR is your home directory. You can change that by setting the\nenvironment variable `KOSMTIK_CONFIGPATH` to the appropriate file.\n\nIn the configuration file Kosmtik stores information about installed plugins and\nyou can change certain settings that should be persistent between runs.\n\nConfigurable settings are:\n* autoReload (true/false)\n* backendPolling (true/false)\n* cacheVectorTiles (true/false)\n* dataInspectorLayers (object with layer names and true/false)\n* exportFormats (array of strings)\n* showCrosshairs (true/false)\n\n## Local config\n\nBecause you often need to change the project config to match your\nlocal env, for example to adapt the database connection credentials,\nkosmtik comes with an internal plugin to manage that. You have two\noptions: with a json file named `localconfig.json`, or with a js module\nname `localconfig.js`.\n\nPlace your localconfig.js or localconfig.json file in the same directory as your\ncarto project (or `.yml`, `.yaml`).\n\nIn both cases, the behaviour is the same, you create some rules to target\nthe configuration and changes the values. Those rules are started by the\nkeyword `where`, and you define which changes to apply using `then`\nkeyword. You can also filter the targeted objects by using the `if` clause.\nSee the examples below to get it working right now.\n\n\n\n### Example of a json file\n```json\n[\n    {\n        \"where\": \"center\",\n        \"then\": [-122.25, 49.25, 10]\n    },\n    {\n        \"where\": \"Layer\",\n        \"if\": {\n            \"Datasource.type\": \"postgis\"\n        },\n        \"then\": {\n            \"Datasource.dbname\": \"vancouver\",\n            \"Datasource.password\": \"\",\n            \"Datasource.user\": \"ybon\",\n            \"Datasource.host\": \"\"\n        }\n    },\n    {\n        \"where\": \"Layer\",\n        \"if\": {\n            \"id\": \"hillshade\"\n        },\n        \"then\": {\n            \"Datasource.file\": \"/home/ybon/Code/maps/hdm/DEM/data/hillshade.vrt\"\n        }\n    }\n]\n```\n\n### Example of a js module\n```javascript\nexports.LocalConfig = function (localizer, project) {\n    localizer.where('center').then([29.9377, -3.4216, 9]);\n    localizer.where('Layer').if({'Datasource.type': 'postgis'}).then({\n        \"Datasource.dbname\": \"burundi\",\n        \"Datasource.password\": \"\",\n        \"Datasource.user\": \"ybon\",\n        \"Datasource.host\": \"\"\n    });\n    // You can also do it in pure JS\n    project.mml.bounds = [1, 2, 3, 4];\n};\n\n```\n\n## Custom renderers\n\nBy default Kosmtik uses [Carto](https://github.com/mapbox/carto) to render the style. Via plugins\nit is possible to use other renderers or Carto implementations. You can switch the renderer installing\nthe appropriate plugin and by passing the command line option `--renderer NAME`. `NAME` refers to the\nrenderer name (e.g. `carto` for the default renderer or `magnacarto` for the Magnacarto renderer).\n\n## Known plugins\n\n- [kosmtik-overpass-layer](https://github.com/kosmtik/kosmtik-overpass-layer): add Overpass Layer in your carto project\n- [kosmtik-fetch-remote](https://github.com/kosmtik/kosmtik-fetch-remote): automagically fetch remote files in your layers\n- [kosmtik-place-search](https://github.com/kosmtik/kosmtik-place-search): search places control\n- [kosmtik-overlay](https://github.com/kosmtik/kosmtik-overlay): add an overlay above the map\n- [kosmtik-open-in-josm](https://github.com/kosmtik/kosmtik-open-in-josm): open JOSM with current view\n- [kosmtik-map-compare](https://github.com/kosmtik/kosmtik-map-compare): display a map side-by-side with your work\n- [kosmtik-osm-data-overlay](https://github.com/kosmtik/kosmtik-osm-data-overlay): display OSM data on top of your map\n- [kosmtik-tiles-export](https://github.com/kosmtik/kosmtik-tiles-export): export a tiles tree from your project\n- [kosmtik-mbtiles-export](https://github.com/kosmtik/kosmtik-mbtiles-export): export your project in MBTiles\n- [kosmtik-magnacarto](https://github.com/kosmtik/kosmtik-magnacarto): Magnacarto renderer for CartoCSS\n\nRun `npm search kosmtik` to get an up to date list.\n","funding_links":[],"categories":["nodejs","JavaScript","Clients","Applications / Command line tools","Visualization"],"sub_categories":["Applications / Command line tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkosmtik%2Fkosmtik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkosmtik%2Fkosmtik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkosmtik%2Fkosmtik/lists"}