various fixes
This commit is contained in:
parent
551f96197c
commit
6ccf25b347
7 changed files with 13 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
||||||
class AmfController < ApplicationController
|
class AmfController < ApplicationController
|
||||||
|
=begin
|
||||||
require 'stringio'
|
require 'stringio'
|
||||||
|
|
||||||
# to log:
|
# to log:
|
||||||
|
@ -610,5 +611,5 @@ class AmfController < ApplicationController
|
||||||
180/Math::PI * (2*Math.atan(Math.exp(a*Math::PI/180))-Math::PI/2)
|
180/Math::PI * (2*Math.atan(Math.exp(a*Math::PI/180))-Math::PI/2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
=end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,6 +18,7 @@ class ApiController < ApplicationController
|
||||||
|
|
||||||
def map
|
def map
|
||||||
@@count+=1
|
@@count+=1
|
||||||
|
|
||||||
response.headers["Content-Type"] = 'text/xml'
|
response.headers["Content-Type"] = 'text/xml'
|
||||||
# Figure out the bbox
|
# Figure out the bbox
|
||||||
bbox = params['bbox']
|
bbox = params['bbox']
|
||||||
|
@ -103,14 +104,14 @@ class ApiController < ApplicationController
|
||||||
doc.root << way.to_xml_node()
|
doc.root << way.to_xml_node()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
render :text => doc.to_s
|
||||||
|
|
||||||
#exit when we have too many requests
|
#exit when we have too many requests
|
||||||
if @@count > MAX_COUNT
|
if @@count > MAX_COUNT
|
||||||
render :text => doc.to_s
|
render :text => doc.to_s
|
||||||
@@count = COUNT
|
@@count = COUNT
|
||||||
exit
|
exit!
|
||||||
end
|
end
|
||||||
|
|
||||||
render :text => doc.to_s
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -107,7 +107,7 @@ class TraceController < ApplicationController
|
||||||
@trace.timestamp = Time.now
|
@trace.timestamp = Time.now
|
||||||
|
|
||||||
if @trace.save
|
if @trace.save
|
||||||
saved_filename = "/tmp/#{@trace.id}.gpx"
|
saved_filename = "/home/osm/gpx/#{@trace.id}.gpx"
|
||||||
File.rename(filename, saved_filename)
|
File.rename(filename, saved_filename)
|
||||||
|
|
||||||
logger.info("id is #{@trace.id}")
|
logger.info("id is #{@trace.id}")
|
||||||
|
|
|
@ -85,7 +85,7 @@ class Node < ActiveRecord::Base
|
||||||
el1['lon'] = self.longitude.to_s
|
el1['lon'] = self.longitude.to_s
|
||||||
|
|
||||||
# el['user'] = self.user.display_name if self.user.data_public?
|
# el['user'] = self.user.display_name if self.user.data_public?
|
||||||
|
user_display_name_cache = {} if user_display_name_cache.nil?
|
||||||
if user_display_name_cache and user_display_name_cache[self.user_id]
|
if user_display_name_cache and user_display_name_cache[self.user_id]
|
||||||
# use the cache if available
|
# use the cache if available
|
||||||
else
|
else
|
||||||
|
|
|
@ -78,6 +78,8 @@ class Segment < ActiveRecord::Base
|
||||||
el1['id'] = self.id.to_s
|
el1['id'] = self.id.to_s
|
||||||
el1['from'] = self.node_a.to_s
|
el1['from'] = self.node_a.to_s
|
||||||
el1['to'] = self.node_b.to_s
|
el1['to'] = self.node_b.to_s
|
||||||
|
|
||||||
|
user_display_name_cache = {} if user_display_name_cache.nil?
|
||||||
if user_display_name_cache and user_display_name_cache[self.user_id]
|
if user_display_name_cache and user_display_name_cache[self.user_id]
|
||||||
# use the cache if available
|
# use the cache if available
|
||||||
else
|
else
|
||||||
|
|
|
@ -56,6 +56,8 @@ class Way < ActiveRecord::Base
|
||||||
el1['visible'] = self.visible.to_s
|
el1['visible'] = self.visible.to_s
|
||||||
el1['timestamp'] = self.timestamp.xmlschema
|
el1['timestamp'] = self.timestamp.xmlschema
|
||||||
|
|
||||||
|
user_display_name_cache = {} if user_display_name_cache.nil?
|
||||||
|
|
||||||
if user_display_name_cache and user_display_name_cache[self.user_id]
|
if user_display_name_cache and user_display_name_cache[self.user_id]
|
||||||
# use the cache if available
|
# use the cache if available
|
||||||
else
|
else
|
||||||
|
|
|
@ -77,4 +77,4 @@ HTTP_EXPECTATION_FAILED = 417
|
||||||
#Taming FCGI
|
#Taming FCGI
|
||||||
#
|
#
|
||||||
COUNT = 0
|
COUNT = 0
|
||||||
MAX_COUNT = 500
|
MAX_COUNT = 10
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue