-
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 12 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,177 @@ | ||
| # 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. | ||
|
|
||
| ## Objectives | ||
|
||
|
|
||
| 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. | ||
|
|
||
| ## Introduction to JupyterGIS | ||
|
|
||
| JupyterGIS integrates geospatial analysis with the interactivity of Jupyter Notebooks, making it easy to: | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - Visualize and create interactive maps. | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - 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. | ||
|
|
||
| **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. GIS Layers List / Browser Panel | ||
| 3. 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. | ||
|
||
| 4. The GIS object properties, annotations and filters of a selected GIS layer. | ||
| 5. The Jupyter toolbar menu which you will use with Jupyter Notebooks. | ||
| 6. The Log console (which you can you for debugging). | ||
| 7. Right Sidebar showing the property inspector (active in notebooks), the debugger, and GIS object properties, annotation and filters. | ||
|
||
|
|
||
| ## 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
|
||
|
|
||
| :::{admonition} Get JupyterGIS | ||
martinRenou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| :class: tip | ||
| Before beginning this exercise, 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/)). | ||
| ::: | ||
mfisher87 marked this conversation as resolved.
Outdated
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 Editor. You will have a new, blank map. | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|  | ||
| 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 another type of layer and select "New Shapefile Layer" to add a new vector layer (stored as a shapefile). | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|  | ||
|
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 should then be able to see the new Shapefile Layer on the map and when clicking on the **Custom Shapefile Layer** (see figure below), you should also see the details of the object properties on the right of the map. The map being interactive, you can zoom in and out as you wish to focus on your area of interest (here over the US). | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|  | ||
|
|
||
| :::{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 shared and available online. | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ::: | ||
|
|
||
| ```{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. | ||
| - 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 first Shapefile Layer we added 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 other Shapefile Layer: | ||
|  | ||
|
|
||
| And updating the opacity (for instance to 0.5) of the US county Shapefile Layer, you can get a map that can look like to (depending on the colors and Stroke width you chose!): | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
| ``` | ||
|
|
||
| ## 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. | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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. | ||
|
|
||
| ## Renaming Layers | ||
|
|
||
| As shown on the previous image, the two custom shapefile layers we added have the same name in the GIS Layers List / Browser Panel which can be very confusing. | ||
| It is a good practice to rename your layers with meaningful names. To rename a layer, select it in the GIS Layers List / Browser Panel, and right click to **Rename Layer**. | ||
|
|
||
| ```{exercise-start} | ||
| :label: Rename-layer | ||
| ``` | ||
|
||
|
|
||
| - Rename each **Custom Shapefile Layer** with a meaningful name e.g., **cb_2015_us_county_500k** for the US County Shapefile Layer and **nyc_roads** for the roads in New-York. | ||
|
||
|
|
||
| ```{exercise-end} | ||
|
|
||
| ``` | ||
|
|
||
| ```{solution} Rename-layer | ||
| :class: dropdown | ||
|  | ||
| ``` | ||
|
|
||
| ## 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 | ||
|
|
||
| Now you’ve learned how to add all the layers you need from various sources and have created a basic map! | ||
annefou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## 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.