remove geocode

old-commit-hash: f856c99279
commatwo_master
Willem Melching 5 years ago
parent 376c18b3b2
commit 70d8000b08
  1. 1
      common/geocode/__init__.py
  2. 24
      common/geocode/reverse.py
  3. 3
      common/geocode/rg_cities1000.csv

@ -1,24 +0,0 @@
import numpy as np
import os
import csv
path = os.path.dirname(os.path.abspath(__file__))
# locally cache cities from
# https://github.com/thampiman/reverse-geocoder
csv_file_name = path + '/rg_cities1000.csv'
# right hand drive is when the steering wheel is on the right of the car
# left hand traffic is when cars driver on the left side of the road
LHT_COUNTRIES = ['AU', 'IN', 'IE', 'JP', 'MU', 'MY', 'NZ', 'UK', 'ZA']
def get_city(lat, lon):
cities = np.array(list(csv.reader(open(csv_file_name))))[1:]
positions = cities[:,:2].astype(np.float32)
idx = np.argmin(np.linalg.norm((positions - np.array([lat, lon])), axis=1))
return cities[idx]
def is_lht(lat, lon):
city = get_city(lat, lon)
country = city[-1]
return country in LHT_COUNTRIES

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1de56dc32b0308c6094d5d833441c8ca25827f24e9a6a4cc144223ab5f9b65bf
size 7851524
unable to load file from head commit
Loading…
Cancel
Save