From daae82bb7830b113d14772c207f4edf22b6d06d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Wo=C5=BAniak?= Date: Wed, 22 Feb 2023 23:36:03 +0100 Subject: [PATCH] chore: replace literal feature_id with constant --- srai/loaders/osm_tag_loader/osm_tag_loader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srai/loaders/osm_tag_loader/osm_tag_loader.py b/srai/loaders/osm_tag_loader/osm_tag_loader.py index 7a2a0fd75..6e462680e 100644 --- a/srai/loaders/osm_tag_loader/osm_tag_loader.py +++ b/srai/loaders/osm_tag_loader/osm_tag_loader.py @@ -12,7 +12,7 @@ from functional import seq from tqdm import tqdm -from srai.utils.constants import WGS84_CRS +from srai.utils.constants import FEATURES_INDEX, WGS84_CRS class OSMTagLoader: @@ -121,9 +121,9 @@ def _get_empty_result(self) -> gpd.GeoDataFrame: def _flatten_index(self, gdf: gpd.GeoDataFrame) -> gpd.GeoDataFrame: gdf = gdf.reset_index() - gdf["feature_id"] = ( + gdf[FEATURES_INDEX] = ( gdf[self._RESULT_INDEX_NAMES] .apply(lambda idx: "/".join(map(str, idx)), axis=1) .astype(str) ) - return gdf.set_index("feature_id").drop(columns=self._RESULT_INDEX_NAMES) + return gdf.set_index(FEATURES_INDEX).drop(columns=self._RESULT_INDEX_NAMES)