class ApiController < ApplicationController
session :off
- before_filter :check_read_availability, :except => [:capabilities]
+ before_filter :check_api_readable, :except => [:capabilities]
after_filter :compress_output
# Help methods for checking boundary sanity and area size
include MapBoundary
- #COUNT is the number of map requests to allow before exiting and starting a new process
- @@count = COUNT
-
# The maximum area you're allowed to request, in square degrees
MAX_REQUEST_AREA = APP_CONFIG['max_request_area']
points = Tracepoint.find_by_area(min_lat, min_lon, max_lat, max_lon, :offset => offset, :limit => TRACEPOINTS_PER_PAGE, :order => "timestamp DESC" )
doc = XML::Document.new
- doc.encoding = 'UTF-8'
+ doc.encoding = XML::Encoding::UTF_8
root = XML::Node.new 'gpx'
root['version'] = '1.0'
root['creator'] = 'OpenStreetMap.org'
trkseg << point.to_xml_node()
end
- #exit when we have too many requests
- if @@count > MAX_COUNT
- render :text => doc.to_s, :content_type => "text/xml"
- @@count = COUNT
- exit!
- end
-
response.headers["Content-Disposition"] = "attachment; filename=\"map.osm\""
render :text => doc.to_s, :content_type => "text/xml"
response.headers["Content-Disposition"] = "attachment; filename=\"map.osm\""
render :text => doc.to_s, :content_type => "text/xml"
-
- #exit when we have too many requests
- if @@count > MAX_COUNT
- @@count = COUNT
-
- exit!
- end
end
# Get a list of the tiles that have changed within a specified time
endtime = Time.parse(params[:end])
else
hours = (params[:hours] || '1').to_i.hours
- endtime = Time.now
+ endtime = Time.now.getutc
starttime = endtime - hours
end
waynodes = XML::Node.new 'waynodes'
waynodes['maximum'] = APP_CONFIG['max_number_of_way_nodes'].to_s
api << waynodes
+ changesets = XML::Node.new 'changesets'
+ changesets['maximum_elements'] = Changeset::MAX_ELEMENTS.to_s
+ api << changesets
doc.root << api