various fixes
authorSteve Coast <steve@asklater.com>
Wed, 9 May 2007 17:31:11 +0000 (17:31 +0000)
committerSteve Coast <steve@asklater.com>
Wed, 9 May 2007 17:31:11 +0000 (17:31 +0000)
app/controllers/amf_controller.rb
app/controllers/api_controller.rb
app/controllers/trace_controller.rb
app/models/node.rb
app/models/segment.rb
app/models/way.rb
config/environment.rb

index a864d3dcf2a6d7a6a9a0e1d06ae2d05c63edbb86..9947a4eaabe81fb771e91d9e82ecd9ede233422f 100644 (file)
@@ -1,4 +1,5 @@
 class AmfController < ApplicationController
+=begin
   require 'stringio'
 
 # to log:
@@ -610,5 +611,5 @@ class AmfController < ApplicationController
                180/Math::PI * (2*Math.atan(Math.exp(a*Math::PI/180))-Math::PI/2)
        end
 
-
+=end
 end
index 8261e56aa07882fd89ebf66a9c76a2e4a8bd67a5..3c739e37f84bc3c5f60a865399e116612f6932a1 100644 (file)
@@ -18,6 +18,7 @@ class ApiController < ApplicationController
 
   def map
     @@count+=1
+
     response.headers["Content-Type"] = 'text/xml'
     # Figure out the bbox
     bbox = params['bbox']
@@ -103,14 +104,14 @@ class ApiController < ApplicationController
       doc.root << way.to_xml_node()
     end 
 
+    render :text => doc.to_s
+    
     #exit when we have too many requests
     if @@count > MAX_COUNT
       render :text => doc.to_s
       @@count = COUNT
-      exit 
+      exit!
     end
 
-    render :text => doc.to_s
-
   end
 end
index ac4a4056ef1f02fdb3d20e83fe3d9fb977ce57ce..b4e9d7f51aeadfbfc4306d5a4aabf50914cca694 100644 (file)
@@ -107,7 +107,7 @@ class TraceController < ApplicationController
     @trace.timestamp = Time.now
 
     if @trace.save
-      saved_filename = "/tmp/#{@trace.id}.gpx"
+      saved_filename = "/home/osm/gpx/#{@trace.id}.gpx"
       File.rename(filename, saved_filename)
 
       logger.info("id is #{@trace.id}")
index 6f01ccee04a17af1613288cb4fb4a107ec1efcf6..6eecc853d12a585577a95e36c3a1e87331bf5fd4 100644 (file)
@@ -85,7 +85,7 @@ class Node < ActiveRecord::Base
     el1['lon'] = self.longitude.to_s
 
     # 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]
       # use the cache if available
     else
index b6f60ec3f9dd9d2c181d229ff85c958fb2e15f31..14949879dc6d3cb98cab74621bb2909034f42ba4 100644 (file)
@@ -78,6 +78,8 @@ class Segment < ActiveRecord::Base
     el1['id'] = self.id.to_s
     el1['from'] = self.node_a.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]
       # use the cache if available
     else
index cd06b121035cf5e89a67e8531152fc0b51ffa39b..65bb3158debd3c545c47b869ed6de3c50a900ba6 100644 (file)
@@ -56,6 +56,8 @@ class Way < ActiveRecord::Base
     el1['visible'] = self.visible.to_s
     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]
       # use the cache if available
     else
index e7a6c91ef8251b8ffcb5cf05da844de33540df55..35bb86bf076611d0c2e5c015950f975c4bd8af4d 100644 (file)
@@ -77,4 +77,4 @@ HTTP_EXPECTATION_FAILED = 417
 #Taming FCGI
 #
 COUNT = 0
-MAX_COUNT = 500
+MAX_COUNT = 10