Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set hierarchy level #179

Open
proma90 opened this issue Oct 25, 2017 · 16 comments
Open

Set hierarchy level #179

proma90 opened this issue Oct 25, 2017 · 16 comments

Comments

@proma90
Copy link

proma90 commented Oct 25, 2017

Hello everyone! I'm using this tool in order to create an OSM network dataset adn then use it to generate GTFS shapes. I'm following the docs so, I loaded the osm file from Manchester http://download.geofabrik.de/europe/great-britain/england/greater-manchester.html adding this osm tag: highway=all. Once done it, I used Create OSM Network Dataset tool, loading the new created OSM Feature Datase and the network configuration sample files (DriveGeneric.xml). The resultant network dataset looked promising.

image

However, when I run the Generate GTFS Shapes tool, where I need to use the osm network and the manchester gtfs https://transitfeeds.com/p/transport-for-greater-manchester/224, it gave me the following warning:

Unable to create on-street Routes because the Solve failed.
Solve warning messages:
Cannot use hierarchy when the hierarchy level count is zero.

And the resulting shapes don't match the osm network:

image

I've checked the network configuration sample file that I used for create the osm network dataset and it seems that the hierarchy settings are well written

<!-- Heirarchy --> <network_attribute> <name>Hierachy</name> <default_value>0</default_value> <hierachy useAsDefault="false"> <evaluator_attributes> <source>roads</source> <direction>From-To</direction> <Field script_type="VBScript"> <expression>h_level</expression> <pre_logic> <![CDATA[ h_level = 4 Select Case LCase([highway]) Case "motorway", "motorway_link" h_level = 1 Case "trunk", "trunk_link" h_level = 2 Case "primary", "primary_link" h_level = 3 Case "secondary", "secondary_link" h_level = 4 Case "tertiary", "tertiary_link", "living_street", "residential" h_level = 5 End Select ]]> </pre_logic> </Field> </evaluator_attributes> <evaluator_attributes> <source>roads</source> <direction>To-From</direction> <Field script_type="VBScript"> <expression>h_level</expression> <pre_logic> <![CDATA[ h_level = 4 Select Case LCase([highway]) Case "motorway", "motorway_link" h_level = 1 Case "trunk", "trunk_link" h_level = 2 Case "primary", "primary_link" h_level = 3 Case "secondary", "secondary_link" h_level = 4 Case "tertiary", "tertiary_link", "living_street", "residential" h_level = 5 End Select ]]> </pre_logic> </Field> </evaluator_attributes> </hierachy>

Anyone can help me with this issue? Thank you so much in advance.

(I'm runing ArcMap 10.4 in an Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz, 2904 Mhz, 2)

@mboeringa
Copy link

@ThomasEmge ?

@proma90
Copy link
Author

proma90 commented Nov 6, 2017

Hi, any advise? Thanks.

@ThomasEmge
Copy link
Member

@proma90 Have you contacted Melinda (author of the GTFS tools) to get her opinion? I'll take a look if the OSM tools do build a proper hierachy.

@proma90
Copy link
Author

proma90 commented Nov 6, 2017

@ThomasEmge no, I haven't do it because I don't know how to contact her. Where can I find fer email? And thank you.

@mboeringa
Copy link

@proma90 , her full name is listed on this ESRI Blog page linking to the different posts she made: https://blogs.esri.com/esri/arcgis/author/Melinda-6/

@ThomasEmge
Copy link
Member

@proma90 It just tried building GTFS shapes with the data links you provided and I didn't run into the warning message you encountered.
When checking the properties of the generated network I noticed that there is no travel mode specified, so I generated one after the fact, using the drive time as the impedance and I checked the option to use hierarchy levels.

@proma90
Copy link
Author

proma90 commented Nov 7, 2017

@ThomasEmge Thank you! However, I was using drive time as the impedance before. Where did you ckeck the hierarchy levels option?

@mmorang
Copy link

mmorang commented Nov 7, 2017

Hello @proma90. The best thing to do is to test your network dataset using a regular Route Network Analyst layer prior to running Generate GTFS Shapes, just to make sure the network dataset is working properly. Can you solve a Route with your network, or do you get the same solve failure? I'm guessing you'll get the same error.

I'm not very familiar with the OSM tools or the networks they produce. I talked to one of our network dataset developers, and he says he doesn't know how the hierarchy level count could have gotten set to 0 unless the OSM tools did something funny during the creation process. Can you share your network dataset for us to look at? And the full network configuration sample file?

@proma90
Copy link
Author

proma90 commented Nov 8, 2017

Hi @mmorang, I will try to test my network dataset using the Route Network Analyst layer as you propose.
Here I attached the network configuration file and the network dataset in shapegile format generated from Greater Manchester osm file:
netwk_conf.zip
manchnetwork.zip
Thank you.

@mmorang
Copy link

mmorang commented Nov 8, 2017

The network dataset was not included in your manchnetwork.zip file, only a couple of shapefiles. Did the simple route test work?

@mmorang
Copy link

mmorang commented Nov 8, 2017

Let's back up a little bit. Why do you even need hierarchy for this? Hierarchy is meant to make long-distance routes solve more quickly in a case where an exact solve would take too long. It's really not needed for routes within a single city with stops close together, as is the case with transit routes. It's only valuable if, say, you're calculating routes from one side of the country (or continent) to another with just a stop on either end. Hierarchy tells the Route solver to strategically check only the highways and skip searching all the small roads except on the ends near the stop. But you don't want that. If you're calculating GTFS shapes from GTFS stops, then your stops are all pretty close together and mostly on local roads anyway.

So, my recommendation is to just delete the hierarchy attribute from the network dataset entirely, rebuild the network, and try running the tool again.

Another tip for future reference: I highly recommend creating your network datasets in a file geodatabase rather than using shapefiles. Shapefiles are an older format with a lot of limitations. File geodatabases are faster and can be larger and work better on newer versions of our software.

@mboeringa
Copy link

@mmorang . The OSM import tools of the ArcGIS Editor for OpenStreetMap create a File Geodatabase by default. I think @proma90 only used the shapefiles as an export format to make it available here, but of course he / she needs to confirm.

@ThomasEmge
Copy link
Member

@proma90 Were you successful in creating the shapes with our suggestions?

@proma90
Copy link
Author

proma90 commented Nov 13, 2017

Hi guys @mboeringa @ThomasEmge @mmorang , sorry for not getting back sooner, but I only have access to this computer from Monday to Wednesday. I will check now your answers and I will let you know about your suggestions (however, now I'm trying on Manchester, but I would like it to work for all UK). Thank you a lot.

@proma90
Copy link
Author

proma90 commented Nov 13, 2017

@mboeringa, yes, that's it. I only used the shapefiles as an export format.

@mmorang . The OSM import tools of the ArcGIS Editor for OpenStreetMap create a File Geodatabase by default. I think @proma90 only used the shapefiles as an export format to make it available here, but of course he / she needs to confirm.>

@proma90
Copy link
Author

proma90 commented Nov 15, 2017

I have found a solution. I uninstalled and installed again the tools so when I use it, it doesn't give me any issue (even thought it is not 100% accurate). The problem reappears if I use the same osm network...creating each time a new one, the hierarchy issue dissapear. Thanks for all your help and suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants