Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove hardcoded osm data paths #70

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 151 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ gdal = "<=3.8.4"
pandera = "^0.20.4"
osmox = {git = "https://github.com/arup-group/osmox"}
pyrosm = "^0.6.2"
jsonschema = "^4.23.0"

[tool.poetry.dev-dependencies]
pytest = ">= 6"
Expand Down
6 changes: 5 additions & 1 deletion scripts/3.1_assign_primary_feasible_zones.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def main(config_file):

# osm data
osm_data = gpd.read_parquet(
acbm.root_path / "data/external/boundaries/west-yorkshire_epsg_4326.parquet"
acbm.root_path / f"data/interim/osmox/{config.region}_epsg_4326.parquet"
)

logger.info("Activity locations loaded")
Expand All @@ -163,6 +163,10 @@ def main(config_file):
# randomly assign a zone to each trip.

logger.info("Getting the number of activities in each zone")

# ensure that osm_data_gdf and boundaries are in the same crs
osm_data = osm_data.to_crs(boundaries.crs)

# spatial join to identify which zone each point in osm_data is in
osm_data_gdf = gpd.sjoin(
osm_data,
Expand Down
4 changes: 2 additions & 2 deletions scripts/3.3_assign_facility_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ def main(config_file):
logger.info("Loading facility data")

osm_data_gdf = gpd.read_parquet(
acbm.root_path / "data/external/boundaries/west-yorkshire_epsg_4326.parquet"
acbm.root_path / f"data/interim/boundaries/{config.region}_epsg_4326.parquet"
)

# --- Load data: Boundaries
logger.info("Loading study area boundaries")

boundaries = gpd.read_file(
acbm.root_path / "data/external/boundaries/study_area_zones.geojson"
acbm.root_path / "data/external/osmox/study_area_zones.geojson"
)

logger.info("Study area boundaries loaded")
Expand Down
Loading