# we put all the nodes into the hash, as it doesn't matter whether the node was
# added, deleted or modified - the tile will need updating anyway.
# we put all the nodes into the hash, as it doesn't matter whether the node was
# added, deleted or modified - the tile will need updating anyway.
# itself deleted and the coverage of the point set isn't enough to encompass the
# change.
node_cache = NodeCache.new(NODE_CACHE_FILE)
# itself deleted and the coverage of the point set isn't enough to encompass the
# change.
node_cache = NodeCache.new(NODE_CACHE_FILE)
next if nodes.include? node_id
# this is a node referenced but not added, modified or deleted, so it should
# still be in the node cache.
next if nodes.include? node_id
# this is a node referenced but not added, modified or deleted, so it should
# still be in the node cache.
point = Proj4::Point.new(entry.lon, entry.lat)
nodes[node_id] = tile_from_merc(point, max_zoom)
end
point = Proj4::Point.new(entry.lon, entry.lat)
nodes[node_id] = tile_from_merc(point, max_zoom)
end
throw "Unexpected format" unless @cache[0..3].unpack("l").first == 1
throw "Unexpected ID size" unless @cache[4..7].unpack("l").first == 8
throw "Unexpected format" unless @cache[0..3].unpack("l").first == 1
throw "Unexpected ID size" unless @cache[4..7].unpack("l").first == 8