Skip to content

Commit

Permalink
chore: replace literal feature_id with constant
Browse files Browse the repository at this point in the history
  • Loading branch information
simonusher committed Feb 22, 2023
1 parent 46a677c commit daae82b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions srai/loaders/osm_tag_loader/osm_tag_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

0 comments on commit daae82b

Please sign in to comment.