-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
This script runs from command line, with the executable create_maps. The generated maps are saved to the subdirectory out of the data directory.
The simplest usage is with the only mandatory option -p followed by the province code:
create_map -p PAIt creates a map of the given province (in this case Palermo) without highlighting any comune.
If the province shares borders with other states and/or Italian regions, add these with the options -r and -f. For example, the province of Bolzano borders with the regions of Lombardia and Veneto, plus with the countries of Austria and Switzerland, so the command will look like this:
create_map -p BZ -r LOM,VEN -f AT,CHTo show the list of the codes of provinces, regions and countries, use respectively the options -P, -R or -F.
For specifying a comune in particular, use the -c option, followed by the name of the comune (in case of multi-language names, use the Italian one):
create_map -p CA -c "Quartu Sant'Elena"This will create a map with the territory of the given comune highlighted. Use the quotes around the name only if it contains spaces or apostrophes.
Finally, the option -C will generate the map of each comune of the province into a subdirectory of the out directory.
Here is a detailed list of all the command line options. For most of them there is a short (e.g. -p) and a long (e.g. --province) form, for the others only the long one. You can also show a detailed summary of these options through the command create_map -h.
- --css-path
- -S, --simplify
- --svg-width
- -b, --bb-padding
- -n, --north-padding
- -s, --south-padding
- -w, --west-padding
- -e, --east-padding
These options specify the geographical entities that will be shown in the map.
Specify in the argument the code of the province to display. This is the only mandatory option.
For example:
create_map -p PAgenerates a map of the province of Palermo and its surroundings, which include the bordering provinces of the same region.
Use -P to display the codes of all the Italian provinces or metropolitan cities.
If a province borders other regions use this option to specify them, so they will be shown in the surroundings. Use a comma-separated lists of codes in the argument.
The following command:
create_map -p AP -r ABR,UMB,LAZcreates a map of the province of Ascoli Piceno whose surroundings include the bordering regions of Abruzzo, Umbria and Lazio.
Use -R to list the codes of the 20 Italian regions.
If a province borders foreign countries, these can be shown in its surroundings by using this option. Use a comma-separated lists of codes in the argument.
For example:
create_map -p AO -r PIE -f FR,CHresults in a map of the province of Aosta (actually the region of Valle d'Aosta, since it has no provinces) with the surrounding entities, that is the region of Piemonte and the contries of France and Switzerland.
Use -F to display the codes of the six countries that share a border with Italy.
The default output is a map of the province with the boundaries of its comuni inside, without any further detail. The following options allow to highlight a specific comune.
If you pass a name of a comune as argument of this option, the script will create a regular map of the province with the territory of the given comune highlighted in another color.
The argument must be surrounded by quotes (") if it includes spaces and/or apostrophes. If the comune has official names in different languages, use the Italian one.
This option is ignored if -C is used.
For example:
create_map -p NU -c "Villa Sant'Antonio"generates a map of the province of Nuoro that highlights the territory of the comune of Villa Sant'Antonio.
Use this option, with no arguments, to create a map of each comune of the province (as if it is created by the option -c). The generated maps are saved in a subdirectory of the output directory, named like the province. Using this options ignores overrides -c.
For example:
create_map -p LE -Ccreates a map for each comune of the province of Lecce and saves it into a subdirectory named Lecce of the output directory.
These options are used for displaying province, region and country codes.
Display a list of the codes used by the option -p. The 14 metropolitan cities are shown first, then the provinces, all in alphabetical order.
They correspond to the ISO 3166-2:IT code without the prefix IT-.
Display a list of the codes used by the option -r.
Display a list of the codes used by the option -f.
Use these options to change the look of the generated maps.
Specify a custom CSS stylesheet for the generated maps. The default CSS is located in style/style.css.
Please refer to the Styling section of the wiki if you want to write a custom stylesheet.
Simplify the map polygons to reduce the final file size. Its parameter is a number ranging from 1.0 (no simplification) to 0.0 (max simplification), or in other words the ratio of points kept from the original polygon. Default is 1.0.
For example:
create_map -p KR -S 0.5generates a map of the province of Crotone retaining only 50% of its original points, thus resulting in a file size roughly half of the unsimplified one.
Set the default width of the SVG map in pixels. The default value is 1600.
Set the amount of surrounding territory to display around the province map in the four directions, expressed in degrees. The default is 0.05.
Set the amount of surrounding territory to display around the province map only for the North direction, expressed in degrees. The default is 0.05.
Set the amount of surrounding territory to display around the province map only for the South direction, expressed in degrees. The default is 0.05.
Set the amount of surrounding territory to display around the province map only for the West direction, expressed in degrees. The default is 0.05.
Set the amount of surrounding territory to display around the province map only for the East direction, expressed in degrees. The default is 0.05.
Use this option to set a different directory for the data. This directory contains the source datasets and the tmp and out subdirectories. The default data directory is data.
Use this options without arguments if you want to include the OpenStreetMap metadata for each displayed entity. This could result in large file size.
This option, without arguments, prevents the tmp directory to be cleaned by intermediate files after finish. Used for debugging purposes.
Show a brief summary of the command line options and exit.