Skip to content

Commit 0748015

Browse files
authored
Updates for 0.18.1
1 parent f00effa commit 0748015

20 files changed

+153
-61
lines changed

1-tutorials/1-getting-started.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@
287287
"tc.hvplot()"
288288
]
289289
},
290+
{
291+
"cell_type": "markdown",
292+
"metadata": {},
293+
"source": [
294+
"We can filter out trajectories based on their duration:"
295+
]
296+
},
290297
{
291298
"cell_type": "code",
292299
"execution_count": null,
@@ -322,7 +329,7 @@
322329
"name": "python",
323330
"nbconvert_exporter": "python",
324331
"pygments_lexer": "ipython3",
325-
"version": "3.10.10"
332+
"version": "3.10.14"
326333
}
327334
},
328335
"nbformat": 4,

1-tutorials/10-smoothing-trajectories.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"\n",
1616
"To smooth trajectories, we can use a Kalman filter. The implemented KalmanSmootherCV is based on the assumption of a nearly-constant velocity (CV) model. To use KalmanSmootherCV, the optional dependency `StoneSoup` needs to be installed.\n",
1717
"\n",
18-
"[Documentation](https://movingpandas.readthedocs.io/en/main/trajectorysmoother.html)\n",
18+
"[Documentation](https://movingpandas.readthedocs.io/en/main/api/trajectorysmoother.html)\n",
1919
"\n",
2020
"A closely related type of operation is [trajectory generalization which is coverd in a separate notebook](./7-generalizing-trajectories.ipynb). "
2121
]
@@ -171,7 +171,7 @@
171171
"name": "python",
172172
"nbconvert_exporter": "python",
173173
"pygments_lexer": "ipython3",
174-
"version": "3.10.12"
174+
"version": "3.10.14"
175175
}
176176
},
177177
"nbformat": 4,

1-tutorials/11-measuring-distances.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"Distances can be computed between trajectories as well as between trajectories and other geometry objects. \n",
1717
"The implemented distance measures are:\n",
1818
"\n",
19-
"* [Shortest distance](https://movingpandas.readthedocs.io/en/main/trajectory.html#movingpandas.Trajectory.distance)\n",
20-
"* [Hausdorff distance](https://movingpandas.readthedocs.io/en/main/trajectory.html#movingpandas.Trajectory.hausdorff_distance)\n"
19+
"* [Shortest distance](https://movingpandas.readthedocs.io/en/main/api/trajectory.html#movingpandas.Trajectory.distance)\n",
20+
"* [Hausdorff distance](https://movingpandas.readthedocs.io/en/main/api/trajectory.html#movingpandas.Trajectory.hausdorff_distance)\n"
2121
]
2222
},
2323
{
@@ -191,7 +191,7 @@
191191
"name": "python",
192192
"nbconvert_exporter": "python",
193193
"pygments_lexer": "ipython3",
194-
"version": "3.10.10"
194+
"version": "3.10.14"
195195
}
196196
},
197197
"nbformat": 4,

1-tutorials/2-computing-speed.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
"name": "python",
233233
"nbconvert_exporter": "python",
234234
"pygments_lexer": "ipython3",
235-
"version": "3.10.10"
235+
"version": "3.10.14"
236236
}
237237
},
238238
"nbformat": 4,

1-tutorials/3-extracting-mover-positions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
"name": "python",
260260
"nbconvert_exporter": "python",
261261
"pygments_lexer": "ipython3",
262-
"version": "3.10.10"
262+
"version": "3.10.14"
263263
}
264264
},
265265
"nbformat": 4,

1-tutorials/4-exporting-trajectories.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
"name": "python",
183183
"nbconvert_exporter": "python",
184184
"pygments_lexer": "ipython3",
185-
"version": "3.10.10"
185+
"version": "3.10.14"
186186
}
187187
},
188188
"nbformat": 4,

