From: Tom Hughes Date: Mon, 6 Sep 2010 11:51:50 +0000 (+0100) Subject: Merge branch 'master' into openstreetbugs X-Git-Tag: live~5120^2~203 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/6fb857020092c909043c4521b91a040f3bb16937 Merge branch 'master' into openstreetbugs Conflicts: config/environment.rb config/routes.rb --- 6fb857020092c909043c4521b91a040f3bb16937 diff --cc config/routes.rb index 49b58c844,e2018784d..3cd95c983 --- a/config/routes.rb +++ b/config/routes.rb @@@ -70,30 -71,8 +71,29 @@@ ActionController::Routing::Routes.draw map.connect "api/#{API_VERSION}/amf/read", :controller =>'amf', :action =>'amf_read' map.connect "api/#{API_VERSION}/amf/write", :controller =>'amf', :action =>'amf_write' map.connect "api/#{API_VERSION}/swf/trackpoints", :controller =>'swf', :action =>'trackpoints' + + # Map Bugs API + map.connect "api/#{API_VERSION}/bugs/getBugs", :controller =>'map_bugs', :action =>'get_bugs' + map.connect "api/#{API_VERSION}/bugs/addPOIexec", :controller =>'map_bugs', :action =>'add_bug' + map.connect "api/#{API_VERSION}/bugs/closePOIexec", :controller =>'map_bugs', :action =>'close_bug' + map.connect "api/#{API_VERSION}/bugs/editPOIexec", :controller =>'map_bugs', :action =>'edit_bug' + map.connect "api/#{API_VERSION}/bugs/getGPX", :controller =>'map_bugs', :action =>'gpx_bugs' + map.connect "api/#{API_VERSION}/bugs/getRSSfeed", :controller =>'map_bugs', :action =>'rss' + + map.connect "api/#{API_VERSION}/bugs", :controller => 'map_bugs', :action => 'get_bugs' + map.connect "api/#{API_VERSION}/bugs/search", :controller => 'map_bugs', :action => 'search' + map.connect "api/#{API_VERSION}/bugs/rss", :controller =>'map_bugs', :action =>'rss' + map.connect "api/#{API_VERSION}/bug/create", :controller => 'map_bugs', :action => 'add_bug' + map.connect "api/#{API_VERSION}/bug/:id/comment", :controller => 'map_bugs', :action => 'edit_bug', :id => /\d+/ + map.connect "api/#{API_VERSION}/bug/:id/close", :controller => 'map_bugs', :action => 'close_bug', :id => /\d+/ + map.connect "api/#{API_VERSION}/bug/:id", :controller => 'map_bugs', :action => 'read', :id => /\d+/, :conditions => { :method => :get } + map.connect "api/#{API_VERSION}/bug/:id", :controller => 'map_bugs', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete } + + map.connect '/user/:display_name/bugs', :controller => 'map_bugs', :action => 'my_bugs' + + # Data browsing - map.connect '/browse', :controller => 'changeset', :action => 'list' map.connect '/browse/start', :controller => 'browse', :action => 'start' map.connect '/browse/way/:id', :controller => 'browse', :action => 'way', :id => /\d+/ map.connect '/browse/way/:id/history', :controller => 'browse', :action => 'way_history', :id => /\d+/ @@@ -102,10 -81,12 +102,13 @@@ map.connect '/browse/relation/:id', :controller => 'browse', :action => 'relation', :id => /\d+/ map.connect '/browse/relation/:id/history', :controller => 'browse', :action => 'relation_history', :id => /\d+/ map.changeset '/browse/changeset/:id', :controller => 'browse', :action => 'changeset', :id => /\d+/ - map.connect '/browse/changesets', :controller => 'changeset', :action => 'list' + map.connect '/user/:display_name/edits/feed', :controller => 'changeset', :action => 'list', :format =>:atom + map.connect '/user/:display_name/edits', :controller => 'changeset', :action => 'list' map.connect '/browse/changesets/feed', :controller => 'changeset', :action => 'list', :format => :atom + map.connect '/browse/changesets', :controller => 'changeset', :action => 'list' + map.connect '/browse/bug/:id', :controller => 'browse', :action => 'bug', :id => /\d+/ - + map.connect '/browse', :controller => 'changeset', :action => 'list' + # web site map.root :controller => 'site', :action => 'index' map.connect '/', :controller => 'site', :action => 'index' diff --cc lib/map_boundary.rb index f2a0c0b52,f3accf2da..7d20d2920 --- a/lib/map_boundary.rb +++ b/lib/map_boundary.rb @@@ -22,12 -22,10 +22,12 @@@ module MapBoundar raise OSM::APIBadBoundingBox.new("The latitudes must be between -90 and 90, and longitudes between -180 and 180") end + return unless limit_small_area == :true + # check the bbox isn't too large requested_area = (max_lat-min_lat)*(max_lon-min_lon) - if requested_area > APP_CONFIG['max_request_area'] - raise OSM::APIBadBoundingBox.new("The maximum bbox size is " + APP_CONFIG['max_request_area'].to_s + + if requested_area > MAX_REQUEST_AREA + raise OSM::APIBadBoundingBox.new("The maximum bbox size is " + MAX_REQUEST_AREA.to_s + ", and your request was too large. Either request a smaller area, or use planet.osm") end end