Skip to content

Commit

Permalink
Merge branch 'feat/geospatial-python-urban-analysis-with-postgis' of …
Browse files Browse the repository at this point in the history
…github.com:nanlabs/backend-reference into feat/geospatial-python-urban-analysis-with-postgis
  • Loading branch information
BrenQ committed Feb 19, 2025
2 parents 140138a + 43e13ac commit 4aee441
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<div id="page">
<div id="header">
<div id="headerimg">
<h1><a href="https://www.naturalearthdata.com/"><img src="https://www.naturalearthdata.com/wp-content/themes/NEV/images/nev_logo.png" alt="Natural Earth title="Natural Earth" /></a></h1>
<h1><a href="https://www.naturalearthdata.com/"><img src="https://www.naturalearthdata.com/wp-content/themes/NEV/images/nev_logo.png" alt="Natural Earth" title="Natural Earth" /></a></h1>
<div class="description">Free vector and raster map data at 1:10m, 1:50m, and 1:110m scales</div>
<div class="header_search"><form method="get" id="searchform" action="https://www.naturalearthdata.com/">
<label class="hidden" for="s">Search for:</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

def spatial_join(bus_stops: gpd.GeoDataFrame, comunas: gpd.GeoDataFrame):
"""Join bus stops with districts based on spatial location."""
if bus_stops.crs != comunas.crs:
raise ValueError(f"CRS mismatch: bus_stops CRS is {bus_stops.crs}, comunas CRS is {comunas.crs}")
return gpd.sjoin(bus_stops, comunas, how="inner", predicate="within")

def count_stops_per_district(bus_stops_in_district: gpd.GeoDataFrame):
Expand Down

0 comments on commit 4aee441

Please sign in to comment.