Open source maps. How to make changes to Open Street Map (OSM). What is OSM

In this practical article, we will look at services that help download maps from the OpenStreetMap online service for subsequent conversion to other cartographic formats in order to use them offline without an Internet connection.

It's summer, and for many this is the prime time to travel. Therefore, it’s time to get out navigators, or install a special navigation system on tablets and smartphones. software so as not to get lost in unfamiliar places. Moreover, there is no shortage of such programs in the current era of GPS and mobile devices. It offers users both geographic Internet services like Google Maps and Microsoft Bing, as well as specialized software like 2GIS with its own maps.

Last option with local maps, which users pre-download and install for their navigation software, in many cases are not only more convenient, but also the only Possible Solution. Since the Internet in a particular area may be expensive or may not work at all. But at the same time, the necessary offline maps of a specific area may also be missing.

Below we will consider options for downloading map data from the OpenStreetMap (OSM) online service with the subsequent goal of converting this data into a specific map format for your navigation program. We have already talked in detail about the OpenStreetMap project. This is an open mapping web service, similar to Google Maps, the data of which is collected by the users themselves and is available to everyone under an open license. In the article, as an example, we will consider converting OSM data for the OsmAnd program for Android devices, which we also discussed in detail on the KV website.

Official OSM website

So, we need to download OpenStreetMap cartographic data for a specific area. First of all, this can be done from the official website of the service www.openstreetmap.org.

Directly on the online resource map there is an “Export” link, when clicked, a data export panel will appear. Here, using the blue button “Manually select a different area”, you need to select a rectangle of the desired territory on the map, then select “OpenStreetMap XML Data” from the list of formats and click the “Export” button.

As a result, a file with the osm extension will be downloaded. This is a text xml file with map data, which can then be converted to other formats.

However, the official website imposes restrictions on the amount of downloaded map data. The downloaded map should not contain more than 500 nodes. And any city will always be more than 500 nodes. But there are other services that allow you to download the desired geographic area without such restrictions.

The whole planet

Here you need to select the desired area on the OSM map, and in special fields indicate your e-mail address and set the name of the selected map. It is important that the service makes it possible to download a map not only in OSM format, but also convert it into ready-made formats Garmin, Navit, Esri.

Since the “extraction” of a specific terrain map on the service comes from planet.osm, this takes some time. The result will be ready in 15-30 minutes, depending on the size of the card area and the load on the service. As soon as the card extraction process is completed, the user will be notified to the e-mail address he left.

Convert

Thus, having received cartographic data of a specific region in the form of a text osm file, you can begin converting it into a ready-made map format with vector or raster graphics for a navigation application. For example, for the OsmAnd software GPS navigator, you need to convert OSM map data into OBF format.

There is a special converter for this, OsmAndMapCreator. This application is written in Java and is cross-platform. Runs after unzipping, depending on operating system, sh or bat script. But the program has a graphical interface.

You need to convert the osm file through the "File" menu - "Create obf file from osm file." After that, a file with the obf extension will appear in the pre-specified folder, which needs to be transferred to the /sdcard/osmand/ directory on the Android device. Now the map of this area will be available in OsmAnd in offline mode.

Using OsmAndMapCreator, you can create OBF maps using data from other online mapping services. But a review of these program capabilities is beyond the scope of this article.

Mikhail ASTAPCHIK

(literally " open street map"), abbreviated O.S.M. is a non-profit web mapping project to create, through a community of participating Internet users, a detailed free and free geographical map peace.

To create maps, data from personal GPS trackers, aerial photography, video recordings, satellite images and street views provided by some companies, as well as the knowledge of the person drawing the map. It is impossible to use services like Google Maps to create maps without the permission of the copyright holder.

OpenStreetMap uses a wiki principle when creating a map. Each registered user can make changes to the map.

Now we will begin our story about how to make changes and additions to this fairly detailed, evolving and easy-to-use map.

First you need to go to the official OSM website http://www.openstreetmap.org/. You can log in to the site either using your personal mailbox or by linking an existing account in various communities, the icons of which are shown in the figure:

After entering the site, we will have the same picture as in the main photo of the blog. The page header contains the main menu with all supported commands and capabilities provided.

Now a completely logical question arises: how do you edit the map?

