I am having a difficulty to use network analysis in ArcGIS because of unavailable network datasets. So, I googled it and realized that it is possible by using OpenStreetMap. However I don't know how to create a network dataset from OSM in qgis and then incorporate it to ArcGIS. I am a very beginner so please let me know in details.
-
I would think you would use OSM data in shapefile format, import into a file geodatabase using ArcGIS tools, and build the network dataset using the rest of the ArcGIS tools - I don't see a need to build the network dataset using QGIS, which isn't possible unless you were using something like OSM2PGRouting in PostGIS...– Inactivated AccountCommented Oct 6, 2015 at 16:08
-
2No, the OSM Shapefiles which are usually available for download cannot be used for routing! They do not describe the network topology correctly.– underdarkCommented Oct 6, 2015 at 18:10
4 Answers
QGIS cannot convert OSM data into a routable graph.
There are other tools which specialize on this task:
- osm2pgrouting open source
- osm2po free but not open source
Both convert OSM data into a routable graph for import into PostGIS. From there, you can export in a format that you can feed into ArcGIS.
-
1Could you provide more information how I can use either of two? I tried to find any blogs with details but I failed to follow them.– TraGISCommented Oct 7, 2015 at 15:20
-
@TraGIS Please ask specific questions about which steps are causing you trouble. This site is for Q&A rather than for writing lengthy step-by-step tutorials. Commented Oct 7, 2015 at 20:34
-
Thanks for your point. I am following your blog now with osm2po. (That's good blog) 1) how can I use xxx.osm data not xxx.osm.pdf? 2) the command you suggested are typed in Cmd.exe?– TraGISCommented Oct 7, 2015 at 20:44
-
-
Thank you so much! I encounter error message "java is not recognized as an internal or external command, operable program or batch file." Can you help me with this error? I am very new in jar so please understand my stupid questions.– TraGISCommented Oct 7, 2015 at 21:01
Assuming you have ArcMap and a Network Analyst extension (as mentioned in your question) it is possible to use OSM data for routing without using qgis. The most important is that you need to generate a routable network (called "network dataset" in esri world). Eva Peters created a tool called OSM2NetworkDataset which converts OSM datasets (*.osm) into a routable network for ArcMap. OSM2NDS is compatible with the recent ArcMap version (10.2.2). You can download it here. I recommend to use the commande line version (osm2nds_ArcGIS_10.0_console_1.1.1.jar) by following the installation instructions.
A sample batch-file could look like this ("PAUSE is the second line!):
"C:\Program Files (x86)\Java\jre6\bin\java" -Xmx1024m -cp "C:\Program Files (x86)\ArcGIS\Desktop10.2\java\lib\arcobjects.jar";"C:\osm2nds\osm2nds_arcgis_10.0_console_1.1.1.jar" org.n52.osm2nds.core.userinterface.console.Main C:\osm2nds\berlin_routing.osm C:\osm2nds\Parameters_Motorcar_v1.1.xml C:\osm2nds berlin_Motorcar C:\osm2nds\berlin_motorcar.log
PAUSE
Copy these lines into a text editor of your choice, adjust the paths and save as "*.bat".
The only limiting factor is the size of the network as osm2nds will crash if your OSM datatset is too big. However, cities with up to 500.000 inhabitants were never a problem for me.
-
Thanks for letting me know! However, I can't follow the installation instructions because it's too brief and I have no idea what "Batch file schema" and how to do it. Could you provide more specific information how to use it? or could you give me any other sources like blogs with detailed explanations like screenshots?– TraGISCommented Oct 7, 2015 at 15:19
-
Open Notepad/Editor and save the file with the ending ".bat". The best way then is to copy everything beneath "The following code is an example for a batch file for the console application:" from the osm2nds installation instructions. Check every path and adjust the ones for java, arcobjects.jar, osm2nds_ArcGIS_10.0_console_1.1.jar, *.osm-file, folder and log-file. The batch file consists of only two lines: PAUSE is the second line! When finished, open the comand-line, type in the path to your created *.bat-file and hit enter. Hope this helps. If needed I can provide you my batch-file! Commented Oct 8, 2015 at 5:38
-
I edited my answer so everyone can benefit from it. If the answer was helpful please mark the answer as accepted. Click on the check mark beside the answer to toggle it from hollow to green. Commented Oct 8, 2015 at 6:10
-
Thank you so much for providing this. I have another issue "ERROR: org.n52.osm2nds.reader.ReaderException: The reading process of the file 'C:\Test\google.osm' failed: The file 'C:\Test\google.osm' could not be unmarshalled. Maybe the file isn't valid." Do you have any idea for this? I download .osm file from QGIS.– TraGISCommented Oct 8, 2015 at 7:07
-
Check this thread from osm2nds forum: osm2nds.forum.52north.org/… Commented Oct 8, 2015 at 7:17
You can also use our free OSM converter from www.routeware.dk, which can create routable datasets in SHP format. Output is formatted to be easy to use with our own software, but with a few field updates, you can also use it with Network Analyst.
I think I got an easier way to accomplish it in ArcGIS with OpenStreetMap data.
It works for me but I don't know if it's 100% without an error. Please do it to help us to know if it's safe or not.
Before starting your Network analysis, dissolve your OSM road data by one field (same value for all classes).
Ex: Add field Net then make same value for the column Ex: FieldCalulator : Net = 0.
after that, you will have one shapefile with one line.
Use it while creating your NetworkDataSet.
but for the area, I use we do not have big routes or bridge or something like that.......