{"id":13505573,"url":"https://github.com/mapbox/tokml","last_synced_at":"2026-01-10T12:01:44.223Z","repository":{"id":11080911,"uuid":"13427749","full_name":"mapbox/tokml","owner":"mapbox","description":"Convert GeoJSON to KML.","archived":false,"fork":false,"pushed_at":"2018-05-06T02:00:31.000Z","size":97,"stargazers_count":189,"open_issues_count":9,"forks_count":91,"subscribers_count":120,"default_branch":"master","last_synced_at":"2025-03-03T13:40:15.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mapbox.github.io/tokml/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapbox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-08T22:56:47.000Z","updated_at":"2024-12-16T11:17:21.000Z","dependencies_parsed_at":"2022-08-28T06:00:58.772Z","dependency_job_id":null,"html_url":"https://github.com/mapbox/tokml","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Ftokml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Ftokml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Ftokml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Ftokml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapbox","download_url":"https://codeload.github.com/mapbox/tokml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262490,"owners_count":20749170,"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":[],"created_at":"2024-08-01T00:01:09.961Z","updated_at":"2026-01-10T12:01:43.834Z","avatar_url":"https://github.com/mapbox.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.org/mapbox/tokml.png)](https://travis-ci.org/mapbox/tokml) [![Coverage Status](https://coveralls.io/repos/mapbox/tokml/badge.png)](https://coveralls.io/r/mapbox/tokml)\n\n# tokml\n\nConvert [GeoJSON](http://geojson.org/) to [KML](https://developers.google.com/kml/documentation/).\n\n## Usage\n\nwith node/browserify\n\n    npm install --save tokml\n\notherwise:\n\n    wget https://raw.github.com/mapbox/tokml/master/tokml.js\n\nas a binary:\n\n    npm install -g tokml\n    tokml file.geojson \u003e file.kml\n    tokml \u003c file.geojson \u003e file.kml\n\n## Example\n\n```js\n// kml is a string of KML data, geojsonObject is a JavaScript object of\n// GeoJSON data\nvar kml = tokml(geojsonObject);\n\n// grab name and description properties from each object and write them in\n// KML\nvar kmlNameDescription = tokml(geojsonObject, {\n    name: 'name',\n    description: 'description'\n});\n\n// name and describe the KML document as a whole\nvar kmlDocumentName = tokml(geojsonObject, {\n    documentName: 'My List Of Markers',\n    documentDescription: \"One of the many places you are not I am\"\n});\n```\n\n## API\n\n### `tokml(geojsonObject, [options])`\n\nGiven [GeoJSON](http://geojson.org/) data as an object, return KML data as a\nstring of XML.\n\n`options` is an optional object that takes the following options:\n\n**The property to name/description mapping:** while GeoJSON supports freeform\n`properties` on each feature, KML has an expectation of `name` and `description`\nproperties that are often styled and displayed automatically. These options let\nyou define a mapping from the GeoJSON style to KML's.\n\n* `name`: the name of the property in each GeoJSON Feature that contains\n  the feature's name\n* `description`: the name of the property in each GeoJSON Feature that contains\n  the feature's description\n\n**Timestamp:** KML can associate features with a moment in time via the `TimeStamp` tag.  GeoJSON doesn't\nhave a comparable field, but a custom property can be mapped\n\n* `timestamp`: the name of the property in each GeoJSON Feature that contains \n  a timestamp in XML Schema Time (yyyy-mm-ddThh:mm:sszzzzzz)  \n\n**Document name and description**: KML supports `name` and `description` properties\nfor the full document.\n\n* `documentName`: the name of the full document\n* `documentDescription`: the description of the full document\n\n**[simplestyle-spec](https://github.com/mapbox/simplestyle-spec)** support:\n\n* `simplestyle`: set to `true` to convert simplestyle-spec styles into KML styles\n\n## Development\n\nRequires [node.js](http://nodejs.org/) and [browserify](https://github.com/substack/node-browserify):\n\nTo build `tokml.js`:\n\n    make\n\nTo run tests:\n\n    npm install\n    npm test\n","funding_links":[],"categories":["Data conversion tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Ftokml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapbox%2Ftokml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Ftokml/lists"}