def get(self, output_format):
        lats_str = self.request.get("lats")
        lons_str = self.request.get("lons")
        lats = lats_str.split(",")
        lons = lons_str.split(",")

        self.out(altitude.page_profile(db, utils, [lats, lons], output_format, "get"))
 def GET(self, output_format):
   data = web.input()
   lats = data.lats.split(",")
   lons = data.lons.split(",")
   
   res = altitude.page_profile(db, utils, [lats,lons], output_format, "get")
   header = res[0]
   body = res[1]
   web.header('Content-Type', header)
   web.output(body)
 def POST(self, output_format, input_format):
   # Determine whether the post request is a protocol buffer or
   # an XML document. (I am sure there is a more elegant way)
   try: 
     postdata =  web.input()['protobuf']
   except:
     try:
       postdata = '<?xml version=' + web.input()['<?xml version']
     except:
       web.header('Content-Type', 'html/txt')
       web.output("Wrong input format")
       #web.internalerror() 
       return
       
   res = altitude.page_profile(db, utils, postdata, output_format, input_format)
   header = res[0]
   body = res[1]
   web.header('Content-Type', header)
   web.output(body)
 def post(self, output_format, input_format):
     self.out(altitude.page_profile(db, utils, self.request.body, output_format, input_format))