I convert a .shp file to .osm format, and I want to do map matching base on this osm file.
but when I import the graph (MapMatchingMain’s import action), it tells me :
2016-10-26 15:30:22,157 [main] INFO com.graphhopper.matching.MapMatchingMain - Configuration: {action=import, datasource=F:\\a_road.osm, graph.location=./graph-cache, graph.flag_encoders=car, datareader.file=F:\\a_road.osm, prepare.min_one_way_network_size=200}
2016-10-26 15:30:22,731 [main] INFO com.graphhopper.reader.osm.GraphHopperOSM - version 0.8|2016-10-21T11:43:53Z (5,14,4,3,3,2)
2016-10-26 15:30:22,754 [main] INFO com.graphhopper.reader.osm.GraphHopperOSM - graph car|RAM_STORE|2D|NoExt|,,,,, details:edges:0(0MB), nodes:0(0MB), name:(0MB), geo:0(0MB), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308
2016-10-26 15:30:22,816 [main] INFO com.graphhopper.reader.osm.GraphHopperOSM - start creating graph from F:\\a_road.osm
2016-10-26 15:30:22,816 [main] INFO com.graphhopper.reader.osm.GraphHopperOSM - using car|RAM_STORE|2D|NoExt|,,,,, memory:totalMB:57, usedMB:14
2016-10-26 15:30:23,374 [main] INFO com.graphhopper.reader.osm.OSMReader - creating graph. Found nodes (pillar+tower):0, totalMB:57, usedMB:10
2016-10-26 15:30:23,488 [main] INFO com.graphhopper.reader.osm.OSMReader - 7 189, now parsing ways
Exception in thread "main" java.lang.IllegalStateException: osm must not be empty. read 10164 lines and 0 locations
at com.graphhopper.reader.osm.OSMReader.writeOsm2Graph(OSMReader.java:309)
at com.graphhopper.reader.osm.OSMReader.readGraph(OSMReader.java:150)
at com.graphhopper.GraphHopper.importData(GraphHopper.java:712)
at com.graphhopper.GraphHopper.process(GraphHopper.java:681)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:659)
at com.graphhopper.matching.MapMatchingMain.start(MapMatchingMain.java:67)
at com.graphhopper.matching.MapMatchingMain.main(MapMatchingMain.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
2016-10-26 15:30:23,775 [main] INFO com.graphhopper.reader.osm.OSMReader - finished way processing. nodes: 0, osmIdMap.size:0, osmIdMap:0MB, nodeFlagsMap.size:0, relFlagsMap.size:0, zeroCounter:0 totalMB:72, usedMB:10
It looks like the OSMReader can not find nodes or locations in my osm file. But I check the file, it has and items.
And it do not has item, I am not sure .shp file have ‘relations’?
what should I do to work it out?