An attempt to adapt paremetrs (WIP)

This commit is contained in:
Rafa de la Torre
2016-07-05 10:32:38 +02:00
parent 40cacd99dc
commit 53fe4ce21d
2 changed files with 11 additions and 3 deletions

View File

@@ -91,10 +91,11 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$
else:
source_str = None
# -- TODO Support options properly
if isotype == 'isodistance':
resp = client.calculate_isodistance(source_str, mode, data_range, options)
resp = client.calculate_isodistance(source_str, mode, data_range)
elif isotype == 'isochrone':
resp = client.calculate_isochrone(source_str, mode, data_range, options)
resp = client.calculate_isochrone(source_str, mode, data_range)
if resp:
result = []
@@ -114,7 +115,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$
type_, value_, traceback_ = sys.exc_info()
#quota_service.increment_failed_service_use()
error_msg = 'There was an error trying to obtain isolines using mapzen: {0}'.format(e)
#plpy.notice(traceback.format_tb(traceback_))
plpy.debug(traceback.format_tb(traceback_))
raise e
#plpy.error(error_msg)
finally:

View File

@@ -60,7 +60,14 @@ class MapzenIsolines:
destination_matrix = self._calculate_destination_matrix(origin, destination_points, mode, units)
def _calculate_radius(self, init_radius, mode, mode_type, units):
import logging
#logging.basicConfig(filename='/tmp/isolines.log',level=logging.DEBUG)
logging.debug(mode_type)
if mode_type is 'time':
logging.debug(init_radius)
logging.debug(self.METERS_PER_SECOND[mode])
logging.debug("units = %s", units)
logging.debug(self.UNIT_MULTIPLIER[units])
radius_meters = init_radius * self.METERS_PER_SECOND[mode] * self.UNIT_MULTIPLIER[units]
else:
radius_meters = init_radius