# 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']
# Get an XML response containing a list of tracepoints that have been uploaded
# within the specified bounding box, and in the specified page.
def trackpoints
- @@count+=1
#retrieve the page number
page = params['page'].to_i
unless page
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"
# fetched. All the nodes and ways that are referenced by those ways are then
# fetched. Finally all the xml is returned.
def map
- GC.start
- @@count+=1
# Figure out the bbox
bbox = params['bbox']
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
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