Skip to content

Commit 366f99a

Browse files
authored
re-established geojson intended functionality
1 parent 5b5a601 commit 366f99a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

label_maker/label.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66
from subprocess import run, Popen, PIPE
77
import json
88
from functools import partial
9-
import datetime
109

1110
import numpy as np
1211
import mapbox_vector_tile
1312
import pyproj
14-
import pandas as pd
1513
from shapely.geometry import shape, mapping, Polygon
1614
from shapely.errors import TopologicalError
1715
from rasterio.features import rasterize
1816
from geojson import Feature, FeatureCollection as fc
19-
from pandas.io.json import json_normalize
2017
from mercantile import tiles, feature, Tile
2118
from PIL import Image, ImageDraw
2219
from tilepie import tilereduce
@@ -74,7 +71,7 @@ def make_labels(dest_folder, zoom, country, classes, ml_type, bounding_box, spar
7471
mbtiles_file_zoomed = op.join(dest_folder, '{}-z{!s}.mbtiles'.format(ctr, zoom))
7572

7673
if not op.exists(mbtiles_file_zoomed):
77-
filtered_geo = op.join(dest_folder, '{}.geojson'.format(ctr))
74+
filtered_geo = kwargs.get('geojson') or op.join(dest_folder, '{}.geojson'.format(ctr))
7875
fast_parse = []
7976
if not op.exists(filtered_geo):
8077
fast_parse = ['-P']
@@ -344,7 +341,7 @@ def _tile_results_summary(ml_type, classes):
344341

345342
print('Total tiles: {}'.format(len(all_tiles)))
346343

347-
def _create_empty_label(ml_type, classes, format):
344+
def _create_empty_label(ml_type, classes):
348345
if ml_type == 'classification':
349346
return np.zeros(len(classes) + 1, dtype=np.int)
350347
elif ml_type == 'object-detection':

0 commit comments

Comments
 (0)