test bikes & public_transport stop_area relations
This commit is contained in:
		
							parent
							
								
									6f5fc14f59
								
							
						
					
					
						commit
						b182cd1fa4
					
				
							
								
								
									
										37
									
								
								features/bicycle/stop_area.feature
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								features/bicycle/stop_area.feature
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | ||||
| @routing @bicycle @stop_area @todo | ||||
| Feature: Bike - Stop areas for public transport | ||||
| Platforms and railway/bus lines are connected using a relation rather that a way, as specified in: | ||||
| http://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area | ||||
| 
 | ||||
| 	Background: | ||||
| 		Given the speedprofile "bicycle" | ||||
| 	 | ||||
| 	Scenario: Bike - Platforms tagged using public_transport | ||||
| 	 	Then routability should be | ||||
| 		 | highway | public_transport | bicycle | bothw | | ||||
| 		 | primary |                  |         | x     | | ||||
| 		 | (nil)   | platform         |         | x     | | ||||
| 
 | ||||
| 	Scenario: Bike - railway platforms | ||||
| 		Given the node map | ||||
| 		 | a | b | c | d | | ||||
| 		 |   | s | t |   | | ||||
| 
 | ||||
|         And the nodes | ||||
|      	 | node | public_transport | | ||||
|      	 | c    | stop_position    | | ||||
|      	  | ||||
| 		And the ways | ||||
| 		 | nodes | highway | railway | bicycle | public_transport | | ||||
| 		 | abcd  | (nil)   | train   | yes     |                  | | ||||
| 		 | st    | (nil)   | (nil)   |         | platform         | | ||||
| 
 | ||||
|   		And the relations | ||||
|   		 | type             | public_transport | node:stop | way:platform | | ||||
|   		 | public_transport | stop_area        | c         | st           | | ||||
| 
 | ||||
| 		When I route I should get | ||||
| 		 | from | to | route        | | ||||
| 		 | a    | d  | abcd         | | ||||
| 		 | s    | t  | st           | | ||||
| 		 | s    | d  | /st,.+,abcd/ | | ||||
| @ -121,6 +121,7 @@ function way_function (way, numberOfNodesInWay) | ||||
| 	local junction = way.tags:Find("junction") | ||||
| 	local route = way.tags:Find("route") | ||||
| 	local railway = way.tags:Find("railway") | ||||
| 	local public_transport = way.tags:Find("public_transport") | ||||
| 	local maxspeed = parseMaxspeed(way.tags:Find ( "maxspeed") ) | ||||
| 	local man_made = way.tags:Find("man_made") | ||||
| 	local barrier = way.tags:Find("barrier") | ||||
| @ -135,12 +136,14 @@ function way_function (way, numberOfNodesInWay) | ||||
| 	local amenity = way.tags:Find("amenity") | ||||
| 	local access = find_access_tag(way) | ||||
| 	 | ||||
| 	-- only route on things with highway tag set (not buildings, boundaries, etc) | ||||
| 	-- initial routability check, filters out buildings, boundaries, etc | ||||
|     if (not highway or highway == '') and  | ||||
| 		(not route or route == '') and  | ||||
| 		(not railway or railway=='') and  | ||||
| 		(not amenity or amenity=='') then | ||||
| 		return 0 | ||||
| 		(not amenity or amenity=='') and | ||||
|     	(not public_transport or public_transport=='') | ||||
|     	then | ||||
|     	return 0 | ||||
|     end | ||||
| 		 | ||||
|  	-- access | ||||
| @ -168,8 +171,11 @@ function way_function (way, numberOfNodesInWay) | ||||
| 		 	way.speed = route_speeds[route] | ||||
| 		end | ||||
| 	elseif railway and platform_speeds[railway] then | ||||
| 		-- railway platforms | ||||
| 		-- railway platforms (old tagging scheme) | ||||
| 		way.speed = platform_speeds[railway] | ||||
| 	elseif platform_speeds[public_transport] then | ||||
| 		-- public_transport platforms (new tagging platform) | ||||
| 		way.speed = platform_speeds[public_transport] | ||||
|     elseif railway and railway_speeds[railway] then | ||||
| 	 	-- railways | ||||
| 		if access and access_tag_whitelist[access] then | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user