Add support for 64bit OSM node id values.

This commit is contained in:
Daniel Patterson
2015-11-24 16:33:19 -08:00
parent c0fdcb381a
commit f87f18a291
22 changed files with 311 additions and 132 deletions
+4 -2
View File
@@ -28,7 +28,7 @@ Given /^the node map$/ do |table|
raise "*** invalid node name '#{name}', must me alphanumeric" unless name.match /[a-z0-9]/
if name.match /[a-z]/
raise "*** duplicate node '#{name}'" if name_node_hash[name]
add_osm_node name, *table_coord_to_lonlat(ci,ri)
add_osm_node name, *table_coord_to_lonlat(ci,ri), nil
else
raise "*** duplicate node '#{name}'" if location_hash[name]
add_location name, *table_coord_to_lonlat(ci,ri)
@@ -43,7 +43,9 @@ Given /^the node locations$/ do |table|
name = row['node']
raise "*** duplicate node '#{name}'" if find_node_by_name name
if name.match /[a-z]/
add_osm_node name, row['lon'].to_f, row['lat'].to_f
id = row['id']
id = id.to_i if id
add_osm_node name, row['lon'].to_f, row['lat'].to_f, id
else
add_location name, row['lon'].to_f, row['lat'].to_f
end
+3 -2
View File
@@ -123,8 +123,9 @@ def table_coord_to_lonlat ci,ri
[@origin[0]+ci*@zoom, @origin[1]-ri*@zoom]
end
def add_osm_node name,lon,lat
node = OSM::Node.new make_osm_id, OSM_USER, OSM_TIMESTAMP, lon, lat
def add_osm_node name,lon,lat,id
id = make_osm_id if id == nil
node = OSM::Node.new id, OSM_USER, OSM_TIMESTAMP, lon, lat
node << { :name => name }
node.uid = OSM_UID
osm_db << node
+23
View File
@@ -0,0 +1,23 @@
@testbot
Feature: Support 64bit node IDs
# Without 64bit support, this test should fail
Scenario: 64bit overflow conflicts
Given the node locations
| node | lat | lon | id |
| a | 55.660778 | 12.573909 | 1 |
| b | 55.660672 | 12.573693 | 2 |
| c | 55.660128 | 12.572546 | 3 |
| d | 55.660015 | 12.572476 | 4294967297 |
| e | 55.660119 | 12.572325 | 4294967298 |
| x | 55.660818 | 12.574051 | 4294967299 |
| y | 55.660073 | 12.574067 | 4294967300 |
And the ways
| nodes |
| abc |
| cdec |
When I route I should get
| from | to | route | turns |
| x | y | abc | head,destination |