Skip to content

Commit

Permalink
fix obtaining crs
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Jul 5, 2024
1 parent 67ad4f7 commit 2b2a7f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion synthesis/population/spatial/secondary/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def prepare_locations(context):
# Load persons and their primary locations
df_home = context.stage("synthesis.population.spatial.home.locations")
df_work, df_education = context.stage("synthesis.population.spatial.primary.locations")
crs = df_home.crs

df_home = df_home.rename(columns = { "geometry": "home" })
df_work = df_work.rename(columns = { "geometry": "work" })
Expand All @@ -35,7 +36,7 @@ def prepare_locations(context):
df_locations = pd.merge(df_locations, df_work[["person_id", "work"]], how = "left", on = "person_id")
df_locations = pd.merge(df_locations, df_education[["person_id", "education"]], how = "left", on = "person_id")

return df_locations[["person_id", "home", "work", "education"]].sort_values(by = "person_id"), df_home.crs
return df_locations[["person_id", "home", "work", "education"]].sort_values(by = "person_id"), crs

def prepare_destinations(context):
df_locations = context.stage("synthesis.locations.secondary")
Expand Down

0 comments on commit 2b2a7f7

Please sign in to comment.