-
Notifications
You must be signed in to change notification settings - Fork 69
added simple tutorial to introduce the jupyterGIS GUI. #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fcda4df
b37f097
7c64993
fe8b832
073d17a
d9864ae
152facf
e1c1c41
ec6b8f7
b6fd6bb
3b9bdd1
a7b6898
f8a8d63
73ddf89
7ffe482
5d01ea7
59860c6
ee50420
e3cdb7a
b40e5f1
0e594be
ea574c7
c588349
e7ddd49
feb7ae0
7a7b21f
67c2f3e
471e05c
b1de24b
b583cf1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,5 +36,6 @@ Table of contents | |
| extension | ||
| python_api | ||
| collab.rst | ||
| tutorials/intro.md | ||
| contributing.rst | ||
| changelog.rst | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,196 @@ | ||
| # Getting Started with JupyterGIS | ||
|
|
||
| Welcome to the first tutorial in the JupyterGIS series! This guide will introduce you to the basics of JupyterGIS and help you set up your environment, create your first map, and understand its key features. | ||
|
|
||
| :::{admonition} Objectives | ||
| :class: seealso | ||
|
|
||
| By the end of this tutorial, you will: | ||
|
|
||
| 1. Understand what JupyterGIS is and its key capabilities. | ||
| 2. Set up the required tools and libraries. | ||
| 3. Create a simple map and add layers. | ||
| 4. Explore basic geospatial analysis using JupyterGIS. | ||
| ::: | ||
|
|
||
| :::{admonition} Prerequisites | ||
| :class: warning | ||
| Before beginning this tutorial, JupyterGIS must be installed on your computer (see [Installation instructions](https://geojupyter.github.io/jupytergis/install.html)) or you can use an online version of JupyterGIS (such as [](https://geojupyter.github.io/jupytergis/lite/lab/index.html?path=france_hiking.jGIS/)). | ||
| ::: | ||
|
|
||
| ## Introduction to JupyterGIS | ||
|
|
||
| JupyterGIS integrates geospatial analysis with the interactivity of Jupyter Notebooks, enabling users to: | ||
|
|
||
| - Visualize geospatial data and create interactive maps. | ||
| - Process and analyze geospatial data. | ||
| - Share and collaborate on geospatial workflows. | ||
|
|
||
| JupyterGIS is designed for researchers, data scientists, and GIS professionals aiming to combine Python’s analytical power with intuitive geospatial visualizations. | ||
|
|
||
| ## An Overview of the Interface | ||
|
|
||
| We will explore the JupyterGIS user interface to help you become familiar with its menus, toolbars, map canvas, and layers list, which make up the core structure of the interface. | ||
|
|
||
| :::{admonition} Lesson goal | ||
| :class: tip | ||
| **The objective of this lesson is to understand the fundamentals of the JupyterGIS user interface.** | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Love this. Nitpick: Maybe we could use an admonition with the custom title "Lesson goal" instead of a bolded paragraph? |
||
| ::: | ||
|
|
||
|  | ||
|
|
||
| The elements shown in the figure above are: | ||
|
|
||
| 1. The application Launcher helps you to select which application you want to start e.g. a Notebook, a Console, and another application such as a Terminal or open a GIS file (which can be either a JupyterGIS file or a QGIS file). | ||
| 2. Left Sidebar which contains a file browser, a list of tabs in the main work and of running kernels and terminals, the command palette, the table of contents, the extension manager, and the JupyterGIS extension which allows you to see the GIS layers list. | ||
| 3. GIS Layers List / Browser Panel | ||
| 4. Right Sidebar showing the property inspector (active in notebooks), the debugger, and GIS object properties, annotation and filters. | ||
| 5. The GIS object properties, annotations and filters of a selected GIS layer. | ||
| 6. The Jupyter toolbar menu which you will use with Jupyter Notebooks. | ||
| 7. The Log console (which you can you for debugging). | ||
|
|
||
| ## Adding your first layers | ||
|
|
||
| We will start the JupyterGIS application and create a basic map. | ||
|
|
||
| **The goal for this lesson: To get started with an example map.** | ||
annefou marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Launch JupyterGIS from your terminal or start an online version of JupyterGIS depending on what you decided to use for this exercise. | ||
|
|
||
| ```bash | ||
| jupyter lab | ||
| ``` | ||
|
|
||
| ### Add a vector Layer | ||
|
|
||
| Follow along to add a vector layer available online. | ||
|
|
||
| 1. Click on the GIS File Icon in the "Other" section of the Launcher to create a new JGIS project file. You will have a new, blank map. | ||
|  | ||
| :::{admonition} Why can't I see all the elements in the JupyterGIS User Interface? | ||
| :class: attention | ||
| If you don't see **GIS File** (under the JupyterGIS icon) in the **Other** section of the application launcher, you may have an issue with the JupyterGIS installation or may have forgotten to install it. Please refer to the prerequisites at the top of this tutorial to continue. | ||
| ::: | ||
| 2. Open Layer Browser (see image below) and select for instance _OpenStreetMap.Mapnik_. An interactive map will appear and you will be able to zoom in and zoom out with your mouse. | ||
|  | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: The image has text that repeats the text in Markdown here. I think the text could be removed from the image, keeping the red arrow, and that would improve the signal:noise ratio of this image. |
||
| 3. Click on the **+** to add a user-defined layer and select "New Shapefile Layer" to add a new vector layer (stored as a shapefile). | ||
|  | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: For consistency we could add a red arrow pointing at "New ShapeFile Layer" |
||
| 4. Set the path of the new shapefile Layer to `https://www2.census.gov/geo/tiger/GENZ2015/shp/cb_2015_us_county_500k.zip` and click **Ok**. | ||
|  | ||
| 5. You will see the new Shapefile Layer on the map. When clicking on the **Custom Shapefile Layer** (see figure below), you will also see the details of the object properties on the right of the map. You can pan and zoom to focus on your area of interest, or automatically focus on your new data layer by right-clicking on the **Custom Shapefile Layer** and selecting "Zoom to Layer". | ||
|  | ||
|
|
||
| :::{admonition} Why don't we add a local shapefile? | ||
| :class: tip | ||
| One of the main strength of JupyterGIS is its collaborative capabilities. To be able to collaborate, it is much easier to work with data that is available to everyone online. | ||
| ::: | ||
|
|
||
| ## Renaming Sources and Layers | ||
|
|
||
| When adding a new source or layer, default names are assigned. It is good practice to rename both the source and layer with meaningful names to avoid confusion when adding similar layers in the future. To rename a source, select it in the GIS Sources List / Browser Panel, and right click to **Rename Source**. | ||
|
|
||
| Let's rename the source called 'Custom Shapefile Source' to 'US Counties' so that we can easily identify it in the list when adding a new source. | ||
|  | ||
|
|
||
| ```{exercise} | ||
| :label: Rename-layer | ||
|
|
||
| - Rename the **Custom Shapefile Layer** with a meaningful name e.g., **US Counties** for the US County Shapefile Layer. | ||
|
|
||
| ``` | ||
|
|
||
| ```{solution} Rename-layer | ||
| :class: dropdown | ||
|  | ||
| ``` | ||
|
|
||
| :::{admonition} Ordering in the list of Sources versus Layers | ||
| :class: warning | ||
| Did you notice in the figures above that in the list of sources, the source for 'US Counties' appears before the source for 'OpenStreetMap.Mapmik'? In contrast, you can see the reverse order in the list of Layers. | ||
| The reason is that sources are ordered alphabetically, while layers are ordered based on the order in which they are added, with the top layer being the most recently added to your map. | ||
| ::: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice callout!!! |
||
|
|
||
| ## Adding a new layer on top of an existing one | ||
|
|
||
| Let's do an exercise to practice adding a new layer. | ||
|
|
||
| ```{exercise-start} | ||
| :label: add-vector-layer | ||
| ``` | ||
|
|
||
| - Add a new Shapefile Layer to your map: | ||
|
|
||
| ``` | ||
| https://docs.geoserver.org/stable/en/user/_downloads/30e405b790e068c43354367cb08e71bc/nyc_roads.zip | ||
| ``` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both layers display as "Custom Shapefile layer" at this point in the tutorial, and same for the sources. It would be nice to give them names early in this tutorial to reduce the cognitive load of the learner! Then we can demonstrate renaming later in the tutorial without having to pay the cognitive load price. |
||
|
|
||
| - Zoom over New-York (USA) and check if you can see the newly added layer. | ||
| - Rename both the newly added layer and its corresponding source, e.g. 'NYC Roads'. | ||
| - Let's customize this new layer by changing the color. In the GIS Layer/Browser Panel, select the top layer (corresponds to the last layer you added) and right click to **Edit Symbology**. Then change the **Stroke Color** to a color of your choice. You can also change the Stroke Width and check the result after pressing \*_OK_. | ||
| - In a similar way, you can edit the symbology of the 'US Counties' Shapefile Layer we added earlier and change the **Fill Color**, **Stroke Color** and **Stroke Width**. | ||
| - Do you still see the roads in New-York? Try to adjust the **Opacity** value (default is 1) to a lower value for this Shapefile Layer. Can you see all your layers now? | ||
|
|
||
| ```{exercise-end} | ||
|
|
||
| ``` | ||
|
|
||
| ```{solution} add-vector-layer | ||
mfisher87 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| :class: dropdown | ||
|
|
||
| After adding the new Shapefile Layer and zooming over New-York, you should have the following map: | ||
|  | ||
|
|
||
| When you right click to edit the symbology, you should get the following pop-up menu: | ||
|  | ||
|
|
||
| And when editing the symbology of the 'US Counties' Shapefile Layer: | ||
|  | ||
|
|
||
| And updating the opacity (for instance to 0.5) of the US county Shapefile Layer, you can get a map that looks like this (depending on the colors and Stroke width you chose!): | ||
|
|
||
|  | ||
| ``` | ||
|
|
||
| ## Hiding and Reordering Layers | ||
|
|
||
| ### Hiding/Viewing Layers | ||
|
|
||
| In the GIS Layers List/Browser Panel, you can select a layer and click the **eye** icon to hide or show the corresponding layer. | ||
|  | ||
|
|
||
| ### Reordering Layers | ||
|
|
||
| The layers in your Layers List are displayed on the map according to their order in the list. The bottom layer is drawn first, while the top layer is drawn last. You can adjust their drawing order by rearranging the layers in the list. | ||
|
|
||
| The order in which the layers have been loaded into the map is probably not logical at this stage. It’s possible that the road layer or/and the country layer are completely hidden because other layers are on top of it. | ||
|
|
||
| For example, this layer order: | ||
|  | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should only show layers in this screenshot, not sources. It's a bit confusing! |
||
|
|
||
| would hide all the custom shapefile layers underneath the OpenStreetMap raster layer. | ||
|
|
||
| To solve this problem, you can click and drag on a layer in the Layers list to move it up or down, and reordering the layers as you wish them to be viewed on the map. | ||
|
|
||
| ## Save your JGIS project | ||
|
|
||
| Your jGIS file corresponds to your GIS project (similar to `.qgz` for QGIS) and you probably already noticed that the default name is `untitled.jGIS`. If you created several jGIS files without renaming them, a number will be added before the extension e.g. `untitled1.jGIS`, `untitled2.jGIS`, etc. | ||
|
|
||
| It is important to give meaningful name to your jGIS project. | ||
|
|
||
| To rename it, you can click on **File** in the Jupyter toolbar menu and select **Rename JGIS...** to give a new name to your jGIS project. | ||
|
|
||
|  | ||
|
|
||
| ## Conclusion | ||
|
|
||
| Congratulations on completing this tutorial! You've created a basic map in JupyterGIS, learned how to add new layers, rearrange layers, alter symbology, and save your project. You're now well on your way to becoming a pro JupyterGIS user! | ||
|
|
||
| ## Additional resources | ||
|
|
||
| - [JupyterGIS Documentation](https://geojupyter.github.io/jupytergis) | ||
| - [Folium Library](https://python-visualization.github.io/folium/latest/) | ||
| - [Geopandas Documentation](https://geopandas.org/en/stable/docs.html) | ||
| - [QGIS Documentation](https://www.qgis.org) | ||
| - [QGIS Tutorials and Tips](https://www.qgistutorials.com/en/index.html) | ||
|
|
||
| Happy Mapping! | ||
Uh oh!
There was an error while loading. Please reload this page.