Merge pull request #468 from CartoDB/remove_legacy_mapzen

Remove legacy mapzen
This commit is contained in:
Antonio Carlón
2018-02-22 12:41:48 +01:00
committed by GitHub
7 changed files with 53 additions and 39 deletions
+5
View File
@@ -1,3 +1,8 @@
February 22th, 2018
==================
* Version `0.17.0` of the python library
* Change default provider to Mapbox
* Remove the obligatory nature of the Mapzen configuration due to its deprecation as provider
February 13th, 2018 February 13th, 2018
================== ==================
@@ -1,3 +1,5 @@
-- Only show warning or error messages in the tests output
SET client_min_messages TO WARNING;
-- Install dependencies -- Install dependencies
CREATE EXTENSION postgis; CREATE EXTENSION postgis;
CREATE EXTENSION plpythonu; CREATE EXTENSION plpythonu;
+2
View File
@@ -1,3 +1,5 @@
-- Only show warning or error messages in the tests output
SET client_min_messages TO WARNING;
-- Install dependencies -- Install dependencies
CREATE EXTENSION postgis; CREATE EXTENSION postgis;
CREATE EXTENSION plpythonu; CREATE EXTENSION plpythonu;
@@ -1,3 +1,5 @@
-- Only show warning or error messages in the tests output
SET client_min_messages TO WARNING;
-- Install dependencies -- Install dependencies
CREATE EXTENSION postgis; CREATE EXTENSION postgis;
CREATE EXTENSION plpythonu; CREATE EXTENSION plpythonu;
@@ -1,3 +1,5 @@
-- Only show warning or error messages in the tests output
SET client_min_messages TO WARNING;
-- Install dependencies -- Install dependencies
CREATE EXTENSION postgis; CREATE EXTENSION postgis;
CREATE EXTENSION plpythonu; CREATE EXTENSION plpythonu;
@@ -136,7 +136,7 @@ class RoutingConfig(ServiceConfig):
ROUTING_PROVIDER_KEY = 'routing_provider' ROUTING_PROVIDER_KEY = 'routing_provider'
MAPZEN_PROVIDER = 'mapzen' MAPZEN_PROVIDER = 'mapzen'
MAPBOX_PROVIDER = 'mapbox' MAPBOX_PROVIDER = 'mapbox'
DEFAULT_PROVIDER = MAPZEN_PROVIDER DEFAULT_PROVIDER = MAPBOX_PROVIDER
QUOTA_KEY = 'mapzen_routing_quota' QUOTA_KEY = 'mapzen_routing_quota'
SOFT_LIMIT_KEY = 'soft_mapzen_routing_limit' SOFT_LIMIT_KEY = 'soft_mapzen_routing_limit'
METRICS_LOG_KEY = 'routing_log_path' METRICS_LOG_KEY = 'routing_log_path'
@@ -226,7 +226,7 @@ class IsolinesRoutingConfig(ServiceConfig):
MAPZEN_PROVIDER = 'mapzen' MAPZEN_PROVIDER = 'mapzen'
MAPBOX_PROVIDER = 'mapbox' MAPBOX_PROVIDER = 'mapbox'
HEREMAPS_PROVIDER = 'heremaps' HEREMAPS_PROVIDER = 'heremaps'
DEFAULT_PROVIDER = MAPZEN_PROVIDER DEFAULT_PROVIDER = MAPBOX_PROVIDER
METRICS_LOG_KEY = 'isolines_log_path' METRICS_LOG_KEY = 'isolines_log_path'
def __init__(self, redis_connection, db_conn, username, orgname=None): def __init__(self, redis_connection, db_conn, username, orgname=None):
@@ -391,7 +391,7 @@ class GeocoderConfig(ServiceConfig):
USERNAME_KEY = 'username' USERNAME_KEY = 'username'
ORGNAME_KEY = 'orgname' ORGNAME_KEY = 'orgname'
PERIOD_END_DATE = 'period_end_date' PERIOD_END_DATE = 'period_end_date'
DEFAULT_PROVIDER = MAPZEN_GEOCODER DEFAULT_PROVIDER = MAPBOX_GEOCODER
METRICS_LOG_KEY = 'geocoder_log_path' METRICS_LOG_KEY = 'geocoder_log_path'
def __init__(self, redis_connection, db_conn, username, orgname=None, forced_provider=None): def __init__(self, redis_connection, db_conn, username, orgname=None, forced_provider=None):
@@ -576,7 +576,7 @@ class ServicesDBConfig:
heremaps_conf_json = self._get_conf('heremaps_conf') heremaps_conf_json = self._get_conf('heremaps_conf')
if not heremaps_conf_json: if not heremaps_conf_json:
raise ConfigException('Here maps configuration missing') raise ConfigException('Here maps configuration missing')
else:
heremaps_conf = json.loads(heremaps_conf_json) heremaps_conf = json.loads(heremaps_conf_json)
self._heremaps_geocoder_app_id = heremaps_conf['geocoder']['app_id'] self._heremaps_geocoder_app_id = heremaps_conf['geocoder']['app_id']
self._heremaps_geocoder_app_code = heremaps_conf['geocoder']['app_code'] self._heremaps_geocoder_app_code = heremaps_conf['geocoder']['app_code']
@@ -589,9 +589,10 @@ class ServicesDBConfig:
def _get_mapzen_config(self): def _get_mapzen_config(self):
mapzen_conf_json = self._get_conf('mapzen_conf') mapzen_conf_json = self._get_conf('mapzen_conf')
# We dont use mapzen anymore so we don't need to check for its configuration
if not mapzen_conf_json: if not mapzen_conf_json:
raise ConfigException('Mapzen configuration missing') return
else:
mapzen_conf = json.loads(mapzen_conf_json) mapzen_conf = json.loads(mapzen_conf_json)
self._mapzen_matrix_api_key = mapzen_conf['matrix']['api_key'] self._mapzen_matrix_api_key = mapzen_conf['matrix']['api_key']
self._mapzen_matrix_quota = mapzen_conf['matrix']['monthly_quota'] self._mapzen_matrix_quota = mapzen_conf['matrix']['monthly_quota']
@@ -608,7 +609,7 @@ class ServicesDBConfig:
mapbox_conf_json = self._get_conf('mapbox_conf') mapbox_conf_json = self._get_conf('mapbox_conf')
if not mapbox_conf_json: if not mapbox_conf_json:
raise ConfigException('Mapbox configuration missing') raise ConfigException('Mapbox configuration missing')
else:
mapbox_conf = json.loads(mapbox_conf_json) mapbox_conf = json.loads(mapbox_conf_json)
self._mapbox_matrix_api_keys = mapbox_conf['matrix']['api_keys'] self._mapbox_matrix_api_keys = mapbox_conf['matrix']['api_keys']
self._mapbox_matrix_quota = mapbox_conf['matrix']['monthly_quota'] self._mapbox_matrix_quota = mapbox_conf['matrix']['monthly_quota']
+1 -1
View File
@@ -10,7 +10,7 @@ from setuptools import setup, find_packages
setup( setup(
name='cartodb_services', name='cartodb_services',
version='0.16.7', version='0.17.0',
description='CartoDB Services API Python Library', description='CartoDB Services API Python Library',