Iran/Iran boundaries import

From OpenStreetMap Wiki
Jump to navigation Jump to search



This project is focused on enhancing level 4 administrative boundaries of Iran and also adding administrative boundaries for counties,districts and rural areas of Iran.

Import Plan Outline

The import will be carried out in September 2016.


  • Updating administrative boundaries for 31 province of Iran based on the latest administrative divisions made by Iranian Ministry of Interior.
  • Adding administrative boundaries for 430 counties currently available in administrative divisions of Iran.
  • Adding administrative boundaries for districts (level 7) and rural (level 8) to Iran's Map in OSM database.
  • To have up to date administrative boundaries for Iran based on the data made available by the Iranian government.


  • June and July 2016 - Discussing with the Iranian OSM community in Iranian OSM mappers Telegram group.
  • Late July 2016 - Looking for reliable and OSM licensing compatible data for Iranian boundaries by contacting different organizations in Iran.
  • August 2016 - Starting to work on the shape files for Provinces and Counties of Iran and creating a .OSM file containing all the provinces and counties of Iran with required tags.
  • Late August 2016 - Sending the shape files for district and rural areas of Iran to another mapper with more experience in creating relations by using python scripts.
  • September 2016 - Executing the Import.

Import Data

The data to be imported originally has been created by the Iranian Ministry of Interior. The source files that I have used comes from the Department of Geosience of Technology Univeristy of Arak, Iran.


In September 2009 Claudius Henrichs imported the province and part of the county borders from (Link to Iran at A new OSM-user was set up for this named iran_provinces. The manual import surfaced a large diagonal offset between ML and WFB data. To resolve this the country boundaries from WFB were kept untouched and connections to the province boundary data from ML were created manually.

Currently there are county boundaries for 3 out of 31 provinces and there are many unconnected ways with border_type=county tags. Also in last few years two new provinces has been added to Iran'd administrative divisions.

OSM Data Files

One .osm file (for JOSM) is generated with all the nodes/ways and relations of administrative boundaries containing admin_level 4,6,7 and 8 with all the required tags.

Import Type

Since the amount data to be uploaded is relatively high, the data will be divided in separate blocks and I will upload them using JOSM.

Data Preparation

Data Reduction & Simplification

In the source files, there was 4 shape file (each one containing a separate admin level) for every province of Iran. The shape files for each admin level was merged, converted to lines and they were spited at intersection points. The extra metadata was remove from the source files and they were converted to .osm files using JOSM. The ways was simplified and relations has been created both manually and using a python script.

Tagging Plans

Every relations has the following tags:





source= Iran/Iran boundaries import

Changeset Tags

source = Iran/Iran boundaries import

Data Transformation

The geometries from the original .shp files was converted in QGIS using Polygon to lines, then saved again as a .shp. The shape file then was used in a python script and relations for level 7 and 8 boundaries was created using this script.

Data Transformation Results

The result was a .osm file containing level 4,6,7 and 8 administration boundaries of Iran with required relations and tags.

Data Merge Workflow

Team Approach

The project was started solo by Adib Yz with the scope of correcting province boundaries of Iran and adding county boundaries to Iran's map (level 4 and 6). After I faced problems during the upload process and sent a message in imports mailing list, Ivan Garcia contacted me and offered to help. After a discussion that we had, we decided to add the level 7 and 8 to project scope. Ivan created the relations for these admin levels using python script. We have worked on the final .osm and did some error handling manually using JOSM.


Detail the steps you'll take during the actual import.

Information to include:

  • Verify the final .osm file with all the boundaries with levels 4,6,7,8.
  • Use an exclusive OSM username for this import to facilitate reverts in necessary cases.
  • Delete actual OSM level 6 to level 8 boundaries inside Iran borders(keeping specially the country and province boundaries, which relation ID numbers may be being used by 3rd party applications.)
  • Upload the .osm file using the Upload by chunk function in JOSM.
  • Carefully merge the level 2 and level 4 current boundaries with the new ways we added.
  • Verify the import with this great online tool to check if any country border has been broken and fix it carefully.
  • The coastlines of Iran will be inspected using this online tool.
  • In case something went wrong. Revert.


Conflation will be handled manually for this project.


Add your QA plan here.