Skip to content

Commit 0bf308a

Browse files
committed
update geography_utils refs to CA_NAD83Albers_m or _ft
1 parent 6d00bb0 commit 0bf308a

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

bus_service_increase/create_analysis_data.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def get_shapes(selected_date: str) -> gpd.GeoDataFrame:
134134
selected_date,
135135
columns = ["shape_array_key", "geometry"],
136136
get_pandas = True,
137-
crs = geography_utils.CA_NAD83Albers
137+
crs = geography_utils.CA_NAD83Albers_m
138138
).pipe(
139139
helpers.remove_shapes_outside_ca
140140
).merge(
@@ -151,7 +151,7 @@ def get_shapes(selected_date: str) -> gpd.GeoDataFrame:
151151

152152

153153
def dissolve_census_tracts(
154-
crs: str = geography_utils.CA_NAD83Albers
154+
crs: str = geography_utils.CA_NAD83Albers_m
155155
) -> gpd.GeoDataFrame:
156156
census_tracts = (
157157
catalog.calenviroscreen_lehd_by_tract.read()

bus_service_increase/highways-existing-transit.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"plot_df = gdf[\n",
7979
" gdf.route_length >= geography_utils.FEET_PER_MI * 0.5\n",
8080
" ].assign(\n",
81-
" geometry = (gdf.geometry.to_crs(geography_utils.CA_StatePlane)\n",
81+
" geometry = (gdf.geometry.to_crs(geography_utils.CA_NAD83Albers_ft)\n",
8282
" .buffer(300)\n",
8383
" .to_crs(geography_utils.WGS84)\n",
8484
" )\n",

la_metro_demo/A2_clean_up_gtfs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# LA Metro data is for Oct 2022, so let's use the date we already downloaded
1111
analysis_date = rt_dates.DATES["oct2022"]
12-
PROJECT_CRS = geography_utils.CA_NAD83Albers
12+
PROJECT_CRS = geography_utils.CA_NAD83Albers_m
1313

1414

1515
def fill_missing_route_short_name(df: pd.DataFrame) -> pd.DataFrame:

la_metro_demo/A3_assemble_data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import A2_clean_up_gtfs as clean_up_gtfs
1212

13-
PROJECT_CRS = geography_utils.CA_NAD83Albers
13+
PROJECT_CRS = geography_utils.CA_NAD83Albers_m
1414
BUS_SERVICE_GCS = "gs://calitp-analytics-data/data-analyses/bus_service_increase/"
1515

1616

py_crow_flies/py_crow_flies.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
"outputs": [],
149149
"source": [
150150
"# Transform the grid points to your preferred CRS\n",
151-
"central = central.to_crs(shared_utils.geography_utils.CA_NAD83Albers).set_index('pointid')\n",
151+
"central = central.to_crs(shared_utils.geography_utils.CA_NAD83Albers_m).set_index('pointid')\n",
152152
"central = central >> select(-_.Point_ID)"
153153
]
154154
},

rt_segment_speeds/11_tiger.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
" f\"{SHARED_GCS}all_roads_2020_state06.parquet\",\n",
104104
" filters=[(\"MTFCC\", \"in\", road_type_wanted)],\n",
105105
" columns=[\"LINEARID\", \"geometry\", \"FULLNAME\"],\n",
106-
" ).to_crs(geography_utils.CA_NAD83Albers)\n",
106+
" ).to_crs(geography_utils.CA_NAD83Albers_m)\n",
107107
"\n",
108108
" # If a road has mutliple rows but the same\n",
109109
" # linear ID, dissolve it so it becomes one row.\n",
@@ -238,7 +238,7 @@
238238
" .drop_duplicates()\n",
239239
" )\n",
240240
"\n",
241-
" stops = stops.set_crs(geography_utils.CA_NAD83Albers)\n",
241+
" stops = stops.set_crs(geography_utils.CA_NAD83Albers_m)\n",
242242
"\n",
243243
" # Buffer each stop by 50 feet\n",
244244
" stops = stops.assign(buffered_geometry=stops.geometry.buffer(50))\n",
@@ -287,7 +287,7 @@
287287
" \"\"\"\n",
288288
" gtfs_shapes = helpers.import_scheduled_shapes(date).compute().drop_duplicates()\n",
289289
"\n",
290-
" gtfs_shapes = gtfs_shapes.set_crs(geography_utils.CA_NAD83Albers)\n",
290+
" gtfs_shapes = gtfs_shapes.set_crs(geography_utils.CA_NAD83Albers_m)\n",
291291
"\n",
292292
" trips = (\n",
293293
" helpers.import_scheduled_trips(date, (), [\"name\", \"shape_array_key\"])\n",

thruway_bus_validators/A2_plot_amtrak_thruway.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
"outputs": [],
132132
"source": [
133133
"gdf = gdf.assign(\n",
134-
" route_mi = ((gdf.geometry.to_crs(geography_utils.CA_StatePlane)\n",
134+
" route_mi = ((gdf.geometry.to_crs(geography_utils.CA_NAD83Albers_ft)\n",
135135
" .length).divide(geography_utils.FEET_PER_MI)).round(2)\n",
136136
")"
137137
]
@@ -470,7 +470,7 @@
470470
"name": "python",
471471
"nbconvert_exporter": "python",
472472
"pygments_lexer": "ipython3",
473-
"version": "3.10.5"
473+
"version": "3.9.13"
474474
}
475475
},
476476
"nbformat": 4,

thruway_bus_validators/A4_local_routes_same_od.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def keep_long_shape_ids(routelines: dg.GeoDataFrame | gpd.GeoDataFrame,
2020
Filter down routelines file to just routes that are pretty long
2121
with shape_id.
2222
"""
23-
routelines = routelines.to_crs(geography_utils.CA_StatePlane)
23+
routelines = routelines.to_crs(geography_utils.CA_NAD83Albers_ft)
2424

2525
routelines = routelines.assign(
2626
route_mi = routelines.geometry.length.divide(
@@ -115,7 +115,7 @@ def buffer_around_origin_destination(gdf: gpd.GeoDataFrame,
115115
geom_cols = list(gdf.select_dtypes("geometry").columns)
116116

117117
for c in geom_cols:
118-
gdf[c] = gdf[c].to_crs(geography_utils.CA_StatePlane)
118+
gdf[c] = gdf[c].to_crs(geography_utils.CA_NAD83Albers_ft)
119119

120120
gdf = gdf.assign(
121121
origin_buffer = gdf.origin.buffer(buffer_feet),

0 commit comments

Comments
 (0)