├── LICENSE ├── README.md ├── images ├── map_1.png ├── map_2_export.png ├── map_3_select_area.png ├── map_4_overpass.png └── plotting_image.png ├── index.html ├── map.osm └── map_to_grid.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Piet Brömmel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Plotting Maps 2 | 3 | This is a tool to easily create OpenStreetMap SVG maps to plot them with a pen plotter. Check out the tool here: https://piebro.github.io/plotting-maps. There, you can upload OSM exports and render them as SVGs consisting only of lines, making it very pen plotter-friendly. 4 | 5 | ## How to Use 6 | 7 | 1. Use a **Desktop Browser** or enable desktop browsing on mobile. 8 | 2. Go to https://www.openstreetmap.org. 9 | 3. Navigate to a place of interest: 10 | ![Screenshot of OpenStreetMap](images/map_1.png) 11 | 4. Click on "Export" (only visible on desktop): 12 | ![Screenshot of OpenStreetMap with an arrow pointing to the "Export" button](images/map_2_export.png) 13 | 5. Select the area of interest: 14 | ![Screenshot of OpenStreetMap with an arrow pointing to the "Manually select a different area" link](images/map_3_select_area.png) 15 | 6. Download the data via the Overpass API (you can also use the export button, but the size of the export is more limited): 16 | ![Screenshot of OpenStreetMap with an arrow pointing to the "Overpass API" link](images/map_4_overpass.png) 17 | 7. Download the file and upload it to https://piebro.github.io/plotting-maps using the "Upload OSM Export" button. 18 | 8. Set all options and align the map by dragging and zooming. 19 | 9. Download the map using the "Download Map" button. 20 | 21 | An alternative way to obtain OSM Map Extracts is to use a [public Overpass API instance](https://wiki.openstreetmap.org/wiki/Overpass_API#Public_Overpass_API_instances) and download an area with a query. 22 | 23 | ## Plot the Map 24 | 25 | I use [vpype](https://github.com/abey79/vpype) and [axicli](https://axidraw.com/doc/cli_api/) to plot the map with my [AxiDraw Pen Plotter](https://shop.evilmadscientist.com/productsmenu/846). 26 | 27 | I use linemerge and linesort to make the plotting faster, 28 | ```bash 29 | vpype read map.svg \ 30 | linemerge --tolerance 1mm \ 31 | linesort \ 32 | write \ 33 | --page-size 400x266mm \ 34 | --center \ 35 | plot.svg 36 | ``` 37 | 38 | create a preview to check the plotting time, 39 | ```bash 40 | axicli plot.svg --model 2 -vg3 --speed_pendown 15 --report_time -o preview.svg 41 | ``` 42 | 43 | and finally, plot the map. 44 | ```bash 45 | axicli plot.svg --model 2 --speed_pendown 15 && axicli -m align 46 | ``` 47 | 48 | Plotting a map on an A3 piece of paper. 49 | 50 | ![Image of a plotter plotting a map](images/plotting_image.png) 51 | 52 | If you want to plot the map on mulitple piece of papers, you can use the `map_to_grid.sh` script. 53 | 54 | A similar, cool project with a different UX and output is: https://github.com/anvaka/city-roads/ and another project to visualize maps in a custom way (also for plotters) is: https://github.com/marceloprates/prettymaps 55 | 56 | ## Contributing 57 | 58 | Contributions to this project are welcome. Feel free to report bugs, suggest ideas, or create merge requests. 59 | 60 | ## Developing 61 | 62 | The project uses [Prettier](https://prettier.io/playground/) for linting javascript with a `print-width` of 120, `tab-width` of 4, and using single quotes. 63 | 64 | ## Website Statistics 65 | 66 | There is lightweight tracking for the website using Plausible. Anyone interested can view these statistics at https://plausible.io/piebro.github.io%2Fplotting-maps. It's worth noting that these statistics might be an underestimate as many users, including myself, use AdBlockers. 67 | 68 | ## License 69 | 70 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. The Example map.osm file is licensed under [ODbL](https://www.openstreetmap.org/copyright) -------------------------------------------------------------------------------- /images/map_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piebro/plotting-maps/a3bea76be876993fadd295357986201a73870c57/images/map_1.png -------------------------------------------------------------------------------- /images/map_2_export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piebro/plotting-maps/a3bea76be876993fadd295357986201a73870c57/images/map_2_export.png -------------------------------------------------------------------------------- /images/map_3_select_area.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piebro/plotting-maps/a3bea76be876993fadd295357986201a73870c57/images/map_3_select_area.png -------------------------------------------------------------------------------- /images/map_4_overpass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piebro/plotting-maps/a3bea76be876993fadd295357986201a73870c57/images/map_4_overpass.png -------------------------------------------------------------------------------- /images/plotting_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piebro/plotting-maps/a3bea76be876993fadd295357986201a73870c57/images/plotting_image.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Plotting OSM Maps 6 | 7 | 8 | 9 | 10 | 11 | 78 | 79 | 80 | 332 | 333 | 334 | 335 |
336 |

Tool to Plot OpenStreetMap Exports with a Pen Plotter

337 | 338 | 339 | 340 | 341 | 342 |
343 | 344 | 345 |
346 | 347 | 348 |
349 |
350 | 351 |
352 | 353 | 354 |
355 | 356 |
357 | 358 | 359 |
360 | 361 |
362 | 363 | 364 |
365 | 366 |
367 | 368 | 369 |
370 | 371 |
372 | 373 | 374 |
375 | 376 |
377 | 378 | 379 |
380 | 381 |
382 | 383 | 384 |
385 | 386 |
387 | 388 | 389 |
390 | 391 |
392 | 393 | 394 |
395 | 396 |
397 | 398 | 399 | 400 | -------------------------------------------------------------------------------- /map_to_grid.sh: -------------------------------------------------------------------------------- 1 | INPUT=$1 2 | OUTPUT=out 3 | GRID_X_COUNT=3 4 | GRID_Y_COUNT=3 5 | GRID_X_LENGTH_MM=100 6 | GRID_Y_LENGTH_MM=100 7 | 8 | for i in $(seq 1 $GRID_X_COUNT); do 9 | for j in $(seq 1 $GRID_Y_COUNT); do 10 | start_crop_x=$(bc -l <<< "a=$i-1; a*$GRID_X_LENGTH_MM"); 11 | start_crop_y=$(bc -l <<< "a=$j-1; a*$GRID_Y_LENGTH_MM"); 12 | vpype read ${INPUT} crop ${start_crop_x}mm ${start_crop_y}mm ${GRID_X_LENGTH_MM}mm ${GRID_Y_LENGTH_MM}mm write --page-size ${GRID_X_LENGTH}x${GRID_Y_LENGTH}mm --center ${OUTPUT}_${i}_${j}.svg; 13 | echo "${OUTPUT}_${i}_${j}.svg" 14 | done; 15 | done; --------------------------------------------------------------------------------