Skip to content

Commit

Permalink
small fixes to main function
Browse files Browse the repository at this point in the history
  • Loading branch information
mnm-matin committed Feb 25, 2024
1 parent 6016a4c commit 7772a9d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions earth_osm/eo.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def process_region(region, primary_name, feature_name, mp, update, data_dir):
logger.debug(f"df_feature is empty for {region.short}, {primary_name}, {feature_name}")
else:
df_feature.insert(3, 'Region', region.short)

# dev logger warning
if 'other_tags' in df_feature.columns:
logger.warning(f"other_tags in extracted data from osm, change of other_tags to eo_tags is necessary, please open issue on github")

return df_feature

Expand All @@ -90,13 +94,13 @@ def get_osm_data(
primary_name,
feature_name,
data_dir=None,
cached = True,
):
cached = True):
region_tuple = get_region_tuple(region_str)
mp = True
update = not cached

data_dir=os.path.join(os.getcwd(), 'earth_data')
data_dir=os.path.join(os.getcwd(), 'earth_data') if data_dir is None else data_dir

df = process_region(
region_tuple,
Expand All @@ -107,7 +111,6 @@ def get_osm_data(
data_dir,
)

# TODO: improve get_osm_data funciton with post processing
return df


Expand Down

0 comments on commit 7772a9d

Please sign in to comment.