Adding a restriction to prevent more than 2000 nodes to be added to any way. Tests still need to be written. Capabilities api request also updated.
This commit is contained in:
parent
7418fc7e86
commit
635daf1773
4 changed files with 24 additions and 1 deletions
|
@ -238,6 +238,9 @@ class Way < ActiveRecord::Base
|
|||
|
||||
def preconditions_ok?
|
||||
return false if self.nds.empty?
|
||||
if self.nds.length > APP_CONFIG['max_number_of_way_nodes']
|
||||
raise OSM::APITooManyWayNodesError.new(self.nds.count, APP_CONFIG['max_number_of_way_nodes'])
|
||||
end
|
||||
self.nds.each do |n|
|
||||
node = Node.find(:first, :conditions => ["id = ?", n])
|
||||
unless node and node.visible
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue