This guide will take you step by step through downloading OSM data and converting it to either a shapefile or an AutoCAD DWG file using different GIS software options. All the software options are provided on the library's GIS workstations.
OpenStreetMap (OSM) is an open source mapping project which is collaboratively edited by users all over the world. The open source nature of the project means that anyone can download spatial data from it for free.
- Download very small area (e.g.: neighbourhood, small town): OpenStreetMap (directions in Step 2a, below)
- Download small area (e.g.: city): HOT OSM export (requires free OSM account)
- Download large area: PlanetOSM (entire planet)
- API instructions: OpenStreetMap Wiki
If you downloaded data from anywhere that's not OpenStreetMap (the first option above), you need to unzip the .zip folder and convert to shapefile or DWG. You may also have multiple OSM files in the folder so it's a good idea to look in the folder to see what's there.
- Type your location of interest in the search box (Ex: “Rome, Italy”).
Next, select the exact location from the “Search results” list that appears beside the search box. Once you select a location from this list, the map will automatically zoom to this location.
- Use the mouse to pan and zoom in/out to locate a specific area of the city.
- Export the data: Once you have your area , click the “Export Data” link on the left of the screen. You can export the entire window view or you can “Manually select a different area” if you only want a portion of the displayed view. If you select the manual option, you use the box that pops up to specify the area to export.
Next, click on the “Export” button to export the data. This will save the file as an “OpenStreetMap XML Data” (.osm).
- NOTE: If you try to export an area that is too large, then OpenStreetMap will give the error “You requested too many nodes" (limit is 50,000). Either request a smaller area or use one of the links listed in Step 1 to find data at city, state, province, national, or continental level.
Convert .osm to shapefile
It's possible to convert .osm files to shapefiles or geodatabase feature layers in ArcGIS Pro using the Data Interoperability extension. It is included for Carleton users as part of the ArcGIS Pro download and you can verify that it is activated by checking the licensing settings in ArcGIS Pro.
- There is a search box in the top menu bar in ArcGIS Pro, right next to the filename. Search for "quick import" and select the Quick Import (Data Interoperability Tools) option.
- For the Import Dataset, click the little folder icon then the […] beside Dataset, and browse to the .osm file. The Format will fill itself in.
- Your project should have a default geodatabase, possibly called MyProject.gdb or whatever the name of your ArcGIS Pro project is. Select it as the Output Geodatabase.
- Click Run.
- Once it is complete, the geodatabase should have a number of layers in it (e.g. amenity point, building polygon, highway line, etc.).
- In the Catalog pane, you can then right-click on a feature layer, select Export from the menu, and then Feature Class to Shapefile.
FME Quick Translator can be found on the desktop of the GIS workstations in the library.
- When FME opens, go to the File tab and select the “Translate” option. The “Set Translation Parameters” window will appear.
- Translation Parameters for converting to Shapefiles (.shp):
- In the “Reader Format” use the drop down menu to select “OpenStreetMap (OSM) XML”. If the option is not in the dropdown menu, just start typing it in and it will fill in the rest.
- In the “Reader Dataset”, click on the “…” button to open a file directory and navigate to the .osm file.
- In the “WriterFormat” use the drop down menu to select “ESRI Shape”. If the option is not in the dropdown menu, just start typing it in and it will fill in the rest.
- In the “Writer Dataset”, click on the “…” button to open a file directory and navigate to the location where you want the shapefiles to output to.
Press “OK” once you are done to start the translation.
- Once FME is finished the translation it will say “Translation was SUCCESSFUL….Translation finished” . The newly created shapefiles will be in your folder and you can add them to ArcMap using the Add Data button.
Convert .osm to .dwg
You can use FME Quick Translator to convert .osm files to .dwg files for use in AutoCAD. However, you will want to define the coordinate system to a projected coordinate system, such as Universal Transverse Mercator (UTM). The UTM coordinate system splits the world up into 60 zones which each cover 6° of longitude. This means that you will have to locate your UTM zone in order to project data into a UTM projection.
If you do not project your files then you will not be able to measure any sort of feature geometry (i.e. length, area, height) in familiar units like metres, kilometres, etc. Instead, all your measurements will be in decimal degrees, which is not ideal.
- Search for your location in this online map, and note the five-digit EPSG code.
- Open FME Quick Translator, which can be found on the desktop of the GIS workstations in the library.
- Under File, select Translate.
- Use the following parameters in the "Set Translation Parameters" dialog box:
- In the “Reader Format” use the drop down menu to select “OpenStreetMap (OSM) XML”. If the option is not in the dropdown menu, just start typing it in and it will fill in the rest.
- In the “Reader Dataset” click on the “…” button to open a file directory and navigate to the .osm file.
- In the “WriterFormat” use the drop down menu to select “Autodesk AutoCAD DWG/DXF”. If the option is not in the dropdown menu, just start typing it in and it will fill in the rest.
- In the “Writer Dataset”, click on the “…” button to open a file directory and navigate to the location where you want the .dwg files to output to and give the file a name.
Important: To set the coordinate system, type in the EPSG code exactly as shown in the example image (below) but substitute your own code numbers from Step 3, above.
- Press OK once you're done to start the translation.
Once FME is finished the translation it will say “Translation was SUCCESSFUL….Translation finished” . The newly created DWG file will be in the output folder you specified.
- Common errors when opening the DWG file in AutoCAD: When viewing the file in AutoCAD or other CAD software for the first time, beware that you may get an error that essentially informs you that the file was not created in CAD software. That is fine - you still want to open it. You may also need to zoom to the extent if there doesn't seem to be any data in the CAD window.
You can also use Global Mapper to convert .osm files to .dwg files for use in AutoCAD. However, you will want to define the coordinate system to a projected coordinate system, such as Universal Transverse Mercator (UTM). The UTM coordinate system splits the world up into 60 zones which each cover 6° of longitude. This means that you will have to locate your UTM zone in order to project data into a UTM projection.
If you do not project your files then you will not be able to measure any sort of feature geometry (i.e. length, area, height) in familiar units like metres, kilometres, etc. Instead, all your measurements will be in decimal degrees, which is not ideal.
- Search for your location in this online map, and note the five-digit EPSG code.
- Open Global Mapper
- Click Open Data Files and browse to your .osm file. Click Open.
- Click Tools > Configure
- Click the Projection radio button
Click Search by EPSG Code and enter the 5-digit label (in this example it's a Gatineau dataset so the code is 32618), then OK. You may notice that the data adjusts slightly - that's okay.
- To export, click File > Export > Export Vector/Lidar Format...
- Select DWG in the Select Export Format dropdown, then click OK
- In the DWG Export Options dialog box, select your preferred DWG version and any other properties you'd like. Click OK.
- Browse to where you'd like to save the file, name it, and click OK
- Common errors when opening the DWG file in AutoCAD: When viewing the file in AutoCAD or other CAD software for the first time, beware that you may get an error that essentially informs you that the file was not created in CAD software. That is fine - you still want to open it. You may also need to zoom to the extent if there doesn't seem to be any data in the CAD window.
It's possible to convert .osm files to AutoCAD DWG files in ArcGIS Pro using the Data Interoperability extension. It is included for Carleton users as part of the ArcGIS Pro download and you can verify that it is activated by checking the licensing settings in ArcGIS Pro.
- There is a search box in the top menu bar in ArcGIS Pro, right next to the filename. Search for "quick import" and select the Quick Import (Data Interoperability Tools) option.
- For the Import Dataset, click the little folder icon then the […] beside Dataset, and browse to the .osm file. The Format will fill itself in.
- Your project should have a default geodatabase, possibly called MyProject.gdb or whatever the name of your ArcGIS Pro project is. Select it as the Output Geodatabase.
- Click Run.
- Once it is complete, the geodatabase should have a number of layers in the geodatabase (e.g. amenity point, building polygon, highway line, etc.).
- To export to a DWG, search for "quick export" in the top menu bar and select Quick Export (Data Interoperability Tools).
- For Input Layer, navigate to the geodatabase and select all the layers (one way is to click the first layer, hold Shift key, and click the last layer).
- For the output file, select Autodesk AutoCAD and then browse to a folder and give your file a name.
- Click Run.
- You may get a "None of the layers to be read contain features in the selection set" warning. If so, the export should still have worked.
- Once you load the .dwg file into a CAD software, you may need to Zoom to Extents to view it.