Missing changes in v23 script
This commit is contained in:
@@ -1812,7 +1812,7 @@ RETURNS Geometry AS $$
|
|||||||
geocoder = HereMapsGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params)
|
geocoder = HereMapsGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params)
|
||||||
coordinates = geocoder.geocode(searchtext=searchtext, city=city, state=state_province, country=country)
|
coordinates = geocoder.geocode(searchtext=searchtext, city=city, state=state_province, country=country)
|
||||||
if coordinates:
|
if coordinates:
|
||||||
quota_service.increment_success_service_use()
|
service_manager.quota_service.increment_success_service_use()
|
||||||
plan = plpy.prepare("SELECT ST_SetSRID(ST_MakePoint($1, $2), 4326); ", ["double precision", "double precision"])
|
plan = plpy.prepare("SELECT ST_SetSRID(ST_MakePoint($1, $2), 4326); ", ["double precision", "double precision"])
|
||||||
point = plpy.execute(plan, [coordinates[0], coordinates[1]], 1)[0]
|
point = plpy.execute(plan, [coordinates[0], coordinates[1]], 1)[0]
|
||||||
return point['st_setsrid']
|
return point['st_setsrid']
|
||||||
@@ -1822,7 +1822,7 @@ RETURNS Geometry AS $$
|
|||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
import sys
|
import sys
|
||||||
service_manager.quota_service.increment_failed_service_use()
|
service_manager.quota_service.increment_failed_service_use()
|
||||||
logger.error('Error trying to geocode street point using here maps', sys.exc_info(), data={"username": username, "orgname": orgname})
|
service_manager.logger.error('Error trying to geocode street point using here maps', sys.exc_info(), data={"username": username, "orgname": orgname})
|
||||||
raise Exception('Error trying to geocode street point using here maps')
|
raise Exception('Error trying to geocode street point using here maps')
|
||||||
finally:
|
finally:
|
||||||
service_manager.quota_service.increment_total_service_use()
|
service_manager.quota_service.increment_total_service_use()
|
||||||
@@ -1854,7 +1854,7 @@ RETURNS Geometry AS $$
|
|||||||
service_manager.logger.error('Error trying to geocode street point using google maps', sys.exc_info(), data={"username": username, "orgname": orgname})
|
service_manager.logger.error('Error trying to geocode street point using google maps', sys.exc_info(), data={"username": username, "orgname": orgname})
|
||||||
raise Exception('Error trying to geocode street point using google maps')
|
raise Exception('Error trying to geocode street point using google maps')
|
||||||
finally:
|
finally:
|
||||||
quota_service.increment_total_service_use()
|
service_manager.quota_service.increment_total_service_use()
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL)
|
CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_mapzen_geocode_street_point(username TEXT, orgname TEXT, searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user