Ruby gem used to create SVG maps of Italian comuni (i.e. municipalities) and provinces from OSM data.
I made this script to create SVG maps of Italian administrative subdivisions, namely regions, provinces and comuni (singular: comune), intending to publish them on Wikipedia, like I did several years ago.
This time I chose a more complete and visually pleasant appearance (with the option to further customize them via CSS stylesheet, as explained in the wiki), showing the nearby provinces, regions and nations. Moreover, when hovering above a subdivision on the map, its name will be shown in a tooltip and its boundaries will be highlighted (though this feature can be turned off modifying the CSS).
This is how a map of a comune will look like with the default style (in this case Rimini, province of Rimini, region Emilia-Romagna):
The comune of interest is shown in red, whereas the other comuni of the province are in yellow. A lighter shade of yellow is for the other provinces of the same region, whereas the neighboring regions are in orange. Finally, the independent nation of San Marino is colored in gray.
Note: if you don't see the tooltips and the highlighted boundaries, try to right click on the image and select Show image.
You can perform some further visual improvements on the generated maps. See the related wiki page for details.
This script uses Mapshaper and osmtogeojson to perform all the magics on the map data. If they are not installed nothing will work. And, of course, you need Ruby too! I used version 2.7, but it should work at least with 2.3.
Before the first use you need to download the source datasets. Please follow the instructions in the corresponding wiki page.
To manually build the gem, run the following script:
$ ./build_gem.sh
To install it in your system, execute:
$ gem install svg_maps_italy-<version>.gem
This script runs from command line, with the executable create_maps
. The generated maps are put
in the subdirectory out
of the data directory.
The simplest usage is the following, using the only mandatory option -p
, followed by the province
code:
create_map -p PA
It creates a map of the given province (in this case Palermo) without highlighting any comune.
For more complex usage, please refer to the related wiki page.
Bug reports and pull requests are welcome on GitHub at https://github.com/vonvikken/svg-maps. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
Everyone interacting in the SvgMapsItaly project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
This project is distributed under Apache 2.0 license.
All the map data are from OpenStreetMaps (copyright notice).