Experience in creating positional maps for Wikipedia
For several years I worked on maps that are used in Russian and other language sections of Wikipedia. In total, I have created more than 300 cards . I am not a professional cartographer, and I have no special education in this area. Apparently, I just liked making cards :)
In this article, I want to share the experience of creating maps for Wikipedia, with a focus on positional maps.
All graphic materials for Wikipedia, published under free licenses, are placed on Wikimedia Commons , this allows you to use them in any Wikimedia projects and in all language sections of Wikipedia.
Among all types of maps on Wikipedia, the so-called "positional maps" stand out. The peculiarity here is that it is not just an image of a map, but an image in a known projection, with known geographical coordinates for the corners. For such a map, in each language section where it is used, a special template is created that describes this metadata. Having such a template, we can apply it on any page by placing markers on top of the map for objects of interest to us. The coordinates of the objects are described in the form of geographical coordinates, the formulas in the templates calculate where exactly to put the marker. So, for example, you can insert a map of this region on a page about a region and mark regional centers and large cities on it.
Positional maps are used in all articles on administrative units: countries / districts / cities / towns, etc., as well as in many articles on geographical objects. It often happens that immediately after creating a positional map, it is used in 20-50 existing Wikipedia articles.
In theory, a positional map template should use two map drawings at once: a “contour” / “political” map, and a “physical” / “geographical” map with the same coordinates, projection, and dimensions. An outline map is usually vector (SVG), a physical map can be vector, but most often it is a raster (usually PNG).
There are many positional maps: they must cover all levels from the world as a whole to individual regions, small islands, etc. In addition to the positional map, the so-called A “locator” is a map on which the region of interest to us is highlighted in bright color ( an example of a locator map). Everything is relatively good at the “upper” level (world, country) with positional maps, but at the “lower” (district level), everything is often pretty bad: there are no positional maps or there are, but of insufficient quality, or made in an inappropriate / non-standard style.
For the Russian Federation alone, we have 83 entities, if we add districts to this, we will probably already receive a thousand or more administrative units, each of which needs a position map, including a contour map, a physical map, a locator map ... In addition, from time to time changes are taking the form “a new resolution has been issued”: a legal document appears that changes the boundaries of administrative units, divides / unites them, etc. And of course, in all such cases, you need to redraw one or more positional maps.
In general, I think you already understood - the cards are very necessary and they need a lot :)
Source data for maps
For positional maps, images with a free license must be used. This means that the source data for such cards must be free.
Initial data for the cards that I used:
- OpenStreetMap - the main source of vector data; but keep in mind that the data is obtained by crowdsourcing, so in some places they are dense and high-quality, in some places they are very incomplete. There are also errors in the data, so the received cards must be carefully checked.
- GSHHG - vector data as part of GMT (see below); can be used for maps of large scales, poorly suited for small scales.
- ETOPO1 (resolution ~ 1.85 km, volume ~ 890 MB), ETOPO2 (resolution 2 '~ = 3.6 km) - altitude maps, including the relief of the seabed (bathymetry).
- TOPO30 (resolution ~ = 0.9 km, volume ~ 1800 MB) - altitude map, including topography of the seabed.
- GLOBE (resolution 30 "~ = 0.9 km) - altitude map.
- SRTM (resolution SRTM3: 3 "~ = 90m) is a rather detailed height map, but because of this it is quite weighty (each file with 1x1 degree data weighs ~ 2.8 MB), so you usually only need to download the necessary files In addition, the SRTM source data has gaps that need to be closed by interpolating the missing points from neighboring ones. You can do this yourself, or use "void-filled" sources such as SRTM-Plus. SRTM is a height map for land only, does not contain data on the topography of the seabed.
In the vast majority of cases, we work with a projection that is called "equidistant cylindrical." The same projection family includes the Mercator projection and its special case - “Google projection” or “Web Mercator projection”, which is used by all major web maps. The formulas for this projection are quite simple, in addition, positional map templates already “know” this projection.
In the few remaining cases, you will have to google the desired projection and read special literature to understand how exactly the x, y coordinates are obtained from latitude and longitude. Mediawiki has a developed mechanism for calculating expressions (including those with trigonometric functions), it can be used to check your maps even before you create a position map template on them (examples can be found here ).
There are a lot of tools for creating maps (geographic information systems, GIS), including free and open source ones. But in order for the card to be open it is not necessary to use an open and free system, it is enough that the source data is open, and for you to put the open license on the finished card. (But there are probably many nuances here, I don’t presume to crawl into the field of copyright, not mine :)
To create maps, I mainly used the three programs described below.
Maperitive is a free but private product. It is extremely useful when working with OpenStreetMap data, it works with data both from the OSM website and with saved dumps. Allows you to select a stylist and save the map in SVG format. There are a number of ready-made stylists and you can write your own. I have prepared several style files, and I use them to export the borders of the districts to SVG, and maps of the districts themselves with settlements.
Generic Mapping Tools (GMT)
In general, Generic Mapping Tools (GMT) is a free set of command line utilities designed for processing and visualizing scientific data, including a number of its tools that allow you to work with geodata, i.e. we can use GMT as a console GIS. The finished map (or a separate layer for the future map) is obtained as a result of a sequence of calling utilities. Usually I write a batch file in which all parameters are set and utilities are called. At first glance it looks complicated, but as a programmer, this approach seems clear and familiar to me. In addition, repeatability is provided here: in order to create a map again, I can always run the script again.
Example batch file (see also here ):
set PATH=C:\programs\GMT5\bin;%PATH% set GSBIN=C:\PROGRA~1\gs\gs9.04/bin set COORDSCUT=144.7492/157.3007/42.9694/51.3837 rem width = xmaxsvg / 150.0 * 2.54 set PAPERX=14.9352 rem height = ymaxsvg / 150.0 * 2.54 set PAPERY=16.0189333333333 grdcut.exe ETOPO1_Bed_g_gmt4.grd -R%COORDSCUT% -Gh_cor_cut.grd grdgradient h_cor_cut.grd -Ne0.3 -A315 -M -Ghi.grd grdimage h_cor_cut.grd -Ihi.grd -Cwiki-water-verlauf2.cpt -P -R%COORDSCUT% -JX%PAPERX%cd/%PAPERY%cd --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -K > map.eps pscoast.exe -JX%PAPERX%cd/%PAPERY%cd -R%COORDSCUT% -Gc -P -Df --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -O -K >> map.eps grdimage h_cor_cut.grd -Ihi.grd -Cmount.cpt -P -R%COORDSCUT% -JX%PAPERX%cd/%PAPERY%cd --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -O -K >> map.eps pscoast.exe -JX%PAPERX%cd/%PAPERY%cd -R%COORDSCUT% -Q -P -Df --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -O -K >> map.eps pscoast.exe -JX%PAPERX%cd/%PAPERY%cd -R%COORDSCUT% -Na -Ia/0.25p,#0978AB -W0.25,#0978AB -P -Df --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -O >> map.eps %GSBIN%\gswin32c.exe -dSAFER -dBATCH -dNOPAUSE -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -dEPSCrop -r150 -sOutputFile=Oblast_etopo.png map.eps
As part of GMT, along with command line tools, data is also supplied, this set is called GSHHG , maps from this data are created using the utility
pscoastincluded in GMT.
Inkscape is a free and open vector graphics editor whose main format is SVG.
I usually use Maperitive and GMT as tools for preparing separate layers of the future map. Then the resulting layers are imported into separate layers in the Inkscape document, and all the final work on the map is already there. So, for example, for a positional map, it is necessary that the area shown on the map be “highlighted” - with color on the outline map and shading on the physical map. This is already manual work on objects and layers in Inkscape.
The final step in preparing map images is to save SVG (for a vector map) or export PNG (for raster).
Map creation process
- I usually start by taking the area of the future map and looking at the source data that I have for this area. I create a primitive contour map via GMT on GSHHG data, try to render the relief of the same area on ETOPO1, TOPO30 data, watch how this area looks in OpenStreetMap. It happens that I refuse to create a map at this stage if I see that the available data is not enough or they are of poor quality, contain errors or large gaps.
- Further, based on the approximate renderings, I choose on which data I will make the map.
- Create separate map layers. As a rule, a separate layer of borders is obtained separately (for example, a vector from OSM), a separate relief image for land and a separate layer of underwater relief (bathymetry), a separate layer of coastlines and a layer of rivers and reservoirs. It often happens that two raster layers have different resolutions, and here you have to play with interpolation so that together they look more or less organic. For example, a landform map for land is taken from ETOPO1 because this area is better represented there, and bathymetry is taken from TOPO30, and the resolution of these two sources differs by half. Then, for a lower resolution, we increase the resolution with interpolation so that “squares” do not appear, the moire effect does not appear, etc.
- Using Inkscape, we bring together the individual layers of the map. We carry out the necessary manual work, if necessary. We try to export the map to a raster, carefully consider and identify defects, correct and repeat. The result is map files ready for upload to Wikimedia Commons.
- We upload map files to Wikimedia Commons, we carry out documentation there. Each file should be written about what kind of map it is, what object, with what coordinates and in which projection, what source data are used with which licenses, what tools the work is done.
- We create or update the positional map template in ru-wiki, check its use. We make sure that the objects are in the right places on the map, i.e. that the coordinates of the corners of the map are set correctly, and the map itself corresponds to these coordinates. After that, we update the templates for this positional map in other language sections.
It took me 20-30 minutes to create one map (in simple cases, when a series of the same type of district maps is done like on a conveyor belt), up to 4-6 hours (in difficult cases, when there were problems with the source data and it was necessary to do a lot of manual work). It took several days to the physical map of Canada (see KDPV): it took me to pick up the projection that was already used on the outline map.
If we talk about "what I get from this," then probably - a lot of aesthetic pleasure, from what kind of cards are obtained.
Thank you for reading, I hope my experience will come in handy somehow :)