|
16 | 16 | from PIL import Image, ImageDraw |
17 | 17 | from tilepie import tilereduce |
18 | 18 |
|
| 19 | +import label_maker |
19 | 20 | from label_maker.filter import create_filter |
20 | 21 |
|
21 | 22 | # declare a global accumulator so the workers will have access |
@@ -61,9 +62,13 @@ def make_labels(dest_folder, zoom, country, classes, ml_type, bounding_box, **kw |
61 | 62 | print('Retiling QA Tiles to zoom level {} (takes a bit)'.format(zoom)) |
62 | 63 | filtered_geo = op.join(dest_folder, '{}.geojson'.format(country)) |
63 | 64 | ps = Popen(['tippecanoe-decode', '-c', '-f', mbtiles_file], stdout=PIPE) |
64 | | - run(['python', 'label_maker/stream_filter.py', json.dumps(bounding_box)], stdin=ps.stdout, stdout=open(filtered_geo, 'w')) |
| 65 | + stream_filter_fpath = op.join(op.dirname(label_maker.__file__), 'stream_filter.py') |
| 66 | + run(['python', stream_filter_fpath, json.dumps(bounding_box)], |
| 67 | + stdin=ps.stdout, stdout=open(filtered_geo, 'w')) |
65 | 68 | ps.wait() |
66 | | - run(['tippecanoe', '--no-feature-limit', '--no-tile-size-limit', '-P', '-l', 'osm', '-f', '-z', str(zoom), '-Z', str(zoom), '-o', mbtiles_file_zoomed, filtered_geo]) |
| 69 | + run(['tippecanoe', '--no-feature-limit', '--no-tile-size-limit', '-P', |
| 70 | + '-l', 'osm', '-f', '-z', str(zoom), '-Z', str(zoom), '-o', |
| 71 | + mbtiles_file_zoomed, filtered_geo]) |
67 | 72 |
|
68 | 73 | # Call tilereduce |
69 | 74 | print('Determining labels for each tile') |
|
0 commit comments