This paper describes the method of using the Open Street service for geocoding postal addresses, ie obtaining valuable GPS coordinates (latitude, longitude) for positioning them on a map.
What you need to know about geocoding
Geocoding involves transforming a postal address into digital GPS coordinates. We thus pass from a text written in full, into a couple of digits with a comma which are latitude and longitude and which have a unique meaning of positioning on the terrestrial globe.
It is thus understood that the difficulty of this task consists in understanding the written language which can use different redactions to designate a same postal address.
For example, in France, the grouping of municipalities means that the geocoding systems must include street numbers with the old name of the municipality that remains commonly used and the new name of the municipality being adopted. Another example: if the user forgets to specify the country in which he wishes to place addresses, it is quite possible that the geocoding system recognizes a similar address in another country or continent. Finally, by forgetting an element such as the street number, the geocoding will have to extrapolate a position by choosing approximately the middle of the street, which is very imprecise.
It is therefore absolutely necessary to be rigorous when writing addresses, and to follow our address formatting advice.
Companies that work with addresses have every interest in geocoding their address database once and for all. This data preparation will be appreciated when used together with geographic information software (GIS).
What are the geographical coordinates?
Geographical coordinates are also called GPS coordinates by language abuse, being commonly used in GPS systems that are used especially in vehicles.
There are different systems for scoring geographic coordinates. For example, degrees, minutes and seconds of angle can be used and this gives: 49 ° 30 ’00 “- 123 ° 30′ 00”. Computerized systems (GIS) use decimal degrees defined by the WGS84 geodetic system which are much easier to handle, such as: 48.8566.2.3522 (Paris). Note the point as a decimal separator and the comma as a value separator (in a two-element list style).
The number of decimal places used in decimal degrees has a meaning. To obtain a positioning accuracy about one meter, five decimal places are sufficient. At the scale of a building, four decimal places are sufficient. Do not be fooled by the geocoding systems that offer more decimals, sometimes six to eight digits after the decimal point, this really has no meaning.
The import of addresses in Open Street can be done via keyboard input, but it is especially the import of Excel file which is advised. This assumes you have previously created an account and then followed the steps in the Excel import tutorial.
The geocoding of the points is done progressively: we see markers appearing on the map. When finished, a message appears at the top of the Open Street menu.
Export GPS coordinates
After setting the desired points on the map, they are also displayed in the address list (screenshot above). The report can also be accessed through the Open Street menu detailed in an article.
In the absence of optimized route or simple route calculation, the calculation report can only display the geocoding information because no distance has been calculated. And this is precisely the purpose of this article.
To export geographic coordinates, there are two possibilities. The most obvious is to select the table directly on the web page and paste the content into a spreadsheet. This will work but you might be bothered by the spreadsheet that might try to comply with the source formatting with fonts, icons, and so on.
The best option is to click on the “CSV” link below the geographic data table. We can then download a CSV data file compatible with spreadsheets.
With a spreadsheet like OpenOffice or LibreOffice, the file is read correctly. With Microsoft Excel it is necessary to go through the import of text file and specify the field separator. This is located in the Data> From Text menu, and then you can select the UTF-8 encoding and the comma separator.
Excel does not understand the point as a decimal separator and therefore it will be necessary to use the function “Search and replace” (icon in the form of Binoculars) to replace the dots with commas.
An example of a treatment that can be carried out from the Gsectorization into zonesPS coordinates: sectorization into zones.