{"id":17218442,"url":"https://github.com/perliedman/ocad2geojson","last_synced_at":"2025-04-09T07:09:43.258Z","repository":{"id":46001996,"uuid":"150108710","full_name":"perliedman/ocad2geojson","owner":"perliedman","description":"JavaScript OCAD file reader and exporter for GeoJSON, SVG and Mapbox Style Spec","archived":false,"fork":false,"pushed_at":"2025-03-24T09:22:56.000Z","size":2700,"stargazers_count":41,"open_issues_count":5,"forks_count":4,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-02T06:09:34.946Z","etag":null,"topics":["geojson","gis","mapbox-gl-js","ocad","orienteering","orienteering-maps","svg"],"latest_commit_sha":null,"homepage":"https://www.liedman.net/ocad2geojson/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perliedman.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}},"created_at":"2018-09-24T13:41:18.000Z","updated_at":"2025-03-24T09:23:00.000Z","dependencies_parsed_at":"2024-08-11T22:23:10.843Z","dependency_job_id":"3c73a8f4-2f45-45b8-ba46-45e773df0dc3","html_url":"https://github.com/perliedman/ocad2geojson","commit_stats":{"total_commits":279,"total_committers":7,"mean_commits":"39.857142857142854","dds":"0.43727598566308246","last_synced_commit":"c8a3ed625483bc976aabd0d8618599e4349962db"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2geojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2geojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2geojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2geojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perliedman","download_url":"https://codeload.github.com/perliedman/ocad2geojson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994122,"owners_count":21030050,"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":["geojson","gis","mapbox-gl-js","ocad","orienteering","orienteering-maps","svg"],"created_at":"2024-10-15T03:46:50.129Z","updated_at":"2025-04-09T07:09:43.243Z","avatar_url":"https://github.com/perliedman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OCAD to GeoJSON\n\n![Example Map Output 1](example-images/1.png)\n![Example Map Output 2](example-images/2.png)\n![Example Map Output 3](example-images/3.png)\n\nJavaScript library and command line tool for exporting [OCAD](https://www.ocad.com/) map files to open formats:\n\n- [GeoJSON](http://geojson.org/)\n- SVG\n- PDF\n- [Mapbox Style Spec](https://www.mapbox.com/mapbox-gl-js/style-spec/)\n- [QGIS](https://qgis.org/en/site/) / QML (very rough and incomplete)\n\nYou can use this to get geo/GIS data out of an OCAD file. OCAD version 10, 11 and 12 and 2018 files are mostly supported.\n\n## See it in action\n\n* [O-scout](https://o-scout.vercel.app/) - Online app for viewing OCAD maps, course settings and exporting to PDF or SVG\n* [ocad2tiles](https://github.com/perliedman/ocad2tiles/) - command line tool for generating tiled maps or creating images (PNG, JPEG, SVG) from OCAD maps\n* ...or just install `npm install ocad2geojson` and use the library in your own project!\n\n## Usage\n\n### Command line\n\nInstalling the `ocad2geojson` package will also install the binary `ocad-tool` in\nyour path.\n\nIt can be used to get data out of an OCAD file in various formats:\n\n```\nUsage: ocad-tool [options] [command]\n\nOptions:\n  -h, --help                       display help for command\n\nCommands:\n  info [options] \u003cpath\u003e            display file info\n  export [options] \u003cpath\u003e \u003coutpu\u003e  export OCAD map into another format\n  help [command]                   display help for command\n```\n\nUse `info` to extract information from OCAD files:\n\n```\nUsage: ocad-tool info [options] \u003cpath\u003e\n\ndisplay file info\n\nOptions:\n  --symbols                   dump symbol information\n  --filter-symbols \u003cnumbers\u003e  only show numbered symbols\n  --icons-bits                display symbols' iconBits property (hidden by default)\n  -h, --help                  display help for command\n```\n\nUse `export` to export OCAD files to other formats:\n\n```\nUsage: ocad-tool export [options] \u003cpath\u003e \u003coutpu\u003e\n\nexport OCAD map into another format\n\nOptions:\n  -f, --format \u003cstring\u003e  output format (geojson, svg, qml, mvt), otherwise guessed from output file extension\n  --export-hidden        include hidden objects in the export (default: false)\n  -h, --help             display help for command\n```\n\n### API\n\nExported functions:\n\n- `readOcad` - read and parse OCAD maps\n- `ocadToGeoJson` - transform objects from a parsed OCAD file into GeoJSON\n- `ocadToSvg` - transform a parsed OCAD map into an SVG document\n- `ocadToMapboxGlStyle` - transform symbol styles of a parsed OCAD file into Mapbox GL style spec\n- `ocadToQml` - transform a parsed OCAD file into QML\n\nBegin by parsing an OCAD file with `readOcad`: this function accepts a file path\nas string, or a [Buffer](https://nodejs.org/api/buffer.html) instance to read from.\n`readOcad` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will resolve to the parsed result.\n\nExample, turning an OCAD file into GeoJSON and Mapbox GL styles:\n\n```js\nconst { readOcad, ocadToGeoJson, ocadToMapboxGlStyle } = require('../')\n\nreadOcad(filePath).then(ocadFile =\u003e {\n  const geojson = ocadToGeoJson(ocadFile)\n  console.log(JSON.stringify(geojson))\n  const layerStyles = ocadToMapboxGlStyle(ocadFile)\n  console.log(JSON.stringify(layerStyles))\n})\n```\n\nI will try to write some docs, in the meantime, check out the [examples directory](examples) for some examples of how to use this module.\n\n## Missing features\n\nSome OCAD features are currently not fully supported:\n\n- Hatch fills are not supported when exported to Mapbox styles and emulated by semi-transparent fills\n- Fill patterns are ~~not supported~~ supported for SVG and PDF exports\n- ~~Curves are not supported~~ Bezier curves now supported!\n- ~~Some texts are not exported~~\n- ~~SVG / PDF currently lack any text~~ SVG and PDF now have text support\n- ...and probably a lot more that I do not even know is missing\n\nFeel free to open issues for lacking features - I will not promise to add them, but good to keep track of what is missing.\n\nHave you built something with this module, or want to help out improving it? I'd love to know; open an issue, pull request or contact [per@liedman.net](mailto:per@liedman.net).\n\n## License\n\nSince I highly dislike the closed source nature of some of the software used in orienteering (well, mostly OCAD),\nthis software is licensed under [AGPL-3.0](LICENSE); in short, to use this software, you must distribute source.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperliedman%2Focad2geojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperliedman%2Focad2geojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperliedman%2Focad2geojson/lists"}