OsmSharp / ui

The UI components.
http://osmsharp.com/
GNU General Public License v2.0
138 stars 91 forks source link

Routing File Loading Trouble (Multiple issues) #234

Closed ghost closed 9 years ago

ghost commented 9 years ago

I'm trying to use a mobile-optimized routing data file generated by OsmSharpDataProcessor 1.2.0.51.

This is the command I'm using to generate the file: mono odp.exe --read-xml ../map.osm --write-graph graph=../rit.routing type=contracted format=mobile

I cannot get the file to be read in using OsmSharp 4.3.0.1002-beta due to an incorrect version in the header. I rectified this error by changing the type to standard and not setting a format, but I'm still getting a protobuf error due to "Invalid field in source data: 0".

Here is the code I'm using to load the routing file:


            using (var inputStream = 
                new FileInfo(NSBundle.MainBundle.PathForResource(Resources.ResourceFileToFileName(ResourceFile.Routing), "routing")).OpenRead())
            {
                Router loadedRouter = Router.CreateLiveFrom(inputStream, new OsmRoutingInterpreter());
            }
ghost commented 9 years ago

This issue was solved by forcing a CHEdgeDataFlatfile format, using the latest pre-release builds of OsmSharp and OsmSharpDataProcessor, and setting the vehicle type to the proper one (in my case pedestrian).