Add vector data analysis tutorial#136
Conversation
New beginner/intermediate tutorial covering the core vector toolkit: - exploring features and attributes (v.info, v.db.select) - selecting by attribute (v.extract) and by location (v.select) - buffering (v.buffer) and overlaying (v.overlay) layers - counting features per area (v.vect.stats) for a thematic map Worked example uses the North Carolina schools, roads, and ZIP codes, and the grass.tools API (GRASS 8.5). Categories: vector, beginner, intermediate, Python.
veroandreo
left a comment
There was a problem hiding this comment.
The content is ok for an intro tutorial on basic vector operations. All images need to be fixed, though. Black background does not look nice and they are too big. See other suggestions below.
- regenerate figures with white background, smaller size (width 500), and a legible scale bar (white background box) - retitle to "Basic Vector Data Analysis with GRASS" - show the attribute table (v.db.select JSON -> pandas) before selecting on GLEVEL, so the selection is motivated - add an area-within-reach computation (v.to.db + grouped db.select) to the overlay section - reword the v.overlay intro bullet; move the GRASS-version callout below the setup code to avoid stacked callouts - fix the get-started link to the Python quick start - drop the unmotivated terrain cross-link; minor wording fixes
|
Thanks for the thorough review, @veroandreo! I've pushed an update addressing all of it:
Let me know if you'd like any further changes! |
veroandreo
left a comment
There was a problem hiding this comment.
Thanks @Valyrian-Code! Looks much better now, I left some other minor suggestions here and there.
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Add the two table outputs the review asked for: the schools attribute table (pandas from v.db.select JSON) and the reach-per-ZIP result (db.select also returns JSON, so the same pandas pattern is reused).
|
Thanks @veroandreo! Pushed the follow-ups:
Ready for another look when you have a moment. |
- pass the full path as a single string to gj.init - use .text instead of .stdout for printed output - read JSON results by subscripting the ToolResult directly (tools.v_db_select(...)["records"]) instead of json.loads(...stdout) - move the scale bar to the bottom-right in every figure so it no longer overlays the map
|
Thanks @petrasovaa! Applied the same cleanups here:
I also mirrored the Tools-API changes in the viewshed PR (#135). |
Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
There was a problem hiding this comment.
All scale bars are cropped in the lower border now. Fix all of them.
Raise the scale bar so the bar, label, and north arrow sit fully inside the frame in every figure.
|
Fixed, thanks for catching it. Raised the scale bar so the bar, label, and north arrow now sit fully inside the frame in all figures. |
Adds a new beginner/intermediate tutorial on vector data analysis — the tutorial
set currently has no dedicated vector-focused tutorial, so this fills that gap and
covers the operations users reach for most often.
What it covers
Using the North Carolina
schools_wake(points),roadsmajor(lines), andzipcodes_wake(areas), it works through a single "school accessibility" example:v.info,v.db.selectv.extract(the 95 elementary schools)v.buffer(a 500 m road corridor)v.select(the 15 elementary schools within the corridor)v.overlay(road corridor intersected with ZIP areas)v.vect.stats+ ad.vect.thematicchoropleth of schools per ZIPDetails
eval: false).vector,beginner,intermediate,Python.Feedback on scope, the choice of example, or wording is very welcome.