Skip to content

Commit 417a5fa

Browse files
committed
fix: just use on dataframe to save memory
1 parent d3b3f3d commit 417a5fa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

mapswipe_workers/mapswipe_workers/utils/process_mapillary.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,27 +245,27 @@ def get_image_metadata(
245245
downloaded_metadata["geometry"].apply(lambda geom: isinstance(geom, Point))
246246
]
247247

248-
filtered_metadata = filter_results(
248+
downloaded_metadata = filter_results(
249249
downloaded_metadata, creator_id, is_pano, organization_id, start_time, end_time
250250
)
251251

252252
if (
253-
filtered_metadata is None
254-
or filtered_metadata.empty
255-
or filtered_metadata.isna().all().all()
253+
downloaded_metadata is None
254+
or downloaded_metadata.empty
255+
or downloaded_metadata.isna().all().all()
256256
):
257257
raise ValueError("No Mapillary Features in the AoI match the filter criteria.")
258258

259259
if sampling_threshold is not None:
260-
filtered_metadata = spatial_sampling(filtered_metadata, sampling_threshold)
260+
downloaded_metadata = spatial_sampling(downloaded_metadata, sampling_threshold)
261261

262-
total_images = len(filtered_metadata)
262+
total_images = len(downloaded_metadata)
263263
if total_images > 100000:
264264
raise ValueError(
265265
f"Too many Images with selected filter options for the AoI: {total_images}"
266266
)
267267

268268
return {
269-
"ids": filtered_metadata["id"].tolist(),
270-
"geometries": filtered_metadata["geometry"].tolist(),
269+
"ids": downloaded_metadata["id"].tolist(),
270+
"geometries": downloaded_metadata["geometry"].tolist(),
271271
}

0 commit comments

Comments
 (0)