Вы, возможно, очень хорошо знаете геокодеры (см. http://geopy.readthedocs.io/en/latest/#module-geopy.geocoders). Он обеспечивает единообразный доступ к различным услугам, связанным с этим. В документации (https://media.readthedocs.org/pdf/geopy/latest/geopy.pdf) перечислены их на стр. 47. Я понятия не имею, какой из них может быть быстрее, чем вы используете. Однако, учитывая размер вашей задачи, они, возможно, заслуживают внимания. Этот код предназначен для обеспечения первого разреза в том, что предлагается.
import geopy.geocoders
import inspect
import string
serviceNames = [_[0] for _ in inspect.getmembers(geopy.geocoders) \
if not _[0].startswith('__')
and _[0][0] in string.ascii_uppercase
]
print (serviceNames)
for serviceName in serviceNames:
try:
exec('geolocator = geopy.geocoders.%s()' % serviceName)
except:
print (serviceName, 'requires access code, or not intended for this purpose')
continue
try:
result = geolocator.reverse('43.2,65.4')
print (serviceName, str(result).encode('ascii', 'ignore'))
except:
print (serviceName, 'reverse unsupported?')
continue
Мое предположение состоит в том, что только члены, начинающиеся с капиталов, представляют собой службы. Вот результат.
['ArcGIS', 'Baidu', 'Bing', 'DataBC', 'GeoNames', 'GeocodeFarm', 'GeocoderDotUS', 'GeocoderNotFound', 'GoogleV3', 'IGNFrance', 'LiveAddress', 'NaviData', 'Nominatim', 'OpenCage', 'OpenMapQuest', 'Photon', 'SERVICE_TO_GEOCODER', 'What3Words', 'YahooPlaceFinder', 'Yandex']
ArcGIS reverse unsupported?
Baidu requires access code, or not intended for this purpose
Bing requires access code, or not intended for this purpose
DataBC reverse unsupported?
GeoNames requires access code, or not intended for this purpose
GeocodeFarm reverse unsupported?
GeocoderDotUS reverse unsupported?
GeocoderNotFound reverse unsupported?
GoogleV3 b'[Location(Tamdy District, Uzbekistan, (42.54183, 65.2488422, 0.0)), Location(Navoiy Province, Uzbekistan, (42.6988575, 64.6337685, 0.0)), Location(Uzbekistan, (41.377491, 64.585262, 0.0))]'
IGNFrance requires access code, or not intended for this purpose
LiveAddress requires access code, or not intended for this purpose
NaviData reverse unsupported?
Nominatim b'Tomdi Tumani, Navoiy Viloyati, Ozbekiston'
OpenCage requires access code, or not intended for this purpose
OpenMapQuest reverse unsupported?
Photon reverse unsupported?
SERVICE_TO_GEOCODER requires access code, or not intended for this purpose
What3Words requires access code, or not intended for this purpose
YahooPlaceFinder requires access code, or not intended for this purpose
Yandex b'[Location(, , (42.052267, 65.243642, 0.0)), Location(, (42.004874, 64.330882, 0.0)), Location(None, (41.765066, 63.150118, 0.0))]'
GoogleV3 и Nominatim делают то, что вам кажется без дальнейшего продолжения. В тех случаях, когда результаты говорят, что «требуется код доступа или не предназначен для этой цели», обычно это означает, что вам нужен ключ или логин.
http://stackoverflow.com/questions/16497384/google-maps-api-geocoding-handling-multiple-requests –