The map can be edited both online, using two online editors: iD and Potlatch 2, and offline, using an editor installed on your computer. The second method is convenient for those who have very low Internet speeds or have restrictions on the traffic used, where all changes can be made on your computer and then sent to the OSM server. Edits are sent as an XML file, so they will not have a significant impact on traffic.

In this article we will edit the map online using the iD editor, because... The operating principle of the iD and Potlatch 2 editors is the same, only Potlatch 2 allows you to plot a larger number of different classes of objects on the map and because of this it is more sluggish. To draw and edit roads on a map, the fast iD editor is quite sufficient.

In the upper left corner we have three highlighted items: “Edit”, “History” and “Export”. Moreover, the “Edit” item is inactive. When you hover your mouse over it, a hint appears indicating that you need to zoom in to edit it.

After enlarging the map to the desired scale, the "Edit" button will become active; when you click on it, a pop-up menu will appear where you can select the desired map editor.

Select the iD editor and start working with the map. You can make changes to the map either manually, using satellite images provided by the OSM service, or by plotting paths obtained from completed tracks saved in the navigator. The following image shows the map editing window with the iD editor. Editing will only become available after zooming in, and the zoom should be very large. The figure shows an extremely small scale, which is available for editing. As you can see, this scale is not very suitable for plotting objects using satellite images, but it can be used for plotting roads using GPS tracks.

As you can see, the editor is very simple and allows you to plot only three types of objects on the map: point, line and polygon. As you might guess, a point is the name of a specific place or a point object, a line is roads, a polygon is various areas (forests, settlements, at home, etc.).

On the toolbar located on the right, only two buttons are of interest:

setting the background. Those. what will be displayed on the map ( Google snapshot, OSM card, etc.)

card details. Using this button, GPS tracks are loaded into the editor, and you can also select those classes of objects that should be displayed or hidden on the map when editing.

Now let’s figure out how to put objects on the map. I noticed that during the ride the route passed in some places along forest roads that are not on the OSM map. This deficiency needs to be corrected. To do this, download a real GPS track from Rafael and begin to plot roads on the map using a real GPS track. In this example, I want to paint a beautiful forest path that we had before stopping at the lake. Here is a photo of this path:

The track is loaded, now you need to draw this road.

In the figure, the loaded real track is shown in pink; the white line along the track is the road mapped. Any applied object can be edited. To do this, simply select it with the mouse cursor. The object does not have to be yours. To complete drawing the line on the map, click on the last point. The starting and ending points of the line are important because... they determine the direction of movement. This is especially important when drawing one-way roads and rivers. But at any time the direction of movement can be changed by selecting the appropriate icon that appears after activating the object. On an existing object, you can change the position of existing points, add your own (drag the arrow located between the points), and also delete points. Those. there is nothing complicated here.

When you select a newly drawn object, an object type menu appears on the left side of the screen

We have a road, so we choose it. After this, a list of possible roads will appear. We have a forest road, that’s why we choose it

After this, we enter the necessary attributes of the forest road. These attributes are important for OSM cards, because they subsequently provide automatic navigation depending on the selected vehicle, as well as the ability to display an object on the map, while discarding unnecessary objects (let’s say a Ferrari won’t drive along a forest road, so the driver of such a car will not want field and forest paths littered the map and participated in automatic route planning).

For the created road I entered the following attributes:

Coating: unpaved (without coating)

Width: 3m

Legal access: bicycle, motor transport, riders, pedestrians

Type of country roads: Rather soft: compacted soil with admixtures of hard materials

Patency: Sturdy wheels: hybrid bikes, cars, rickshaws

Mountain bike trail difficulty: 0: smooth gravel/packed ground, no obstacles, wide turns

Difficulty of climbing on a mountain bike: 0: Medium rise<10%, гравий/утоптанная земля, без препятствий

Any action can be canceled before the data is sent to the server. If you forgot to define the type of an object or assign attributes to it, but reached the step of entering a comment, the last step can be canceled (clicking "Save") by closing the comment entry window, and the unsaved object will not be lost anywhere.

You can’t go anywhere without navigation, especially considering the state of our roads. Have you noticed that your navigator is not stable? Then you need to download OSM maps for Navitel as soon as possible. They contain all the necessary information about the populated areas of the country; POI objects, such as restaurants, bars, and places for cultural recreation, are marked on these maps.

