Skip to content

Commit 5f35823

Browse files
committed
tested and cleared all notebooks
1 parent 4129ea2 commit 5f35823

13 files changed

Lines changed: 745 additions & 424 deletions

examples/Pathfinding_Austin_Road_Network.ipynb

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
{
2525
"cell_type": "code",
2626
"execution_count": null,
27-
"metadata": {},
27+
"metadata": {
28+
"execution": {
29+
"iopub.execute_input": "2026-01-23T19:13:31.469085Z",
30+
"iopub.status.busy": "2026-01-23T19:13:31.468977Z",
31+
"iopub.status.idle": "2026-01-23T19:13:32.421379Z",
32+
"shell.execute_reply": "2026-01-23T19:13:32.420650Z"
33+
}
34+
},
2835
"outputs": [],
2936
"source": [
3037
"import datashader as ds\n",
@@ -62,12 +69,17 @@
6269
{
6370
"cell_type": "code",
6471
"execution_count": null,
65-
"metadata": {},
72+
"metadata": {
73+
"execution": {
74+
"iopub.execute_input": "2026-01-23T19:13:32.423409Z",
75+
"iopub.status.busy": "2026-01-23T19:13:32.422938Z",
76+
"iopub.status.idle": "2026-01-23T19:13:34.034515Z",
77+
"shell.execute_reply": "2026-01-23T19:13:34.033712Z"
78+
}
79+
},
6680
"outputs": [],
6781
"source": [
68-
"streets = geopandas.read_file(\n",
69-
" \"data/geo_export_9c395dda-0b29-41ec-89b4-a51a898f7104.shp\"\n",
70-
")\n",
82+
"streets = geopandas.read_file(\"../xrspatial-examples/data/geo_export_9c395dda-0b29-41ec-89b4-a51a898f7104.shp\")\n",
7183
"streets = streets.to_crs(\"EPSG:4326\")\n",
7284
"streets = streets.explode(\"geometry\").reset_index(drop=True)\n",
7385
"streets_spd = spatialpandas.GeoDataFrame(streets, geometry=\"geometry\")"
@@ -92,7 +104,14 @@
92104
{
93105
"cell_type": "code",
94106
"execution_count": null,
95-
"metadata": {},
107+
"metadata": {
108+
"execution": {
109+
"iopub.execute_input": "2026-01-23T19:13:34.036027Z",
110+
"iopub.status.busy": "2026-01-23T19:13:34.035787Z",
111+
"iopub.status.idle": "2026-01-23T19:13:34.054300Z",
112+
"shell.execute_reply": "2026-01-23T19:13:34.053635Z"
113+
}
114+
},
96115
"outputs": [],
97116
"source": [
98117
"xmin, ymin, xmax, ymax = (\n",
@@ -109,7 +128,14 @@
109128
{
110129
"cell_type": "code",
111130
"execution_count": null,
112-
"metadata": {},
131+
"metadata": {
132+
"execution": {
133+
"iopub.execute_input": "2026-01-23T19:13:34.072052Z",
134+
"iopub.status.busy": "2026-01-23T19:13:34.071884Z",
135+
"iopub.status.idle": "2026-01-23T19:13:36.136717Z",
136+
"shell.execute_reply": "2026-01-23T19:13:36.136054Z"
137+
}
138+
},
113139
"outputs": [],
114140
"source": [
115141
"H, W = 600, 800\n",
@@ -153,7 +179,14 @@
153179
{
154180
"cell_type": "code",
155181
"execution_count": null,
156-
"metadata": {},
182+
"metadata": {
183+
"execution": {
184+
"iopub.execute_input": "2026-01-23T19:13:36.137998Z",
185+
"iopub.status.busy": "2026-01-23T19:13:36.137876Z",
186+
"iopub.status.idle": "2026-01-23T19:13:37.131601Z",
187+
"shell.execute_reply": "2026-01-23T19:13:37.131064Z"
188+
}
189+
},
157190
"outputs": [],
158191
"source": [
159192
"# find the path from start to goal,\n",
@@ -166,11 +199,32 @@
166199
"path_shaded = dynspread(shade(path_agg, cmap=[\"green\"]), threshold=1, max_px=1)\n",
167200
"set_background(stack(street_shaded, path_shaded, start_shaded, goal_shaded), \"black\")"
168201
]
202+
},
203+
{
204+
"cell_type": "code",
205+
"execution_count": null,
206+
"metadata": {},
207+
"outputs": [],
208+
"source": []
169209
}
170210
],
171211
"metadata": {
212+
"kernelspec": {
213+
"display_name": "Python 3 (ipykernel)",
214+
"language": "python",
215+
"name": "python3"
216+
},
172217
"language_info": {
173-
"name": "python"
218+
"codemirror_mode": {
219+
"name": "ipython",
220+
"version": 3
221+
},
222+
"file_extension": ".py",
223+
"mimetype": "text/x-python",
224+
"name": "python",
225+
"nbconvert_exporter": "python",
226+
"pygments_lexer": "ipython3",
227+
"version": "3.14.2"
174228
}
175229
},
176230
"nbformat": 4,

examples/pharmacy-deserts.ipynb

Lines changed: 127 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
{
2222
"cell_type": "code",
2323
"execution_count": null,
24-
"metadata": {},
24+
"metadata": {
25+
"execution": {
26+
"iopub.execute_input": "2026-01-23T19:12:53.231018Z",
27+
"iopub.status.busy": "2026-01-23T19:12:53.230906Z",
28+
"iopub.status.idle": "2026-01-23T19:12:54.153805Z",
29+
"shell.execute_reply": "2026-01-23T19:12:54.153202Z"
30+
}
31+
},
2532
"outputs": [],
2633
"source": [
2734
"import datashader as ds\n",
@@ -60,11 +67,18 @@
6067
{
6168
"cell_type": "code",
6269
"execution_count": null,
63-
"metadata": {},
70+
"metadata": {
71+
"execution": {
72+
"iopub.execute_input": "2026-01-23T19:12:54.155318Z",
73+
"iopub.status.busy": "2026-01-23T19:12:54.155027Z",
74+
"iopub.status.idle": "2026-01-23T19:12:54.308338Z",
75+
"shell.execute_reply": "2026-01-23T19:12:54.307765Z"
76+
}
77+
},
6478
"outputs": [],
6579
"source": [
6680
"# Load Pharmacies and add out x, y fields based on CalcLocation\n",
67-
"pharmacy_df = pd.read_csv(\"./xrspatial-examples/data/facilities.csv\")\n",
81+
"pharmacy_df = pd.read_csv(\"../xrspatial-examples/data/facilities.csv\")\n",
6882
"coords = pharmacy_df[\"CalcLocation\"].str.split(\",\", expand=True)\n",
6983
"pharmacy_df[\"y\"] = np.array(coords[0], dtype=\"float64\")\n",
7084
"pharmacy_df[\"x\"] = np.array(coords[1], dtype=\"float64\")\n",
@@ -82,7 +96,14 @@
8296
{
8397
"cell_type": "code",
8498
"execution_count": null,
85-
"metadata": {},
99+
"metadata": {
100+
"execution": {
101+
"iopub.execute_input": "2026-01-23T19:12:54.325729Z",
102+
"iopub.status.busy": "2026-01-23T19:12:54.325568Z",
103+
"iopub.status.idle": "2026-01-23T19:13:07.768006Z",
104+
"shell.execute_reply": "2026-01-23T19:13:07.767388Z"
105+
}
106+
},
86107
"outputs": [],
87108
"source": [
88109
"# Load Census Block Groups and Calculate Percent over 65 years-old\n",
@@ -105,7 +126,14 @@
105126
{
106127
"cell_type": "code",
107128
"execution_count": null,
108-
"metadata": {},
129+
"metadata": {
130+
"execution": {
131+
"iopub.execute_input": "2026-01-23T19:13:07.769550Z",
132+
"iopub.status.busy": "2026-01-23T19:13:07.769287Z",
133+
"iopub.status.idle": "2026-01-23T19:13:08.942658Z",
134+
"shell.execute_reply": "2026-01-23T19:13:08.941968Z"
135+
}
136+
},
109137
"outputs": [],
110138
"source": [
111139
"# Load Census County and Calculate Percent over 65 years-old\n",
@@ -140,7 +168,14 @@
140168
{
141169
"cell_type": "code",
142170
"execution_count": null,
143-
"metadata": {},
171+
"metadata": {
172+
"execution": {
173+
"iopub.execute_input": "2026-01-23T19:13:08.944030Z",
174+
"iopub.status.busy": "2026-01-23T19:13:08.943925Z",
175+
"iopub.status.idle": "2026-01-23T19:13:12.446986Z",
176+
"shell.execute_reply": "2026-01-23T19:13:12.446334Z"
177+
}
178+
},
144179
"outputs": [],
145180
"source": [
146181
"x_range = (-124.848974, -66.885444)\n",
@@ -176,7 +211,14 @@
176211
{
177212
"cell_type": "code",
178213
"execution_count": null,
179-
"metadata": {},
214+
"metadata": {
215+
"execution": {
216+
"iopub.execute_input": "2026-01-23T19:13:12.448188Z",
217+
"iopub.status.busy": "2026-01-23T19:13:12.448083Z",
218+
"iopub.status.idle": "2026-01-23T19:13:15.042708Z",
219+
"shell.execute_reply": "2026-01-23T19:13:15.042222Z"
220+
}
221+
},
180222
"outputs": [],
181223
"source": [
182224
"pharmacy_raster = cvs.points(pharmacy_df, \"x\", \"y\")\n",
@@ -205,7 +247,14 @@
205247
{
206248
"cell_type": "code",
207249
"execution_count": null,
208-
"metadata": {},
250+
"metadata": {
251+
"execution": {
252+
"iopub.execute_input": "2026-01-23T19:13:15.044150Z",
253+
"iopub.status.busy": "2026-01-23T19:13:15.044043Z",
254+
"iopub.status.idle": "2026-01-23T19:13:23.087968Z",
255+
"shell.execute_reply": "2026-01-23T19:13:23.087515Z"
256+
}
257+
},
209258
"outputs": [],
210259
"source": [
211260
"age_raster = cvs.polygons(\n",
@@ -232,7 +281,14 @@
232281
{
233282
"cell_type": "code",
234283
"execution_count": null,
235-
"metadata": {},
284+
"metadata": {
285+
"execution": {
286+
"iopub.execute_input": "2026-01-23T19:13:23.090108Z",
287+
"iopub.status.busy": "2026-01-23T19:13:23.090002Z",
288+
"iopub.status.idle": "2026-01-23T19:13:23.469051Z",
289+
"shell.execute_reply": "2026-01-23T19:13:23.468423Z"
290+
}
291+
},
236292
"outputs": [],
237293
"source": [
238294
"pharmacy_deserts = binary(proximity_classifed, [3])\n",
@@ -267,7 +323,14 @@
267323
{
268324
"cell_type": "code",
269325
"execution_count": null,
270-
"metadata": {},
326+
"metadata": {
327+
"execution": {
328+
"iopub.execute_input": "2026-01-23T19:13:23.470503Z",
329+
"iopub.status.busy": "2026-01-23T19:13:23.470395Z",
330+
"iopub.status.idle": "2026-01-23T19:13:25.284662Z",
331+
"shell.execute_reply": "2026-01-23T19:13:25.284119Z"
332+
}
333+
},
271334
"outputs": [],
272335
"source": [
273336
"from datashader.colors import Set1\n",
@@ -294,7 +357,14 @@
294357
{
295358
"cell_type": "code",
296359
"execution_count": null,
297-
"metadata": {},
360+
"metadata": {
361+
"execution": {
362+
"iopub.execute_input": "2026-01-23T19:13:25.286041Z",
363+
"iopub.status.busy": "2026-01-23T19:13:25.285949Z",
364+
"iopub.status.idle": "2026-01-23T19:13:25.470420Z",
365+
"shell.execute_reply": "2026-01-23T19:13:25.469864Z"
366+
}
367+
},
298368
"outputs": [],
299369
"source": [
300370
"from xrspatial import zonal_stats\n",
@@ -322,7 +392,14 @@
322392
{
323393
"cell_type": "code",
324394
"execution_count": null,
325-
"metadata": {},
395+
"metadata": {
396+
"execution": {
397+
"iopub.execute_input": "2026-01-23T19:13:25.471583Z",
398+
"iopub.status.busy": "2026-01-23T19:13:25.471478Z",
399+
"iopub.status.idle": "2026-01-23T19:13:25.593109Z",
400+
"shell.execute_reply": "2026-01-23T19:13:25.592471Z"
401+
}
402+
},
326403
"outputs": [],
327404
"source": [
328405
"cols = [\"pharmacy_desert_mean\", \"NAME\", \"STATE_FIPS\", \"geometry\"]\n",
@@ -340,7 +417,14 @@
340417
{
341418
"cell_type": "code",
342419
"execution_count": null,
343-
"metadata": {},
420+
"metadata": {
421+
"execution": {
422+
"iopub.execute_input": "2026-01-23T19:13:25.594252Z",
423+
"iopub.status.busy": "2026-01-23T19:13:25.594151Z",
424+
"iopub.status.idle": "2026-01-23T19:13:28.338669Z",
425+
"shell.execute_reply": "2026-01-23T19:13:28.337777Z"
426+
}
427+
},
344428
"outputs": [],
345429
"source": [
346430
"from xrspatial import hillshade\n",
@@ -359,7 +443,14 @@
359443
{
360444
"cell_type": "code",
361445
"execution_count": null,
362-
"metadata": {},
446+
"metadata": {
447+
"execution": {
448+
"iopub.execute_input": "2026-01-23T19:13:28.340196Z",
449+
"iopub.status.busy": "2026-01-23T19:13:28.340077Z",
450+
"iopub.status.idle": "2026-01-23T19:13:28.571855Z",
451+
"shell.execute_reply": "2026-01-23T19:13:28.571307Z"
452+
}
453+
},
363454
"outputs": [],
364455
"source": [
365456
"img = stack(\n",
@@ -370,11 +461,32 @@
370461
")\n",
371462
"set_background(img, \"black\")"
372463
]
464+
},
465+
{
466+
"cell_type": "code",
467+
"execution_count": null,
468+
"metadata": {},
469+
"outputs": [],
470+
"source": []
373471
}
374472
],
375473
"metadata": {
474+
"kernelspec": {
475+
"display_name": "Python 3 (ipykernel)",
476+
"language": "python",
477+
"name": "python3"
478+
},
376479
"language_info": {
377-
"name": "python"
480+
"codemirror_mode": {
481+
"name": "ipython",
482+
"version": 3
483+
},
484+
"file_extension": ".py",
485+
"mimetype": "text/x-python",
486+
"name": "python",
487+
"nbconvert_exporter": "python",
488+
"pygments_lexer": "ipython3",
489+
"version": "3.14.2"
378490
}
379491
},
380492
"nbformat": 4,

0 commit comments

Comments
 (0)