Merge pull request #490 from CartoDB/development
Release python library 0.17.5
This commit is contained in:
commit
53e9ad4d2e
17
NEWS.md
17
NEWS.md
@ -1,25 +1,26 @@
|
||||
|
||||
March 16th, 2018
|
||||
March 27th, 2018
|
||||
================
|
||||
* Version `0.30.4` of server side
|
||||
* Added ST_CollectionExtract to ST_MakeValid for Mapbox isolines to avoid non-polygonal geometries
|
||||
* Version `0.17.5` of python library
|
||||
* Avoid reaching provider for empty geocodings (but still incrementing empty service use) #476
|
||||
|
||||
March 16th, 2018
|
||||
================
|
||||
* Version `0.30.3` of server side
|
||||
* Fix problem with invalid Mapbox isolines
|
||||
* Fix problem with invalid Mapbox isolines #483
|
||||
* Version `0.30.4` of server side
|
||||
* Added ST_CollectionExtract to ST_MakeValid for Mapbox isolines to avoid non-polygonal geometries #486
|
||||
|
||||
March 14th, 2018
|
||||
================
|
||||
* Version `0.17.4` of the python library
|
||||
* Fix bug with previous version when checking quotas
|
||||
* Fix bug with previous version when checking quotas #480
|
||||
* Version `0.17.3` of the python library
|
||||
* Fix bug with Mapbox routing not using the proper quota value
|
||||
* Fix bug with Mapbox routing not using the proper quota value #477
|
||||
|
||||
February 22th, 2018
|
||||
==================
|
||||
* Version `0.17.2` of the python library
|
||||
* Fix bug with Mapbox isolines not stopping at the seacoast
|
||||
* Fix bug with Mapbox isolines not stopping at the seacoast #471
|
||||
|
||||
February 27th, 2018
|
||||
==================
|
||||
|
@ -64,18 +64,31 @@ class MapboxGeocoder(Traceable):
|
||||
latitude = location[1]
|
||||
return [longitude, latitude]
|
||||
|
||||
def _validate_input(self, searchtext, city=None, state_province=None,
|
||||
country=None):
|
||||
if searchtext and searchtext.strip():
|
||||
return True
|
||||
elif city:
|
||||
return True
|
||||
elif state_province:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
@qps_retry(qps=10)
|
||||
def geocode(self, searchtext, city=None, state_province=None,
|
||||
country=None):
|
||||
if searchtext and searchtext.strip():
|
||||
address = [normalize(searchtext)]
|
||||
if city:
|
||||
address.append(normalize(city))
|
||||
if state_province:
|
||||
address.append(normalize(state_province))
|
||||
else:
|
||||
if not self._validate_input(searchtext, city, state_province, country):
|
||||
return []
|
||||
|
||||
address = []
|
||||
if searchtext and searchtext.strip():
|
||||
address.append(normalize(searchtext))
|
||||
if city:
|
||||
address.append(normalize(city))
|
||||
if state_province:
|
||||
address.append(normalize(state_province))
|
||||
|
||||
country = [country] if country else None
|
||||
|
||||
try:
|
||||
|
@ -10,7 +10,7 @@ from setuptools import setup, find_packages
|
||||
setup(
|
||||
name='cartodb_services',
|
||||
|
||||
version='0.17.4',
|
||||
version='0.17.5',
|
||||
|
||||
description='CartoDB Services API Python Library',
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user