1-tutorials/5-intersecting-with-polygons.ipynb

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"cell_type": "markdown",
126126
"metadata": {},
127127
"source": [
128-
"## Computing intersections"
128+
"## Computing intersections for a Trajectory"
129129
]
130130
},
131131
{
@@ -151,6 +151,50 @@
151151
"intersections"
152152
]
153153
},
154+
{
155+
"cell_type": "code",
156+
"execution_count": null,
157+
"metadata": {},
158+
"outputs": [],
159+
"source": [
160+
"intersections.plot()"
161+
]
162+
},
163+
{
164+
"cell_type": "code",
165+
"execution_count": null,
166+
"metadata": {},
167+
"outputs": [],
168+
"source": [
169+
"intersections.to_point_gdf()"
170+
]
171+
},
172+
{
173+
"cell_type": "markdown",
174+
"metadata": {},
175+
"source": [
176+
"## Computing intersections for a TrajectoryCollection"
177+
]
178+
},
179+
{
180+
"cell_type": "code",
181+
"execution_count": null,
182+
"metadata": {},
183+
"outputs": [],
184+
"source": [
185+
"intersections = tc.intersection(polygon_feature)\n",
186+
"intersections"
187+
]
188+
},
189+
{
190+
"cell_type": "code",
191+
"execution_count": null,
192+
"metadata": {},
193+
"outputs": [],
194+
"source": [
195+
"intersections.plot()"
196+
]
197+
},
154198
{
155199
"cell_type": "code",
156200
"execution_count": null,
@@ -184,7 +228,7 @@
184228
"name": "python",
185229
"nbconvert_exporter": "python",
186230
"pygments_lexer": "ipython3",
187-
"version": "3.10.10"
231+
"version": "3.10.14"
188232
}
189233
},
190234
"nbformat": 4,

1-tutorials/6-splitting-trajectories.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
"name": "python",
237237
"nbconvert_exporter": "python",
238238
"pygments_lexer": "ipython3",
239-
"version": "3.10.10"
239+
"version": "3.10.14"
240240
}
241241
},
242242
"nbformat": 4,

1-tutorials/7-generalizing-trajectories.ipynb

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"- Temporal generalization by down-sampling, i.e. increasing the time interval between records\n",
2020
"- Spatiotemporal generalization, e.g. using Top-Down Time Ratio algorithm\n",
2121
"\n",
22-
"[Documentation](https://movingpandas.readthedocs.io/en/main/trajectorygeneralizer.html)\n",
22+
"[Documentation](https://movingpandas.readthedocs.io/en/main/api/trajectorygeneralizer.html)\n",
2323
"\n",
24-
"A closely related type of operation is [trajectory smoothing which is coverd in a separate notebook](./10-smoothing-trajectories.ipynb). "
24+
"A closely related type of operation is [trajectory smoothing which is covered in a separate notebook](./10-smoothing-trajectories.ipynb). "
2525
]
2626
},
2727
{
@@ -199,6 +199,24 @@
199199
"dp_generalized.plot(ax=axes[1], column='speed', vmax=20, **plot_defaults)"
200200
]
201201
},
202+
{
203+
"cell_type": "markdown",
204+
"metadata": {},
205+
"source": [
206+
"Let's compare this to the MinTimeDelta result:"
207+
]
208+
},
209+
{
210+
"cell_type": "code",
211+
"execution_count": null,
212+
"metadata": {},
213+
"outputs": [],
214+
"source": [
215+
"fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(19,4))\n",
216+
"tdtr_generalized.plot(ax=axes[0], column='speed', vmax=20, **plot_defaults)\n",
217+
"time_generalized.plot(ax=axes[1], column='speed', vmax=20, **plot_defaults)"
218+
]
219+
},
202220
{
203221
"cell_type": "code",
204222
"execution_count": null,
@@ -223,7 +241,7 @@
223241
"name": "python",
224242
"nbconvert_exporter": "python",
225243
"pygments_lexer": "ipython3",
226-
"version": "3.10.10"
244+
"version": "3.10.14"
227245
}
228246
},
229247
"nbformat": 4,

1-tutorials/8-detecting-stops.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
"outputs": [],
175175
"source": [
176176
"%%time\n",
177-
"stops = detector.get_stop_segments(min_duration=timedelta(seconds=60), max_diameter=100)"
177+
"stop_segments = detector.get_stop_segments(min_duration=timedelta(seconds=60), max_diameter=100)"
178178
]
179179
},
180180
{
@@ -183,7 +183,7 @@
183183
"metadata": {},
184184
"outputs": [],
185185
"source": [
186-
"stops"
186+
"stop_segments"
187187
]
188188
},
189189
{
@@ -192,7 +192,7 @@
192192
"metadata": {},
193193
"outputs": [],
194194
"source": [
195-
"stop_segment_plot = stop_point_plot * stops.hvplot(line_width=7.0, tiles=None, color='orange') \n",
195+
"stop_segment_plot = stop_point_plot * stop_segments.hvplot(line_width=7.0, tiles=None, color='orange') \n",
196196
"stop_segment_plot"
197197
]
198198
},
@@ -297,7 +297,7 @@
297297
"name": "python",
298298
"nbconvert_exporter": "python",
299299
"pygments_lexer": "ipython3",
300-
"version": "3.10.10"
300+
"version": "3.10.14"
301301
}
302302
},
303303
"nbformat": 4,

0 commit comments

Comments
 (0)