- points.each do |a|
- if a[2] == 0 or a[2].nil? then return -2,"Server error - node with id 0 found in way #{originalway}." end
- if a[1] == 90 then return -2,"Server error - node with lat -90 found in way #{originalway}." end
- end
-
- if points.length < 2 then return -2,"Server error - way is only #{points.length} points long." end
-
- # -- Get unique nodes
-
- if originalway <= 0
- uniques = []
- else
- way = Way.find(originalway)
- uniques = way.unshared_node_ids
- end
- new_way = Way.new
-
- # -- Compare nodes and save changes to any that have changed
-
- nodes = []
-
- points.each do |n|
- lon = n[0].to_f
- lat = n[1].to_f
- id = n[2].to_i
- version = n[3].to_i # FIXME which index does the version come in on????
- savenode = false
- # We always need a new node if we are saving it
- new_node = Node.new