Skip to content

Commit d21ed8b

Browse files
committed
Update module 2 example for clearer instructions
1 parent 98b8f97 commit d21ed8b

File tree

2 files changed

+98
-45
lines changed

2 files changed

+98
-45
lines changed

examples/module-2/example-2.ipynb

Lines changed: 98 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@
7676
"explore(gdf)"
7777
]
7878
},
79+
{
80+
"cell_type": "markdown",
81+
"id": "33ca87e0-cd33-474c-aabb-88655d333b82",
82+
"metadata": {},
83+
"source": [
84+
"* **Zoom in on the data points in boulder using your scroll wheel**.\n",
85+
"* **Once you're done exploring, close the JupyterGIS explorer tab**."
86+
]
87+
},
7988
{
8089
"cell_type": "markdown",
8190
"id": "3a19593b-9112-4dfc-8015-0fb4ee210fb6",
@@ -85,7 +94,7 @@
8594
"\n",
8695
"JupyterGIS introduces a new file format for projects.\n",
8796
"\n",
88-
"We've prepared a JupyterGIS project, i.e. a `.jGIS` file, with a basemap:"
97+
"We've prepared a JupyterGIS project, i.e. a `.jGIS` file, with a basemap. Let's load it and call it `doc`:"
8998
]
9099
},
91100
{
@@ -108,7 +117,9 @@
108117
"id": "eeac2318-9a05-4f6e-a235-f2230e46177a",
109118
"metadata": {},
110119
"source": [
111-
"Let's add our example data:"
120+
"No data is present in this document yet, it's just a basemap.\n",
121+
"\n",
122+
"* **Add our example data**:"
112123
]
113124
},
114125
{
@@ -126,31 +137,34 @@
126137
"id": "0c2a1a42-b21f-447b-be26-9c61a3dd3bc6",
127138
"metadata": {},
128139
"source": [
129-
"## The map has been updated!\n",
140+
"#### The map has been updated!\n",
130141
"\n",
131-
"But you have to scroll up to see the change in the widget.\n",
132-
"Let's open that map in a new panel view instead of as an embedded widget.\n",
142+
"But you have to scroll up in the Notebook to see the change in the widget.\n",
143+
"We're going to make many more changes, so let's open up the project file we just built.\n",
133144
"\n",
134-
"In the blank space to the left of the map, right-click, then select \"create new view for cell output\".\n",
135-
"We'll keep the map open in a panel from now on."
145+
"* **In the file browser, double-click `example.jGIS` to open the project file as a full tab**.\n",
146+
"* **Click and drag that tab to move it to a split view**.\n",
147+
" * Experiment with dragging it to different places to find a comfortable layout.\n",
148+
" * Try resizing the split view by clicking and draging on the divider!"
136149
]
137150
},
138151
{
139152
"cell_type": "markdown",
140153
"id": "4851bdac-8e48-45d0-9c36-f14271c85792",
141154
"metadata": {},
142155
"source": [
143-
"## The layers panel\n",
156+
"#### The layers panel\n",
144157
"\n",
145158
"Let's view the layers currently on the map.\n",
146159
"\n",
147-
"On the far left panel, click the globe icon.\n",
160+
"On the left panel, you should see the JupyterGIS layers panel. You may need to expand it!\n",
148161
"\n",
149-
"Then expand the \"Layers\" view within the new panel.\n",
162+
"* If you don't see the layers panel, click the globe icon on the **far** left column of icons.\n",
163+
"* If the layers view is collapsed, expand it.\n",
164+
"* **Right click on \"SEEC and NSIDC\" and select \"Zoom to Layer\"**.\n",
150165
"\n",
151-
"Right click on \"SEEC and NSIDC\" and select \"Zoom to Layer\".\n",
152-
"You should see your data points on the furthest edges of the map, but the basemap has likely become unusable.\n",
153-
"Zoom out a little bit by scrolling."
166+
" You should see your data points on the furthest edges of the map.\n",
167+
" Zoom out a little bit to see the data points more clearly."
154168
]
155169
},
156170
{
@@ -160,11 +174,17 @@
160174
"source": [
161175
"## Challenge\n",
162176
"\n",
163-
"### Add the other dataset you created in the previous module\n",
177+
"### Add the \"final\" dataset you created in Module 1\n",
178+
"\n",
179+
"`example.jGIS` should already be open in a separate window.\n",
164180
"\n",
165-
"You created a dataset with a location that's meaningful to you in the previous module. Load that dataset in the cell below, and check that the map updated!\n",
181+
"* **Add the final dataset from the previous module as a layer in the cell below**, and check that the map updated!\n",
166182
"\n",
167-
"Don't forget to give your new layer a name. Also, consider that you may need to specify a relative path, e.g. `../module-1/final.geojson`."
183+
" Hint: Don't forget to give your new layer a meaningful name.\n",
184+
"\n",
185+
" Hint: Reference the code cells above to see how to add a geojson layer to the map.\n",
186+
"\n",
187+
" Hint: The dataset you created was named `final.geojson`, but it's in a different directory than this notebook. The path to the layer you should use is `\"../module-1/final.geojson\"`."
168188
]
169189
},
170190
{
@@ -174,47 +194,68 @@
174194
"metadata": {},
175195
"outputs": [],
176196
"source": [
177-
"# Add your GeoJSON layer in this cell."
197+
"# Add your GeoJSON layer to the doc in this cell."
178198
]
179199
},
180200
{
181201
"cell_type": "markdown",
182-
"id": "b5c0736c-0b6c-4930-9bdf-0b256028b400",
202+
"id": "b9b1faad-ea7a-4a5e-ae86-74dea098c82e",
203+
"metadata": {},
204+
"source": [
205+
":::{hint} Solution\n",
206+
":class: dropdown\n",
207+
"\n",
208+
"Here is a solution you can copy/paste:\n",
209+
"\n",
210+
"```python\n",
211+
"doc.add_geojson_layer(\"../module-1/final.geojson\", name=\"My module-1 dataset\")\n",
212+
"```\n",
213+
":::"
214+
]
215+
},
216+
{
217+
"cell_type": "markdown",
218+
"id": "3365876f-d5cb-4c74-924e-6c5df91ee324",
183219
"metadata": {
184220
"jp-MarkdownHeadingCollapsed": true
185221
},
186222
"source": [
187-
"### Identify points\n",
223+
"### Let's play with a different data source\n",
188224
"\n",
189-
"In the toolbar at the top of the map, select the \"i\" icon to toggle on identify mode.\n",
225+
"* In the map panel, **click the ➕ icon in the toolbar at the top of the map**.\n",
226+
"* **Select \"Add Vector Layer\"**, then **\"New GeoJSON Layer\"**.\n",
227+
"* In the dialog's \"Path\" field, **select \"Browse Server Files\"**.\n",
228+
"* **Navigate to the `workshop-csdms2025-exercises/examples/module-2` directory**.\n",
229+
"* **Select `us_cities.geojson`**.\n",
230+
"* **Click the \"Select\" button**.\n",
231+
"* **Click \"OK\"**.\n",
190232
"\n",
191-
"Select the layer in the layers panel you want to identify features from.\n",
192-
"Click a point to see its attributes.\n",
193-
"They'll be visible in the \"identify\" section of the right panel.\n",
233+
"You may notice that the added layer is titled \"Custom GeoJSON Layer\". Let's fix that!\n",
194234
"\n",
195-
"If the right panel isn't open, click the globe icon in the far right of JupyterLab.\n",
196-
"If the \"identify\" section isn't visible, you may need to expand it (the triangle to the left of the word \"identify\" should be pointing **down**).\n",
197-
"If it's still not visible, you may need to shrink the other open panels by clicking and dragging at the edge, or by collapsing it entirely."
235+
"* **Right-click the layer and select \"Rename Layer\"**.\n",
236+
"* **Title it \"US Cities\"**."
198237
]
199238
},
200239
{
201240
"cell_type": "markdown",
202-
"id": "3365876f-d5cb-4c74-924e-6c5df91ee324",
203-
"metadata": {},
241+
"id": "b5c0736c-0b6c-4930-9bdf-0b256028b400",
242+
"metadata": {
243+
"jp-MarkdownHeadingCollapsed": true
244+
},
204245
"source": [
205-
"### Let's play with other data sources.\n",
246+
"### Identify points\n",
206247
"\n",
207-
"The JupyterGIS Python API doesn't yet support adding remote GeoJSON layers, so we'll use the JupyterGIS GUI for this.\n",
248+
"Sometimes you want to learn more about features than what you can see on the map. For example, the population of a city.\n",
208249
"\n",
209-
"In the map panel, click the ➕ icon in the toolbar at the top of the map.\n",
210-
"Select \"Add Vector Layer\", then \"New GeoJSON Layer\".\n",
211-
"In the dialog's \"Path\" field, select \"Browse Server Files\".\n",
212-
"Navigate to the `workshop-csdms2025-exercises/examples/module-2` directory, then select `us_cities.geojson`.\n",
250+
"* **In the toolbar at the top of the map, select the \"i\" icon to toggle on identify mode**.\n",
251+
"* **Select the US Cities layer you added in the previous step**.\n",
252+
"* **Click a point to see its attributes**.\n",
213253
"\n",
214-
"Click the \"Select\" button, then click \"OK\".\n",
254+
" They'll be visible in the \"identify\" section of the right panel.\n",
215255
"\n",
216-
"You may notice that the added layer is titled \"Custom GeoJSON Layer\". Right-click the layer and select \"Rename Layer\".\n",
217-
"Title it \"US Cities\"."
256+
"* If the right panel isn't open, click the globe icon in the far right of JupyterLab.\n",
257+
"* If the \"identify\" section isn't visible, you may need to expand it (the triangle to the left of the word \"identify\" should be pointing **down**).\n",
258+
"* If it's still not visible, you may need to shrink the other open panels by clicking and dragging at the edge, or by collapsing it entirely."
218259
]
219260
},
220261
{
@@ -224,25 +265,37 @@
224265
"source": [
225266
"### Add symbology\n",
226267
"\n",
268+
"Viewing points one-by-one isn't always what we need; sometimes we need to be able to see patterns on the map visually.\n",
269+
"\n",
227270
"**⚠️ There's a bug here, watch out! ⚠️**\n",
228271
"\n",
229272
"Don't forget, **JupyterGIS is in early stages. It will get much better!**\n",
230273
"\n",
231274
"#### Work around the bug\n",
232275
"\n",
233-
"Before we can apply symbology, we need to set the vector type to \"circle\" in the right panel.\n",
234-
"Under \"Objects properties\", select \"Circle\" in the Type dropdown, then click OK.\n",
276+
"Before we can apply symbology, we need to work around a bug.\n",
277+
"\n",
278+
"* **Set the vector type to \"circle\" in the right panel.**\n",
279+
"* **Under \"Objects properties\", select \"Circle\" in the \"Type\" dropdown, then click OK.**\n",
235280
"You may need to scroll down, resize, or collapse sections of the right sidebar to see the OK button.\n",
236281
"\n",
237282
"#### Now, we can set symbology!\n",
238283
"\n",
239-
"Right click on the \"US Cities\" layer in the left panel.\n",
240-
"Select \"Edit symbology\".\n",
241-
"Select \"Render type: Graduated\", \"Value: ELEV_IN_FT\", \"Method: Color\".\n",
242-
"Select your favorite colormap (**please, don't select \"Rainbow\" - it is not an effective colormap**).\n",
243-
"Click \"Classify\", then click \"OK\".\n",
284+
"* **Right click on the \"US Cities\" layer in the left panel**.\n",
285+
"* **Select \"Edit symbology\"**.\n",
286+
"* **Input the following settings**\n",
287+
"\n",
288+
" You may want to view these settings in a separate window; SHIFT+right-click the image and select \"Open in new window\"\n",
289+
"\n",
290+
" ![JupyterGIS symbology settings](jgis-symbology-menu.png)\n",
291+
" \n",
292+
" * Render type: Graduated\n",
293+
" * Value: ELEV_IN_FT\n",
294+
" * Method: Color\n",
295+
" * Select your favorite colormap (**please, don't select \"Rainbow\" - it is not an effective colormap**).\n",
296+
"* **Click \"Classify\", then click \"OK\".**\n",
244297
"\n",
245-
"What's the highest-elevation city you can see?\n",
298+
"What's the highest elevation value you can see?\n",
246299
"What would you do differently to make it easier to find?\n",
247300
"Do you see any flaws in this dataset when you use \"Identify\" on the points?"
248301
]
56.6 KB
Loading

0 commit comments

Comments
 (0)