{"id":17218439,"url":"https://github.com/perliedman/ocad2tiles","last_synced_at":"2025-09-07T02:40:31.143Z","repository":{"id":44387720,"uuid":"326168068","full_name":"perliedman/ocad2tiles","owner":"perliedman","description":"Create raster images and tiles (image pyramids) from OCAD map files","archived":false,"fork":false,"pushed_at":"2025-01-06T17:53:46.000Z","size":707,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-30T04:18:14.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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,"zenodo":null}},"created_at":"2021-01-02T11:28:05.000Z","updated_at":"2025-01-06T17:53:50.000Z","dependencies_parsed_at":"2025-04-13T23:36:40.130Z","dependency_job_id":"ed8a402a-6430-4dfa-a157-f419e30554a0","html_url":"https://github.com/perliedman/ocad2tiles","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/perliedman/ocad2tiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2tiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2tiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2tiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2tiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perliedman","download_url":"https://codeload.github.com/perliedman/ocad2tiles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Focad2tiles/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266483877,"owners_count":23936433,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-15T03:46:49.772Z","updated_at":"2025-07-22T11:33:46.223Z","avatar_url":"https://github.com/perliedman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OCAD to Tiles\n\nCreates raster images and tiles from an OCAD map file. Tiles are suitable for use with for example [Leaflet](https://leafletjs.com/) or [OpenLayers](https://openlayers.org/).\n\nFor a more thorough introduction, see this [tutorial on making OCAD maps for the web](https://www.liedman.net/2022/01/05/orienteering-maps-for-the-web/). \n\n## Installing\n\nTo use command line tools:\n\n```shell\nnpm install -g ocad2tiles\n```\n\nTo use as a library in your project:\n\n```shell\nnpm install ocad2tiles\n```\n\n## Command line usage\n\n### Create tiles\n\nThis will create a set of tiles (small, square raster images, sometimes also called image pyramid or image mosaic) suitable for use in map clients like Leaflet or OpenLayers.\n\nThe tool will create a number of directories, one per zoom level, in the output path. It also creates a small demo HTML page, `index.html`, where you can see the tiles result in a Leaflet map.\n\nOptionally, using the `--serve` option, the tool will start a web server which\ncan serve the tiles, as well as the demo web page. This is a great way to quickly\ntest configuration without generating a lot of tiles.\n\nTiles are currently always written in PNG format.\n\nExample:\n\n```shell\nocad2tiles my-map-file.ocd /my/output/path\n```\n\nDetailed usage:\n\n```\nUsage: ocad2tiles [options] [OCAD MAP FILE] [OUTPUT PATH]\n\nOptions:\n  -n,--number-zoomlevels \u003cnumber\u003e  Number of zoom levels to generate (default: 4)\n  -o,--zoomlevel-offset \u003cnumber\u003e   Number to add to zoom level numbers (default: 0)\n  -s,--tile-size \u003cnumber\u003e          Tile size in pixels (default: 256)\n  -r,--base-resolution \u003cnumber\u003e    Base (most zoomed in) resolution used (default: 1)\n  -f,--fill \u003cstring\u003e               Background color (HTML color, transparent as default)\n  -s,--serve                       Run as webserver, serving the tiles\n  -p,--port \u003cnumber\u003e               Port to run webserver on (see --serve) (default: 8080)\n  --show-hidden                    Include hidden symbols in the output\n  -h, --help                       display help for command\n```\n\n### Create image\n\nMake a single raster image from an OCAD map file.\n\nSupported output formats:\n\n- PNG\n- JPEG\n- SVG\n- PDF (basic support, currently limited control over page format and scale)\n- WEBP\n- GIF\n- TIFF\n- GeoJSON (not really an image, but convenient)\n\nOutput format is determined by the output path's extension\n\nExample:\n\n```shell\nocad2image my-map-file.ocd my-image.png\n```\n\nDetailed usage:\n\n```\nUsage: ocad2image [options] [OCAD MAP FILE] [OUTPUT PATH]\n\nOptions:\n  -b,--bounds \u003cstring\u003e      bounds (xmin, ymin, xmax, ymax) in map CRS coordinates; defaults to map bounds\n  -r,--resolution \u003cnumber\u003e  resolution in meters per pixel (default: 1)\n  -f,--fill \u003cstring\u003e        Background color (HTML color, transparent as default)\n  --show-hidden             Include hidden symbols in the output\n  -h, --help                display help for command\n```\n\n## API\n\n### OcadTiler\n\n```js\nconst OcadTiler = require('ocad2tiles')\nconst { readOcad } = require('ocad2geojson')\nconst metersPerPixel = 1\n\nreadOcad(pathToOcadMap).then(ocadFile =\u003e {\n  const tiler = new OcadTiler(ocadFile)\n  tiler.render(tiler.bounds, metersPerPixel, { outputPath: 'test.png' })\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperliedman%2Focad2tiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperliedman%2Focad2tiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperliedman%2Focad2tiles/lists"}