OSM maps for Navitel are something more than regular navigation. This is a project created by enthusiasts with their own hands. The service provides raster maps of the area, and navigation services based on them create the maps that we are accustomed to. This approach makes it possible to organize navigation as accurately as possible.

The OSM project is a completely non-profit project. This means that all maps are provided free of charge under a public domain license. Moreover, Open Street Map acts as a wiki, which allows everyone to make changes to the maps and this makes OSM even better, higher quality and more popular.

Why should OSM be used?

Open Street Map has a number of advantages over other projects of a similar nature:

  • accuracy;

Navitel OSM maps are so detailed that with a 99% probability, every hump and uneven terrain that is on the maps will be encountered in real life. This is due to the fact that maps are constantly being improved by the OSM community on the Internet. As a result, edits are made, old versions are updated, and new maps are improved.

  • free distribution;

The project is supported by donations. This made it possible to absolutely download all OSM maps for Navitel. At the same time, the quality will be far from worse than that of paid services.

  • wide girth;

Unlike most projects, OSM maps for Navitel cover the entire globe. Therefore, using them, you are guaranteed to know how to get to the place you need in an unfamiliar country or continent. Moreover, OSM is superior in accuracy to some of its paid “brothers” - TomTom/Tele Atlas. According to the study, Open Street Map is 27% more accurate than these maps.

  • convenient use;

Maps can be imported into any convenient format - PNG, JPEG, SVG, PDF or PostScript. Also, it is possible to load them into Garmin, GisRussa.

The WIKI format allowed OSM to create a unique mapping project. After all, the fact that maps are finalized by local residents provides undeniable advantages. Firstly, the accuracy is extremely high, and secondly, reliability is ensured. And thirdly, this is the general availability of the OSM map for Navitel. You can download them on our website completely free of charge and without SMS.

Read about how to install cards.

Overview map of Russia (Russia-overview)
Altai (Russia-AL)
Altai Territory (Russia-ALT)
Amur region (Russia-AMU)
Arkhangelsk region (Russia-ARK)
Astrakhan region (Russia-AST)
Bashkiria (Russia-BA)
Belgorod region (Russia-BEL)
Bryansk region (Russia-BRY)
Buryatia (Russia-BU)
Chechnya (Russia-CE)
Chelyabinsk region (Russia-CHE)
Chukotka Autonomous Okrug (Russia-CHU)
Chuvashia (Russia-CU)
Dagestan (Russia-DA)
Ingushetia (Russia-IN)
Irkutsk region (Russia-IRK)
Ivanovo region (Russia-IVA)
Kamchatka region (Russia-KAM)
Kabardino-Balkaria (Russia-KB)
Karachay-Cherkessia (Russia-KC)
Krasnodar region and Adygea (Russia-KDA)
Kemerovo region (Russia-KEM)
Kaliningrad region (Russia-KGD)
Kurgan region (Russia-KGN)
Khabarovsk Territory (Russia-KHA)
Khanty-Mansi Autonomous Okrug (Russia-KHM)
Kirov region (Russia-KIR)
Khakassia (Russia-KK)
Kalmykia (Russia-KL)
Kaluga region (Russia-KLU)


2) Vectors, available in editors and for downloading as files

To navigate the area, maps need to be loaded into the device with which you will go to this area - capable of receiving a GPS signal, drawing a map and your position on it. If the device can still plot a route, that’s generally good.

Today we will talk about converting OpenStreetMap maps to display them in Russa or Navitel Navigator programs. Accordingly, these maps can be downloaded into devices running one of these programs.

Generally speaking, you can download ready-made maps of some regions of Russia and some other countries, but these maps do not cover the whole world and are not always made as desired. By converting the card yourself, you can achieve much more, if you don’t mind the time, of course.

Briefly and for those in the know, the conversion looks like this: .osm -> .mp -> .rus / .nm2

Disclaimer - I am describing the method that I use myself. If you know an easier way, please write it in the comments.

Well, now - in detail:

