Update bulk geocoder SQL function for GS7 support (serial) and 6.2 apikey support

This commit is contained in:
Mmoncadaisla 2021-05-17 15:11:04 +02:00
parent d38c894d1b
commit fb57645595

View File

@ -57,10 +57,10 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server._cdb_bulk_heremaps_geocode_st
RETURNS SETOF cdb_dataservices_server.geocoding AS $$ RETURNS SETOF cdb_dataservices_server.geocoding AS $$
from cartodb_services import run_street_point_geocoder from cartodb_services import run_street_point_geocoder
from cartodb_services.tools import LegacyServiceManager from cartodb_services.tools import LegacyServiceManager
from cartodb_services.here import HereMapsBulkGeocoder from cartodb_services.here import get_bulk_geocoder
service_manager = LegacyServiceManager('geocoder', username, orgname, GD) service_manager = LegacyServiceManager('geocoder', username, orgname, GD)
geocoder = HereMapsBulkGeocoder(service_manager.config.heremaps_app_id, service_manager.config.heremaps_app_code, service_manager.logger, service_manager.config.heremaps_service_params) geocoder = get_bulk_geocoder(app_id=service_manager.config.heremaps_app_id or None, app_code=service_manager.config.heremaps_app_code or None, logger=service_manager.logger, service_params=service_manager.config.heremaps_service_params, apikey=service_manager.config.apikey or None, use_apikey=service_manager.config.use_apikey or False)
return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches) return run_street_point_geocoder(plpy, GD, geocoder, service_manager, username, orgname, searches)
$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED; $$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED;