points = nodes_not_used_in_area.collect { |n| [n.id, n.lon_potlatch(baselong,masterscale), n.lat_potlatch(basey,masterscale), n.tags_as_hash] }
# find the relations used by those nodes and ways
points = nodes_not_used_in_area.collect { |n| [n.id, n.lon_potlatch(baselong,masterscale), n.lat_potlatch(basey,masterscale), n.tags_as_hash] }
# find the relations used by those nodes and ways
# the delete_with_relations_and_nodes_and_history method should do this,
# but at present it just throws a 'precondition failed'
way=way.to_i
# the delete_with_relations_and_nodes_and_history method should do this,
# but at present it just throws a 'precondition failed'
way=way.to_i
- db_now='@now'+(rand*100).to_i.to_s+uid.to_s+id.to_i.abs.to_s+Time.new.to_i.to_s
- db_uqn='unin'+(rand*100).to_i.to_s+uid.to_s+way.to_i.abs.to_s+Time.new.to_i.to_s
+ db_now='@now'+(rand*100).to_i.to_s+uid.to_s+way.abs.to_s+Time.new.to_i.to_s
+ db_uqn='unin'+(rand*100).to_i.to_s+uid.to_s+way.abs.to_s+Time.new.to_i.to_s
ActiveRecord::Base.connection.execute("SET #{db_now}=NOW()")
createuniquenodes(way,db_uqn,[])
deleteuniquenoderelations(db_uqn,uid,db_now)
ActiveRecord::Base.connection.execute("SET #{db_now}=NOW()")
createuniquenodes(way,db_uqn,[])
deleteuniquenoderelations(db_uqn,uid,db_now)
# which means the SWF needs to allocate new ids
# - if it's an invisible node, we can reuse the old node id
# which means the SWF needs to allocate new ids
# - if it's an invisible node, we can reuse the old node id
- # get node list from specified version of way,
- # and the _current_ lat/long/tags of each node
+ # ----- get node list from specified version of way,
+ # and the _current_ lat/long/tags of each node
- # if historic (full revert), get the old version of each node
- # - if it's in another way now, generate a new id
- # - if it's not in another way, use the old ID
+ # ----- if historic (full revert), get the old version of each node
+ # - if it's in another way now, generate a new id
+ # - if it's not in another way, use the old ID
+
if historic then
rows.each_index do |i|
sql=<<-EOF
SELECT latitude*0.0000001 AS latitude,longitude*0.0000001 AS longitude,tags,cwn.id AS currentway
FROM nodes n
if historic then
rows.each_index do |i|
sql=<<-EOF
SELECT latitude*0.0000001 AS latitude,longitude*0.0000001 AS longitude,tags,cwn.id AS currentway
FROM nodes n
- rows[i]['longitude']=nx
- rows[i]['latitude' ]=ny
- rows[i]['tags' ]=row['tags']
- end
+ end
+ rows[i]['longitude']=nx
+ rows[i]['latitude' ]=ny
+ rows[i]['tags' ]=row['tags']