1) Download.osm
.osm is the format vector maps for OpenStreetMap. It is based on XML, i.e. actually text.
You can get the .osm file in the following ways:
1. Download by editors: JOSM or Merkaartor. Simply download the map rectangle you need from the server and save it to a file. I personally prefer to use JOSM, but it requires Java to be installed.
2. Download a ready-made map of a certain region from one of the hosting sites, for example:
- geofabrik.de - entire continents and divided into countries, some countries are divided into provinces/states/regions
- cloudmade.com - the whole world by country, some countries are divided into provinces/states/regions
Just download the file and extract bz2.
3. Download manually via XAPI
To work with XAPI, you need to make an HTTP request to the server, nothing complicated, everything is written in the link.

2) Cut .osm into pieces(If you want to)
.osm files, especially those prepared by country, can be quite large and do not undergo subsequent conversion (see below). Therefore they have to be cut.
For cutting I use splitter, it by default makes .osm files somewhere around 120 MB, which then almost always undergo subsequent conversion. If necessary, splitter can be configured using command line parameters.
Splitter requires Java to work.
Please also keep in mind that in Russa, routing only works with one map loaded. Those. If a map of one country is cut into pieces and loaded into Russa as an atlas, routing will not work.

3) Convert .osm to .mp
.mp is an ancient Polish map storage format. It is good because it is text-based and completely human-readable, and many programs understand it.
For conversion I use the osm2mp program. Unfortunately, the program requires Perl to be installed and is not very easy to use.
One way or another, after installing and configuring Perl (described in the link) and downloading osm2mp, the program can be used.
An arbitrary .osm file must also be pre-ordered - processed with the attached script osmsort.pl
Then you need to call osm2mp.pl specifying the conversion parameters.
Through lengthy experiments, I wrote a set of .bat files for myself, for example, a standard conversion with a sight for Russa:
echo Start %date% %time% >> std_err.log echo %1 >> std_err.log perl.exe osmsort.pl %1 > temp_del.osm 2>> std_err.log perl.exe osm2mp.pl --header header_russa. tpl temp_del.osm > %1.mp 2>> std_err.log echo Finish %date% %time% >> std_err.log
You need to call such a .bat file with 1 parameter - the name (and full path) of the .osm file
The 1st line writes the date and time the conversion started to the std_err.log file
The 2nd line writes the name of the .osm file to the std_err.log file
The 3rd line executes osmsort, information about the progress of the process (and errors) goes to the std_err.log file
The 4th line executes osm2mp, information about the progress of the process (and errors) goes to the std_err.log file
The 5th line writes the date and time the conversion ended to the std_err.log file
(The path to perl.exe must be specified either in the system or in your .bat file)

To convert maps of foreign countries, it is advisable to enable transliteration - otherwise the names. For example, adding the following parameters "--nametaglist int_name,name:en,name,name:ru,ref,int_re f,addr:housenumber,operator --translit" immediately after "osm2mp.pl"

To convert with a view for Navitel, you need to download a set of configuration files osm2navitel, rename the files there respectively to header_navitel.tpl, poly_navitel.cfg and poi_navitel.cfg; and add to the call osm2mp.pl the parameters "--osmbbox --navitel --disableuturns --header header_navitel.tpl --cfgpoly poly_navitel.cfg --cfgpoi poi_navitel.cfg"

For other conversions, you can also prepare poly*.cfg, poi*.cfg and header*.tpl

A large card may not be converted - for example, 32-bit Perl is limited to 2GB of RAM, as a result osm2mp cannot cope with .osm files ranging from 700MB in size, and sometimes crashes with a memory error on significantly smaller cards. In this case, the card must be cut (see step 2).

4) Convert .mp to .rus (or .nm2)
For this purpose there is an excellent program GPSMapEdit, which, as the name suggests, is also an editor. It is enough to load the .mp file into GPSMapEdit and Export it to the desired format.
But there are several pitfalls:
- Files.rus (and.nm2) saved from GPSMapEdit have a size limit of 16MB. I estimate this equates to about a 120 MB .mp file or about 600 MB .osm file.
- .nm2 files for Navitel 3.2.* versions are very demanding on the absence of errors on the map, so if “Export failed” occurs, you will have to correct the error on the displayed map, or select a different format, or convert the map with other settings (see step 3).

P.S. , and then convert it to .rus or .nm2.



Thousand