X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/849397a33616f0802294047131fbca52b844ce51..2cbcabb3f6992904903a72dfbcef624bd391a314:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index bffff484e..b7667b71d 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -132,6 +132,7 @@ navigable drain: waterway=drain,boat=yes,name=(type name here) derelict canal: waterway=derelict_canal,name=(type name here) unnavigable river: waterway=river,boat=no,name=(type name here) unnavigable drain: waterway=drain,boat=no,name=(type name here) +stream: waterway=stream,boat=no,name=(type name here) way/railway railway: railway=rail @@ -197,7 +198,7 @@ post office: amenity=post_office,tourism=,name=,religion=,denomination= pub: tourism=,amenity=pub,name=(type name here),religion=,denomination= POI/natural -peak: point=peak +peak: natural=peak EOF StringIO.open(txt) do |file| @@ -793,31 +794,25 @@ end def sqlescape(a) - a.gsub(/[\000-\037]/,"").gsub("'","''").gsub(92.chr,92.chr+92.chr) + a.gsub(/[\000-\037]/,"").gsub("'","''").gsub(92.chr) {92.chr+92.chr} end def tag2array(a) tags={} - a.gsub(';;;','#%').split(';').each do |b| - b.gsub!('#%',';;;') - b.gsub!('===','#%') - k,v=b.split('=') - if k.nil? then k='' end - if v.nil? then v='' end - tags[k.gsub('#%','=').gsub(':','|')]=v.gsub('#%','=') + Tags.split(a) do |k, v| + tags[k.gsub(':','|')]=v end tags end def array2tag(a) - str='' + tags = [] a.each do |k,v| if v=='' then next end if v[0,6]=='(type ' then next end - if str!='' then str+=';' end - str+=k.gsub(';',';;;').gsub('=','===').gsub('|',':')+'='+v.gsub(';',';;;').gsub('=','===') + tags << [k.gsub('|',':'), v] end - str + return Tags.join(tags) end def getuserid(token)