An attempt to adapt paremetrs (WIP)
This commit is contained in:
@@ -91,10 +91,11 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$
|
|||||||
else:
|
else:
|
||||||
source_str = None
|
source_str = None
|
||||||
|
|
||||||
|
# -- TODO Support options properly
|
||||||
if isotype == 'isodistance':
|
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':
|
elif isotype == 'isochrone':
|
||||||
resp = client.calculate_isochrone(source_str, mode, data_range, options)
|
resp = client.calculate_isochrone(source_str, mode, data_range)
|
||||||
|
|
||||||
if resp:
|
if resp:
|
||||||
result = []
|
result = []
|
||||||
@@ -114,7 +115,7 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$
|
|||||||
type_, value_, traceback_ = sys.exc_info()
|
type_, value_, traceback_ = sys.exc_info()
|
||||||
#quota_service.increment_failed_service_use()
|
#quota_service.increment_failed_service_use()
|
||||||
error_msg = 'There was an error trying to obtain isolines using mapzen: {0}'.format(e)
|
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
|
raise e
|
||||||
#plpy.error(error_msg)
|
#plpy.error(error_msg)
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
@@ -60,7 +60,14 @@ class MapzenIsolines:
|
|||||||
destination_matrix = self._calculate_destination_matrix(origin, destination_points, mode, units)
|
destination_matrix = self._calculate_destination_matrix(origin, destination_points, mode, units)
|
||||||
|
|
||||||
def _calculate_radius(self, init_radius, mode, mode_type, 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':
|
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]
|
radius_meters = init_radius * self.METERS_PER_SECOND[mode] * self.UNIT_MULTIPLIER[units]
|
||||||
else:
|
else:
|
||||||
radius_meters = init_radius
|
radius_meters = init_radius
|
||||||
|
|||||||
Reference in New Issue
Block a user