From 406666362cf2409c3828d6039ca4d74e25c8c88a Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 6 Aug 2016 18:36:01 -0400 Subject: [PATCH] [fix] command-line index creation --- scripts/geodata/metro_stations/reverse_geocode.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/geodata/metro_stations/reverse_geocode.py b/scripts/geodata/metro_stations/reverse_geocode.py index 4870f889..222755f9 100644 --- a/scripts/geodata/metro_stations/reverse_geocode.py +++ b/scripts/geodata/metro_stations/reverse_geocode.py @@ -41,7 +41,7 @@ class MetroStationReverseGeocoder(PointIndex): return None @classmethod - def create_from_osm_file(cls, filename, output_dir): + def create_from_osm_file(cls, filename, output_dir, precision=PointIndex.GEOHASH_PRECISION): ''' Given an OSM file (planet or some other bounds) containing relations and their dependencies, create an R-tree index for coarse-grained @@ -51,7 +51,7 @@ class MetroStationReverseGeocoder(PointIndex): osmfilter. Use fetch_osm_address_data.sh for planet or copy the admin borders commands if using other bounds. ''' - index = cls(save_dir=output_dir) + index = cls(save_dir=output_dir, precision=precision) i = 0 for element_id, props, deps in parse_osm(filename): @@ -104,7 +104,7 @@ if __name__ == '__main__': args = parser.parse_args() if args.osm_metro_stations_file: - index = MetroStationReverseGeocoder(save_dir=args.out_dir, precision=args.precision) + index = MetroStationReverseGeocoder.create_from_osm_file(args.osm_metro_stations_file, save_dir=args.out_dir, precision=args.precision) else: parser.error('Must specify metro stations file')