├── .github └── workflows │ └── render_site.yml ├── .gitignore ├── 00_Introduction.Rmd ├── 01_What-is-GIS.Rmd ├── 02_What-is-QGIS.Rmd ├── 03_Why-QGIS.Rmd ├── 04_Data-Types-Vector-vs-Raster-vs-other-types-of-spatial-data.Rmd ├── 05_Download-data.Rmd ├── 06_Start-QGIS-Open-a-New-Project.Rmd ├── 07_Import-data-into-QGIS.Rmd ├── 08_Saving-Project-Files.Rmd ├── 09_Working-with-Raster-Data.Rmd ├── 10_Working-with-Vector-Data.Rmd ├── 11_Making-a-map-with-the-print-composer.Rmd ├── 12_Select-by-Location.Rmd ├── 13_Further-Reading-Resources.Rmd ├── LICENSE ├── README.md ├── README_archive.md ├── _bookdown.yml ├── _main.log ├── _main.rds ├── _main.tex ├── assessment └── instructions.Rmd ├── docs ├── .nojekyll ├── 404.html ├── QGIS_Workshop.pdf ├── _main.pdf ├── additional-resources.html ├── composing-a-map.html ├── data-types---vector-vs.-raster-vs.-other-types-of-spatial-data.html ├── download-data.html ├── images │ ├── Map_BigTreesInZone.PNG │ ├── Map_CanaryPineLocations.png │ ├── Raster_DEM.PNG │ ├── Raster_LayerProperties.PNG │ ├── Tool_AddMap.PNG │ ├── Tool_Deselect.PNG │ ├── Tool_ExpressionButton.PNG │ ├── Tool_FieldCalculator.png │ ├── Tool_GoBack.PNG │ ├── Tool_MoveItem.PNG │ ├── Tool_Pan.PNG │ ├── Tool_SelectFeaturesUsingExpression.png │ ├── Tool_ZoomInOut.PNG │ ├── Tool_ZoomToSelection.PNG │ ├── Vector_CanaryPine.PNG │ ├── Vector_ClassifiedRoads.PNG │ └── geometries_data_types.png ├── import-data-into-qgis.html ├── index.html ├── introduction.html ├── libs │ ├── accessible-code-block-0.0.1 │ │ └── empty-anchor.js │ ├── anchor-sections-1.1.0 │ │ ├── anchor-sections-hash.css │ │ ├── anchor-sections.css │ │ └── anchor-sections.js │ ├── gitbook-2.6.7 │ │ ├── css │ │ │ ├── fontawesome │ │ │ │ └── fontawesome-webfont.ttf │ │ │ ├── plugin-bookdown.css │ │ │ ├── plugin-clipboard.css │ │ │ ├── plugin-fontsettings.css │ │ │ ├── plugin-highlight.css │ │ │ ├── plugin-search.css │ │ │ ├── plugin-table.css │ │ │ └── style.css │ │ └── js │ │ │ ├── app.min.js │ │ │ ├── clipboard.min.js │ │ │ ├── jquery.highlight.js │ │ │ ├── plugin-bookdown.js │ │ │ ├── plugin-clipboard.js │ │ │ ├── plugin-fontsettings.js │ │ │ ├── plugin-search.js │ │ │ └── plugin-sharing.js │ └── jquery-3.6.0 │ │ └── jquery-3.6.0.min.js ├── making-a-map-with-the-print-composer.html ├── reference-keys.txt ├── saving-project-files.html ├── search_index.json ├── select-by-location.html ├── start-qgis-open-a-new-project.html ├── what-is-gis.html ├── what-is-qgis.html ├── why-qgis.html ├── working-with-raster-data.html └── working-with-vector-data.html ├── images ├── Map_BigTreesInZone.PNG ├── Map_CanaryPineLocations.png ├── Raster_DEM.PNG ├── Raster_LayerProperties.PNG ├── Tool_AddMap.PNG ├── Tool_Deselect.PNG ├── Tool_ExpressionButton.PNG ├── Tool_FieldCalculator.png ├── Tool_GoBack.PNG ├── Tool_MoveItem.PNG ├── Tool_MoveItemContent.PNG ├── Tool_Pan.PNG ├── Tool_SelectFeaturesUsingExpression.png ├── Tool_ZoomInOut.PNG ├── Tool_ZoomToSelection.PNG ├── Vector_CanaryPine.PNG ├── Vector_ClassifiedRoads.PNG ├── geometries.svg ├── geometries_data_types.png └── test ├── index.Rmd └── knit.R /.github/workflows/render_site.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: main 4 | 5 | name: Render site 6 | 7 | jobs: 8 | render: 9 | name: Render site 10 | runs-on: macOS-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: r-lib/actions/setup-r@v2 14 | - uses: r-lib/actions/setup-pandoc@v1 15 | - name: Install bookdown 16 | run: Rscript -e 'install.packages("bookdown")' 17 | - name: Render site 18 | run: Rscript knit.R -p 19 | - name: Add new site files 20 | run: git add docs 21 | - name: Commit results 22 | run: | 23 | git commit docs -m 'Re-build site' || echo "No changes to commit" 24 | git push origin || echo "No changes to commit" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | 3 | .Rhistory 4 | 5 | # General 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | #.RData 10 | .Rhistory 11 | 12 | # Thumbnails 13 | ._* 14 | 15 | # Files that might appear in the root of a volume 16 | .DocumentRevisions-V100 17 | .fseventsd 18 | .Spotlight-V100 19 | .TemporaryItems 20 | .Trashes 21 | .VolumeIcon.icns 22 | .com.apple.timemachine.donotpresent 23 | 24 | # Directories potentially created on remote AFP share 25 | .AppleDB 26 | .AppleDesktop 27 | Network Trash Folder 28 | Temporary Items 29 | .apdisk 30 | 31 | # Bookdown intermediate files 32 | #_main* #when knitting with the pdf flag, the output is _main.pdf and we need this file because it links on the reader 33 | docs/*.md 34 | -------------------------------------------------------------------------------- /00_Introduction.Rmd: -------------------------------------------------------------------------------- 1 | # Introduction 2 | This tutorial uses QGIS 3.x to teach the basics of desktop mapping software for beginners with no previous mapping experience. 3 | 4 | This workshop has been taught on multiple occasions, some of which have video recordings you can watch: 5 | 6 | - April 30, 2019 with QGIS 3.4 [UC Davis DataLab YouTube Channel](https://www.youtube.com/watch?v=avscRlskV2E&t=1s) 7 | - April 14, 2020 with QGIS 3.12 [UC Davis DataLab YouTube Channel](https://www.youtube.com/watch?v=XnabNKLop7c) 8 | - July 17, 2020 with QGIS 3.14 [QGIS North America YouTube Channel](https://www.youtube.com/channel/UCLQd1MsyWWPoIi6rNLUCjhg) 9 | - November 16, 2021 with QGIS 3.16 10 | - April 12, 2022 with QGIS 3.24 [#maptimeDavis YouTube Channel](https://youtu.be/PAcZUPSmqDE) 11 | - March 24, 2023 with QGIS 3.30 for the [Interagency Ecological Program (IEP)](https://iep.ca.gov/) Annual Workshop 12 | -------------------------------------------------------------------------------- /01_What-is-GIS.Rmd: -------------------------------------------------------------------------------- 1 | # What is GIS? 2 | GIS stands for either Geographic Information System or Geographic Information Science, depending on what aspect of the term we are interested in. 3 | 4 | Geographic Information **System** typically refers to the software, like QGIS, we use to create spatial data and to investigate spatial relationships between that data. 5 | 6 | Geographic Information **Science** is the framework we use to ask questions about the spatial relationship between data. 7 | 8 | It's good to understand the difference, but you'll rarely hear people distinguish between the two. We'll do both today - work with the software and ask questions about the spatial relationships in our chosen datasets. 9 | -------------------------------------------------------------------------------- /02_What-is-QGIS.Rmd: -------------------------------------------------------------------------------- 1 | # What is QGIS? 2 | From the [QGIS](https://qgis.org) website, "QGIS is a user friendly Open Source Geographic Information System (GIS) licensed under the GNU General Public License. QGIS is an official project of the Open Source Geospatial Foundation (OSGeo). It runs on Linux, Unix, Mac OSX, Windows and Android and supports numerous vector, raster, and database formats and functionalities." 3 | 4 | Let's unpack some of that. 5 | 6 | **QGIS is a desktop GIS.** That means you get a program that opens up on your computer as a window with buttons you can click, forms you can fill out to do tasks, and it's generally a visual interactive experience (as opposed to commandline programming in a terminal). Often this kind of interface is called a Graphical User Interface or GUI (often pronounced "gooey") for short. 7 | 8 | **QGIS is open source.** That means the code is available for you to read or modify, should you choose to, but you don't have to. What's the advantage of this? It means anyone can make fixes if something is wrong or anyone can add new features. You don't have to wait for a paid developer to add something. 9 | 10 | **QGIS is an official project of the [Open Source Geospatial Foundation (OSGeo)](https://www.osgeo.org/).** "The Open Source Geospatial Foundation (OSGeo) is a not-for-profit organization whose mission is to foster global adoption of open geospatial technology by being an inclusive software foundation devoted to an open philosophy and participatory community driven development." OSGeo supports and assists open source geospatial projects providing infrastructure and organization as well as conferences and means of communication with the broader public and education. 11 | -------------------------------------------------------------------------------- /03_Why-QGIS.Rmd: -------------------------------------------------------------------------------- 1 | # Why QGIS? 2 | 3 | [QGIS](https://www.qgis.org) is an open source, community-driven desktop GIS software that allows users to visualize and analyze spatial data in a variety of ways. There are many reasons to use QGIS, but here are a few: 4 | 5 | - It's a robust, powerful desktop GIS 6 | - Runs on all major platorms: Mac, Linux, & Windows 7 | - Free of charge, all access (no paid add-ons or extensions) 8 | - Frequent updates & bug fixes 9 | - Responsive, enthusiastic community 10 | - Integration with other geospatial tools & programming languages like R, Python, & PostGIS 11 | - Access to analysis tools from other established software like GRASS and SAGA 12 | - Native access to open data formats like geoJSON & GeoPackage 13 | - Comes in [more than 40 languages](https://www.qgis.org/en/site/getinvolved/translate.html), making it easier to work with a larger variety of colaborators 14 | - Growing use by local, state, federal, and international governments 15 | -------------------------------------------------------------------------------- /04_Data-Types-Vector-vs-Raster-vs-other-types-of-spatial-data.Rmd: -------------------------------------------------------------------------------- 1 | # Data Types - Vector vs. Raster vs. other types of spatial data 2 | There are several data spatial data models that you may encounter as you work with spatial data. The two you will likely encounter most frequently are called vector and raster data. 3 | 4 | ![alt text](./images/geometries_data_types.png "A visual table of raster vs. vector data as continuous and discrete data.") 5 | 6 | ## Vector Data 7 | Vector data represents discrete objects in the real world with points, lines, and polygons in the dataset. 8 | 9 | If you were to draw a map to your house for a friend, you would typically use vector data - roads would be lines, a shopping center included as an important landmark might be a rectangle of sorts, and your house might be a point (perhaps represented by a star or a house icon). 10 | 11 | ## Raster Data 12 | Raster data represents continuous fields or discrete objects on a grid, storing measurements or category names in each cell of the grid. 13 | 14 | Digital photos are raster data you are already familiar with. If you zoom in far enough on a digital photo, you'll see that photo is made up of pixels, which appear as colored squares. Pixels are cells in a regular grid and each contains the digital code that corresponds to the color that should be displayed there. Satellite images are a very similar situation. 15 | -------------------------------------------------------------------------------- /05_Download-data.Rmd: -------------------------------------------------------------------------------- 1 | # Download Data 2 | In this workshop, we'll be using the following data: 3 | 4 | 1. Digital Elevation Model (DEM) of San Francisco 5 | 1. Streets 6 | 1. Trees 7 | 1. Seismic Hazard Zones 8 | 1. City of San Francisco Boundary (shoreline) 9 | 10 | You can download all of this data from this [Box Folder Online](https://ucdavis.box.com/s/cnlz6ejmje4qgf7z80h7ygbwydc65kkm). Use the *Download* button in the upper right corner of the screen to download a zipped file containing all of the workshop data (sometimes you'll need to dismiss a message at the top of the screen before you can see the download button). Unzip the file to a location on your computer that you can find later. 11 | -------------------------------------------------------------------------------- /06_Start-QGIS-Open-a-New-Project.Rmd: -------------------------------------------------------------------------------- 1 | # Start QGIS & Open a New Project 2 | Start QGIS in the way you typically open any program on your particular computer's operating system. It's normal that it may take a minute to open. 3 | 4 | When QGIS opens, you may see a list of recent projects, or if this is a new installation, there may not be any listed. It doesn't matter which you see, because we want to start a new project. To do this, click on the *Project* menu in the upper left of the window and select *New* - or you can click the white page icon that is usually near the *Project* menu on the tool bar. 5 | -------------------------------------------------------------------------------- /07_Import-data-into-QGIS.Rmd: -------------------------------------------------------------------------------- 1 | # Import Data into QGIS 2 | Let's load some data. 3 | 4 | ## Raster Data 5 | Let's start by loading the raster data: 6 | 7 | 1. Click on the *Open Data Source Manager* button on your toolbar. It looks like three cards (one red, one yellow, and one blue) fanned out. Or, find it on the *Layer* menu. 8 | 1. Click the *Raster* button (it looks like a checker board) on the left side of the *Data Source Manager* window. 9 | 1. Click on the "..." button in the *Source* section in the middle of the window. Navigate to where you saved your workshop data and select the *DEM_SF.tif* file. 10 | 3. Click *Open*. 11 | 4. Some options will appear on the page. We can leave the defaults for this dataset. 12 | 5. Finally, click "Add" and you should see a black and white raster image appear in the map canvas below the dialog you're working in. If the *Select Transformation* dialog pops up, select a transformation you feel fits the data well. I'd recommend *NAD83 to WGS 84 (43)* because the table of options says this one has a high accuracy and is intended for California north of 36.5 degrees north, which fits our data. 13 | 14 | You can leave the *Data Source Manager* window open so we can add some more data. 15 | 16 | ## Vector 17 | ### Shapefiles 18 | Shapefiles are a very popular vector data format, so that's what we'll work with today, but geopackage is a good open format alternative (and has the advantage of being just one file). Let's load our shapefile data: 19 | 20 | 1. In the *Data Source Manager*, click on the *Vector* tab on the left. 21 | 1. In the *Source* section, click on the "..." and navigate to the folder containing your vector data. 22 | 1. Holding down the Ctrl (Windows) or Command (Mac) button on your keyboard while you click, select the *StreetCenterlines.shp*, *SeismicHazardZones.shp*, and *Shoreline.shp* (don't worry about the other files that make up a shapefile - QGIS will know to look for these when you specify the .shp file). Then click *Open*. 23 | 1. In the *Options* section, you can leave the default values as they are for this data. Make note of what options are there - the *ENCODING* section is particularly helpful if your attributes are written in a different character set than the default, UTF-8. 24 | 1. In the *Data Source Manager* click *Add*. If the *Select Transformation* dialog appears, pick a transformation that fits the data, such as *NAD83 to WGS 84 (43)*. If if the *Select Transformation* dialog doesn't appear, it means the projection of your dataset matched the projection of the project so you don't need a transformation. 25 | 26 | ### CSV Data 27 | It's pretty common to get point data in "CSV" file, especially if the spatial data is represented by latitude and longitude coordinates. CSV stands for Comma Separated Value. Typically this is tabular data where the edge of each cell of the table is indicated by a comma. Sometimes people use a different character instead of the comma such as a semicolon, tab, or pipe. The character used to indicate the edge of the cells is called the "delimiter". If a file has tabs as the delimeter, for example, you would call that file a "tab delimited" file. 28 | 29 | To load our .csv file: 30 | 31 | 1. In the *Data Source Manager*, click on the *Delimited Text* tab on the left. Notice that the icon is a comma. 32 | 1. Next to the *File Name* text box, click the "..." button, then navigate to your *Street_Tree_Map.csv* file and click *Open*. 33 | 1. In the *File format* section, we'll leave the default selection of *CSV (comma separated values)*, but if you had a file with a different delimiter, you could change the delimiter by using *Custom delimiters*. 34 | 1. In the *Records and Fields Options* section, make sure *First record has field names* is checked. If your data didn't have table headings, you would want to uncheck this box. You can also check *Detect field types*. 35 | 1. In the *Geometry definition* section is where we indicate what kind of geometry we have. For ours, select *Point coordinates* and in the *X field*, pick "Longitude", and for the *Y field* pick "Latitude". 36 | 1. For the *Geometry CRS*, click on the *Select CRS* button (it looks like a little globe wearing a cone-shaped hat). In the *Filter*, type 4326 to find and select *WGS 84*, then click *OK*. 37 | 1. Review the *Sample data* section to preview how the attribute table will look. This is a good way to find out if you picked the right delimiter or if your data has some formatting issues (such as someone put commas in a text field and use commas as the delimiter). 38 | 1. If everything looks good, click *Add*. This is a reasonably large file, so be patient as it loads. 39 | 1. Close the *Data Source Manager* window because we are done adding data. 40 | -------------------------------------------------------------------------------- /08_Saving-Project-Files.Rmd: -------------------------------------------------------------------------------- 1 | # Saving Project Files 2 | Now that we've added data to our project, let's save it so we can come back to it later. 3 | 4 | 1. Click on the blue floppy disk icon (or from the *File* menu, select *Save*). 5 | 1. Navigate to where you want to save your project file. 6 | 1. In the *File name* box, type the name you would like your file to have. Give it a descriptive name so you'll remember what the file was for. 7 | 1. Click *Save*. 8 | 9 | Note for ESRI users: QGIS' .qgs and .qgz file are analogous to ArcMap's .mxd files. 10 | -------------------------------------------------------------------------------- /09_Working-with-Raster-Data.Rmd: -------------------------------------------------------------------------------- 1 | # Working with Raster Data 2 | 3 | Let's start by looking at some Raster data. We'll work with a digital elevation model (DEM) for San Francisco. A DEM is a raster in which each cell in the grid contains the elevation at that location. 4 | 5 | For now, let's turn off all of the layers in the *Layers* panel except for the *DEM_SF* layer by unchecking the boxes next to the layer names in the *Layers* Panel on the left side of your screen. 6 | 7 | Now you should see a gray scale image that roughly looks like the San Francisco peninsula. This is a Digital Elevation Model (DEM). Each cell in the raster contains a number representing the elevation at that location. 8 | 9 | Let's style this data: 10 | 11 | 1. Open the *Layer Styling* Panel by clicking on the *View* menu, then *Panels*, and checking the box for *Layer Styling*. 12 | 1. At the top of the panel that opens, select the DEM from the drop-down menu, or highlight that layer in the *Layers* panel. 13 | 1. Click on the *Symbology* tab on the left side (the icon looks like a paintbrush painting a rainbow). 14 | 1. For the *Render type* drop down (just below where you selected the layer), select *Singleband pseudocolor*. 15 | 1. Expand the *Min/Max Value Settings" area. In the *Statistics extent* drop-down, select *Whole raster*. For *Accuracy*, select *Actual (slower)*. 16 | 1. For the *Color ramp*, select *Create new color ramp* 17 | 1. Select *Catalog: cpt-city* from the drop down and click *Ok* 18 | 1. Pick *Topography* from the options on the left. 19 | 1. Pick *cd-a* for our gradient. Or select another scheme you think will work well for representing topography. Click *Ok*. 20 | 1. You'll see that the color ramp in the Layers Properties has updated. Click *Apply* to see what it looks like with our data or check the box next to *Live update* to apply changes as you make them. 21 | 22 | Chances are, this isn't exactly what you want and we can make some more improvements to see the shoreline and topography better. 23 | 24 | 1. In the *Layer Styling* panel again, for the *Interpolation* drop-down, select *Discrete*. 25 | 1. For the *Mode*, select *Equal Interval*. For *Classes*, input 10. 26 | 1. Change the *Value* number for the lowest category to 0 by double clicking on the default number and typing in the number 0 and pressing enter on your keyboard. If it doesn't automatically update, click *Apply* in the Layer Properties to see how it looks. You should see a more defined coastline that looks more like the docks around the city. 27 | 1. Continue to adjust the colors and/or breaks until you are happy with how it looks, then click *Ok*. (See the image below for one option.) 28 | 29 | I chose breaks at 0, 50, 75, 125, 175, 225, 275, 325, 350, and inf. 30 | 31 | In the event that you need to reset your classes to start over with modifying your classes, click the *Classify* button again. 32 | 33 | Note: In case you need to know, in our DEM data, the Min value is -9.36748 and the Max value is 399.963. You can reset this if you need to by selecting the *Min/max* radio button in the *Min/Max Value Settings* again. 34 | 35 | ![alt text](./images/Raster_LayerProperties.PNG "Layer properties for DEM") 36 | 37 | ![alt text](./images/Raster_DEM.PNG "Digital Elevation Model with a continuous color ramp") 38 | 39 | Now you've had a first look at how to style raster data for better viewer understanding. There is a wide variety of analysis and data processing that we can't learn today in our limited time. For more on working with raster data, see the [Raster Module of the QGIS Training Manual](https://docs.qgis.org/3.10/en/docs/user_manual/working_with_raster/index.html). 40 | -------------------------------------------------------------------------------- /10_Working-with-Vector-Data.Rmd: -------------------------------------------------------------------------------- 1 | # Working with Vector Data 2 | Now let's learn about working with vector data. In the *Layers* panel, turn off the DEM and turn on the streets layer. Notice that the streets are represented with lines. 3 | 4 | ## Single Symbol Styling 5 | Your street layer is loaded by default with a randomly selected color. Let's start our vector work by changing the styling of our streets to something more appropriate. 6 | 7 | 1. If your *Layer Styling* panel isn't still open, reopen it from the *View* menu by selecting *Panels* and then checking the box next to *Layer Styling*. 8 | 1. Make sure the drop-down to select the layers to work with is set to your streets data. 9 | 1. Leave the drop-down for selecting the method of symbolizing the data on *Single symbol*. We'll look at some of the other options later. 10 | 1. In the white box near the top, you'll see the word *Line* and *Simple line*. Click on the words *Simple line*. This will let us access lots of options for how to symbolize this set of lines. 11 | 1. In the *Color* box, click on the colored box to open the color selection dialog. 12 | 1. The color selection dialog has multiple options for how you select your colors. Take a minute to get a feel for how each of these works. I find each of these has advantages for certain situations. 13 | 1. Choose a color that you think represents roads well. I used a dark gray. You can enter *#666666* into the *HTML notation* box to use the same color if you'd like. Click *Apply* to apply the change. 14 | 1. Once you've picked a color, use the *Go Back* button to return to the main dialog. ![alt text](./images/Tool_GoBack.PNG "Go Back button.") 15 | 16 | ## Attributes tables 17 | Vector data is typically made of up of two parts: (1) the points, lines, or polygons that represent real-world entities called the **geometry** and (2) information about those entities, typically in table format, called **attributes**. 18 | 19 | Let's look at the attribute table for our streets: 20 | 21 | 1. In the *Layers* panel, right click on the streets layer and select *Open Attribute Table*. 22 | 1. Scroll to the right to explore the information in this table. We have information like the name of the street, whether or not it's a one-way street, and the name of the neighborhood it's in. 23 | 1. Each row in this table is linked to a street in our data set. Click on the row number of any row. The program will automatically highlight this street in the map canvas HOWEVER, many of these streets are small so we might not see it right away. We can zoom to the selected row by clicking the *Zoom map to selected row* button. ![alt text](./images/Tool_ZoomToSelection.PNG "Zoom to selection tool.") 24 | 1. Minimize the attribute table, and use the zoom in and out tools ![alt text](./images/Tool_ZoomInOut.PNG "Zoom in and out tools.") to adjust your view. The *Pan* tool can also help navigate. ![alt text](./images/Tool_Pan.PNG "Pan tool.") 25 | 1. You can clear the selection (make nothing selected) with the *Deselect Features* tool. ![alt text](./images/Tool_Deselect.PNG "Deselect tool") This tool just makes nothing selected, it doesn't delete data. 26 | 1. If you'd like to zoom to see all of the streets data, right click on the streets layer in the *Layers* panel and select *Zoom to layer(s)*. 27 | 28 | ## Select by attributes 29 | Selecting streets by hand is helpful, but depending on what we want to do, we might want an automated way to select the streets that we want to highlight. Let's investigate the *classcode* column. 30 | 31 | 1. In the attribute table for the streets layer, click on the *Select features using an expression* ![alt text](./images/Tool_SelectFeaturesUsingExpression.png) to open the *Select by Expression* tool. 32 | 1. We'll build an expression in the white box on the left side of the tool. In the center panel, expand the *Fields and Values* list. 33 | 1. Double click the *classcode* field to add it to the expression box on the left. 34 | 1. Then click the *=* button below the white dialog box to add an equal sign to the equation. 35 | 1. We can also click the *All Unique* button on the right to see all of the values that are found in the *classcode* column. I don't recommend using this option on continuous data; it's best for categorical data with a relatively small number of unique values. Click *'1'* in the list. Note that while we think of the items in this list as numbers, this column was likely defined as text, so this is why the numbers are wrapped in quotes. If we tried to use the number without the quotes, the GIS would find no matches because it would be looking for the number 1, not the text 1. Your expression should look like *"classcode" = '1'*. If QGIS read the *classcode* field as numbers, your expression should look like this: *"classcode" = 1* **NOTE: in QGIS 3.24, both options work.** 36 | 1. Click *Select features*. You'll notice that rows in the attribute table and lines on the map have been highlighted. What do you think a *classcode* of 1 means? 37 | 38 | **Challenge:** Try changing the expression to select different *classcode* categories. What do you think each category means? 39 | 40 | You can review the metadata/data dictionary on the About tab on the [data's homepage](https://data.sfgov.org/Geographic-Locations-and-Boundaries/San-Francisco-Basemap-Street-Centerlines). 1 Freeways; 2 Highways; 3 Major Streets; 4 Secondary Streets; 5 Local Streets; 6 Freeway Ramps; 0 Private Streets 41 | 42 | Selecting our data based on the attribute information is a good way to explore and understand data, but it is only a temporary way to highlight data. To use differences in attribute data in a map, we'll need to work with the layer symbology. 43 | 44 | 45 | ## Symbolizing layers by attributes 46 | 47 | ### Classifying Attributes 48 | Let's style this street data based on the kind of street. This will be a good visualization for giving context to some of the other data we have to work with. 49 | 50 | 1. Clear out any selections you may still have with the *Deselect Features* tool. ![alt text](./images/Tool_Deselect.PNG "Deselect tool") 51 | 1. In the *Layer Styling* panel, pick the street data from the dropdown list so we are working with this data. 52 | 1. Instead of *Single symbol*, pick *Categorized* from the dropdown menu near the top of the dialog. (Don't worry if the data disappears.) 53 | 1. For the *Value* dropdown, pick the *classcode* column so we can use this data for our categories. 54 | 1. Click the *Classify* button to see our categories. 55 | 56 | Ok! We can see each road classified by it's *classcode*. The colors will default to *Random Colors* for the palette. We can change the colors to meet our needs and communicate better. Let's use the width of the line rather than color to indicate the type of road. 57 | 58 | 1. You can uncheck the last row in the list of symbols. This category is for data with no *classcode*. 59 | 1. Select all of the symbol levels in the list of symbols by selecting the first row and then the last row while holding down the shift key. 60 | 1. Right click on the highlighted symbols and choose *Change Color*. 61 | 1. Pick a gray color. I used *HTML code* #a0a0a0. Click *Apply*. All of the roads will now be the same gray color. Remember that our goal is to vary the widths of the lines based on the type of road. 62 | 1. Click the *Go Back* button ![alt text](./images/Tool_GoBack.PNG) to return to the main window. 63 | 64 | To guide our work, let's change the text of the legend. For each legend item, double click on the label and change the number label to the following text: 65 | 66 | Value | Legend 67 | --- | --- 68 | 0| Private Streets 69 | 1| Freeways 70 | 2| Highways 71 | 3| Major Streets 72 | 4| Secondary Streets 73 | 5| Local Streets 74 | 6| Freeway Ramps 75 | 76 | Next we'll change the line width (also known as the line weight). 77 | 78 | 1. For each row in the legend, double click on the line symbol to open the *Symbol Selector* dialog. 79 | 1. Change the *Width* to match the Line Weight (use *points* as the units) in the table below. 80 | 81 | Value | Legend | Line Weight (points) 82 | --- | --- | --- 83 | 0| Private Streets | 0.26 84 | 1| Freeways | 2.0 85 | 2| Highways | 2.0 86 | 3| Major Streets | 1.0 87 | 4| Secondary Streets | 0.26 88 | 5| Local Streets | 0.26 89 | 6| Freeway Ramps | 0.5 90 | 91 | Note that points is the unit of measure for the size of a font. You're probably familiar with the size off 12 point font from word processing. It might also be helpful to know that 72 point font is equivalent to one inch high. 92 | 93 | ![alt text](./images/Vector_ClassifiedRoads.PNG "Classified Roads") 94 | 95 | ### Rule-Based Symbology 96 | We've just seen how we can use an automated classification method to change the symbology of data. Now let's look at how we can build rules based on attributes to create tailored symbology. The street tree layer has many, many tree locations - too many to make a useful map of all the trees so we'll need to select a subset of the data to include. 97 | 98 | Here's a real-world scenario for us to think about: in recent years, a number of non-native bark beetles have been introduced to California. These beetles can damage and kill trees. Let's make a map of one species of tree that might be affected, Canary Pine (*Pinus canariensis*), to investigate their spatial distribution and think about where you might want to concentrate monitoring efforts. The [UC IPM site](http://ipm.ucanr.edu/PMG/PESTNOTES/pn7421.html) has more information about bark beetle species and tree species affected by them. 99 | 100 | Let's look at rule-based symbology: 101 | 102 | 1. In the *Layer Styling* panel, select the street tree data. 103 | 1. Select *Rule-Based* from the drop-down menu for the symbology method. 104 | 1. Click the green + button (near the bottom) to add a rule. 105 | 1. In the *Label* box, type "Canary Pine". This will give our new rule a name we can easily understand. 106 | 1. Next to the *Filter* box, click on the *Expression* button ![alt text](./images/Tool_ExpressionButton.PNG "Expression button") to open the *Expression String Builder* dialog. This should look familiar - it's very similar to how we selected rows by their attributes earlier. 107 | 1. Add the *qSpecies* field to the expression window from the *Fields & Values* list. 108 | 1. Next, type the word *LIKE*. *LIKE* is a comparison operator for strings. You might think of this as = for text. 109 | 1. Finally, we need to say which species we want. You may have noticed that the species column typically contains a long string with several pieces of information. We can search for a portion of the text by using a wildcard character to match part of the string in the column. Type *'%Pinus canariensis%'* after *LIKE* in your expression. The single quotes indicate that the words we just typed are a string (and not another variable or field from the attribute table) and the *%* means "it doesn't matter what text is here". So the program will search for rows that contain the sting *Pinus canariensis*, regardless of what else the column says. 110 | 1. Your expression string should look like this: *"qSpecies" LIKE '%Pinus canariensis%'* Click *OK* when you are done. 111 | 1. In the *Rule Editing* dialog, you can also make changes to the color, size, and shape. 112 | 1. Click the back button when you are done. ![alt text](./images/Tool_GoBack.PNG "Go Back button.") 113 | 1. You may need to uncheck the box next to the *(no filter)* rule to see the results of our *Canary Pine* filter. 114 | 115 | Based on where the Canary Pines are in the city, where would you want to focus your monitoring efforts? Are there places you think might be impacted more quickly if a bark beetle came to the city? 116 | 117 | ![alt text](./images/Vector_CanaryPine.PNG "Map of canary pines.") 118 | 119 | 120 | **Challenge:** Choose another species to add to your map. Add another rule-based classification with a different map symbol. 121 | 122 | To learn more about processing and analyzing vector data, see the [QGIS Training Manual's Module on Vector Analysis](https://docs.qgis.org/2.18/en/docs/training_manual/vector_analysis/index.html). To learn about creating vector data, see the [QGIS Training Manual's Module on Creating Vector Data](https://docs.qgis.org/2.18/en/docs/training_manual/create_vector_data/index.html). 123 | -------------------------------------------------------------------------------- /11_Making-a-map-with-the-print-composer.Rmd: -------------------------------------------------------------------------------- 1 | # Composing a Map 2 | One common task in any desktop GIS is to produce a map to include in a document or presentation. In QGIS we create maps in the *Print Composer*. Let's make a finished map of our tree locations. 3 | 4 | ## Prepare your Layers 5 | The first thing we need to do is add all the layers we want in our finished map to our Map Canvas in the main QGIS window. Turn on your trees and roads layers and add in any other data you think will help support the tree locations such as the shoreline data. 6 | 7 | We also need to style our layers here as well. Take some time to work with your layer symbology. Make choices that you feel help communicate the data well. Simple or plain choices are often better than complicated or fancy symbology. For example, you could use a tree-shaped icon to represent your trees, but this would probably make a rather busy map. A simple circle icon might be better. 8 | 9 | Just get to a point where you have a solid draft. We can always make changes later if we decide we need to adjust. 10 | 11 | ## Working in the Print Composer 12 | Once you've added all the layers you need to your Map Canvas and styled them in a way you like, we can start composing our map. 13 | 14 | 1. Open the *Print Composer* by clicking on the *Project* menu and choosing *New Print Layout*. 15 | 1. Give your new Print Layout a name. I'll call mine "Canary Pine Locations". You can have multiple map layouts using the data in this map document, so pick a name that will remind you of the purpose of this map. Click *OK* when you've picked a name. The *Print Composer* will now open. 16 | 1. The white box in the middle of the window is where you will compose your map. Right click in this white space and choose *Page Properties* from the menu that appears. The menu on the right will now let us adjust the page size and orientation. Let's use size *Letter* and *Landscape* orientation for this map. 17 | 1. Add a map to your layout by clicking the *Add Map* tool and then clicking and dragging on your map layout. ![alt text](./images/Tool_AddMap.PNG "Add Map tool.") You can adjust the size so don't worry if it's not perfect at first. The *Move Item* tool moves and adjusts items in your map. ![alt text](./images/Tool_MoveItem.PNG "Move Item tool.") 18 | 1. Adjust the scale of your map by selecting your map. In the *Item Properties* on the right, adjust the scale number to zoom in or out of your map data. I used a scale of about 40,000. 19 | 1. Add other items to your map as needed: title, legend, scale bar, etc. The buttons for these items are on the left side of the window, or on the *Add Items* menu at the top of the window. The item properties for each item you add are available by selecting the item and editing the properties in the pane on the right side of the *Print Composer* window. 20 | 1. When you've made a layout you like, you can export the map to a variety of formats. On the *Layout* menu, select *Export as Image*. Navigate to where you would like to save the image, name the file, and choose the type of image. Let's pick .png for this image. Click *Save*. 21 | 1. Make any adjustments to the image parameters you would like. Click *Save* to finish the process. 22 | 1. When you're finished exporting your map, you can close the *Print Composer* window. 23 | 24 | ![alt text](./images/Map_CanaryPineLocations.png "Finished map of canary pine locations.") 25 | 26 | Your map might look something like this. I added an *Outer Glow* in the *Draw Effects* menu to the Shoreline data to achieve the fading blue outline. 27 | 28 | You may want to add background layers such as coastlines or land masses from data sources like: 29 | 30 | * [Natural Earth Data](http://naturalearthdata.com/) 31 | * [Project Linework](http://www.projectlinework.org/) 32 | * [GADM](https://gadm.org/) 33 | -------------------------------------------------------------------------------- /12_Select-by-Location.Rmd: -------------------------------------------------------------------------------- 1 | # Select by Location 2 | So far, we've seen analysis that relies mainly on cartographic choices. There are many other kinds of analysis we could do. Let's look at an example where we need to undertand the spatial relationship between two different layers: identify large trees inside areas designated as earthquake hazard zones. 3 | 4 | One way to measure the size of a tree is by measuring the width of the trunk, about 4 feet off the ground. This measurement is called the *Diameter at Breast Height* or *DBH* for short. The street tree data has a column in the attribute table called DBH so we can use this to identify the larger trees. 5 | 6 | First, let's use the *Select By Attributes* process we learned earlier today to select trees with a DBH of 36 inches or larger. A quick reminder of the process: open the attribute table and use the query tool to write a query. *Hint:* We can write "greater than or equal to" as *>=* in the selection interface. 7 | 8 | Because the street tree dataset is so large, let's save our large tree selection as a new file to make processes run faster with this subset of the data. Now that you have the trees with a DBH of 3 feet or more selected: 9 | 10 | 1. Right click on the layer in the *Layers Panel*. 11 | 1. Select *Export* from the menu that pops up and then *Save selected features as*. 12 | 1. For the format, choose *ESRI Shapefile*, or any of the vector formats you prefer (I personally like geojson because it's one text file, but geopackage is also pretty handy... KML is only a good choice if you're going to use the file in a Google application). 13 | 1. Next to the *File Name* box, click the "..." button to pick a folder to save the file in and give the file a name. I called my "LargeTrees". Click *Save* when you're done. 14 | 1. Make sure the *Save only Selected Features* and *Add saved file to map* boxes are checked, then click *OK*. 15 | 1. You should have a file with only the features we had previously selected. 16 | 1. You can uncheck the full street trees layer in the *Layers Panel*. 17 | 18 | Now we can find which of the large trees are inside seismic hazard zones: 19 | 20 | 1. On the *Vector* menu, select *Research Tools* and then *Select by Location* to open the *Select by Location* tool. 21 | 1. Select features from *Large Trees*, that *Intersect* the *Seismic Hazards* layer and create a new selection. 22 | 1. Click *Run*. 23 | 24 | The large trees that fall inside the seismic hazard zones are now selected. But how do we record this information in a way that we can keep and use in a map? Let's add a column with this information in our attribute table: 25 | 26 | 1. Open the attribute table for the large trees layer. 27 | 1. Click on the *Field Calculator* button. ![alt text](./images/Tool_FieldCalculator.png) 28 | 1. Check the box next to "Only update selected features" at the top of the window. 29 | 1. Name your new field "EarthQZone" so we remember what information it contains. 30 | 1. For the field type, select *Text*. 31 | 1. In the expression field, type *'yes'*. This will add the word "yes" to the EarthQZone column where the record is currently selected. 32 | 1. Click *OK* and then inspect your attribute table to see the new column. 33 | 1. When we started the Field Calculator, QGIS automatically turned on editing for our shapefile. Save the edits we made by clicking the Save Edits button (blue floppy disk on the attribute table) and turn off the editing mode by clicking the Toggle Editing Mode button (yellow pencil). 34 | 1. You can now clear your selection because the attribute information now contains the information we need. 35 | 36 | Use your new symbology skills to syle this layer to show which large trees are in seismic hazard zones. Hint: Rule-based or Categorized symbology are good options! 37 | 38 | ![alt text](./images/Map_BigTreesInZone.PNG "Map of large trees in seismic hazard zones.") 39 | -------------------------------------------------------------------------------- /13_Further-Reading-Resources.Rmd: -------------------------------------------------------------------------------- 1 | # Additional Resources 2 | Below are some additional resource to help you along your future learning journey: 3 | 4 | * [QGIS Documentation](https://qgis.org/en/docs/index.html): includes the User Guide, Training Manual, and Gentle Introduction to GIS 5 | * [Open Source Geospatial Foundation](https://www.osgeo.org/): includes news and information about projects, conferences, and community 6 | * [DataLab's Cartography for Map Figures in Academic Journals & Books Workshop](https://github.com/MicheleTobias/Workshop-Cartography-Journal-Figures) 7 | * [DataLab's List of Spatial Workshops](https://ucdavisdatalab.github.io/workshop_index/#gis) 8 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Workshop: Intro to Desktop GIS with QGIS 2 | 3 | _[UC Davis DataLab](https://datalab.ucdavis.edu/)_ 4 | _Spring 2023_ 5 | _Instructor: Michele Tobias <>_ 6 | _Maintainer: Michele Tobias <>_ 7 | 8 | * [Reader](https://ucdavisdatalab.github.io/YOUR_REPOSITORY/) 9 | * [Event Page](https://datalab.ucdavis.edu/eventscalendar/YOUR_EVENT/) 10 | 11 | # Workshop Description 12 | This introductory-level workshop will focus upon the fundamental concepts and skills needed to explore and analyze data using Geographic Information Systems (GIS) software with examples using the QGIS platform. 13 | 14 | ## Prerequisites 15 | No prior experience with QGIS or other GIS software is needed, though attendees should be comfortable learning new computer applications, working with the basics of spreadsheets, and managing, organizing, and moving computer files on their operating system. 16 | 17 | ## Learning Objectives 18 | By the end of this workshop, you will be able to: 19 | 20 | + Define GIS and geospatial concepts and terminology 21 | + Know the difference between vector and raster data types 22 | + Properly connect and add data to a QGIS project 23 | + Know where to find the attributes of your data in QGIS 24 | + Perform basic selections and queries in QGIS 25 | + Symbolize data by attributes 26 | + Assemble a basic map for export 27 | 28 | 29 | # Contributing 30 | 31 | The course reader is a live webpage, hosted through GitHub, where you can enter 32 | curriculum content and post it to a public-facing site for learners. 33 | 34 | To make alterations to the reader: 35 | 36 | 1. Check in with the reader's current maintainer and notify them about your 37 | intended changes. Maintainers might ask you to open an issue, use pull 38 | requests, tag your commits with versions, etc. 39 | 40 | 2. Run `git pull`, or if it's your first time contributing, see 41 | [Setup](#setup). 42 | 43 | 3. Edit an existing chapter file or create a new one. Chapter files are R 44 | Markdown files (`.Rmd`) at the top level of the repo. Enter your text, 45 | code, and other information directly into the file. Make sure your file: 46 | 47 | - Follows the naming scheme `##_topic-of-chapter.Rmd` (the only exception 48 | is `index.Rmd`, which contains the reader's front page). 49 | - Begins with a first-level header (like `# This`). This will be the title 50 | of your chapter. Subsequent section headers should be second-level 51 | headers (like `## This`) or below. 52 | - Uses caching for resource-intensive code (see [Caching](#caching)). 53 | 54 | Put any supporting resources in `data/` or `img/`. For large files, see 55 | [Large Files](#large-files). You do not need to 56 | add resources generated by your R code (such as plots). The knit step saves 57 | these in `docs/` automatically. 58 | 59 | 4. Run `knit.R` to regenerate the HTML files in the `docs/`. You can do this 60 | in the shell with `./knit.R` or in R with `source("knit.R")`. 61 | 62 | 5. Run `renv::snapshot()` in an R session at the top level of the repo to 63 | automatically add any packages your code uses to the project package 64 | library. 65 | 66 | 6. When you're finished, `git add`: 67 | - Any files you added or edited directly, including in `data/` and `img/` 68 | - `docs/` (all of it) 69 | - `_bookdown_files/` (contains the **knitr** cache) 70 | * `renv.lock` (contains the **renv** package list) 71 | 74 | 75 | Then `git commit` and `git push`. The live web page will update 76 | automatically after 1-10 minutes. 77 | 78 | 79 | ### Caching 80 | 81 | If one of your code chunks takes a lot of time or memory to run, consider 82 | caching the result, so the chunk won't run every time someone knits the 83 | reader. To cache a code chunk, add `cache=TRUE` in the chunk header. It's 84 | best practice to label cached chunks, like so: 85 | 86 | ```` 87 | ```{r YOUR_CHUNK_NAME, cache=TRUE} 88 | # Your code... 89 | ``` 90 | ```` 91 | 92 | Cached files are stored in the `_bookdown_files/` directory. If you ever want 93 | to clear the cache, you can delete this directory (or its subdirectories). 94 | The cache will be rebuilt the next time you knit the reader. 95 | 96 | Beware that caching doesn't work with some packages, especially packages that 97 | use external libraries. Because of this, it's best to leave caching off for 98 | code chunks that are not resource-intensive. 99 | 100 | 101 | 126 | 127 | ### Github Actions 128 | 129 | GitHub Actions can be set up to automatically render your reader when you push 130 | new content to a repo. If you would like to use this function, download the 131 | materials in [datalab-dev/utilities/render_bookdown_site][render-site] and 132 | follow the instructions there. 133 | 134 | [render-site]: https://github.com/datalab-dev/utilities/tree/main/render_bookdown_site 135 | 136 | ## Setup 137 | 138 | 139 | 156 | 157 | 158 | ### R Packages 159 | 160 | This repo uses [**renv**](https://rstudio.github.io/renv/) for package 161 | management. Install **renv** according to the installation instructions on 162 | their website. 163 | 164 | Then open an R session at the top level of the repo and run: 165 | 166 | ```r 167 | renv::restore() 168 | ``` 169 | 170 | This will download and install the correct versions of all the required 171 | packages to **renv**'s package library. This is separate from your global R 172 | package library and will not interfere with other versions of packages you have 173 | installed. 174 | 175 | [Back to Top](#top) 176 | -------------------------------------------------------------------------------- /_bookdown.yml: -------------------------------------------------------------------------------- 1 | delete_merged_file: true 2 | new_session: true 3 | output_dir: "docs" 4 | -------------------------------------------------------------------------------- /_main.log: -------------------------------------------------------------------------------- 1 | This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 21.1) (preloaded format=pdflatex 2021.2.10) 15 MAY 2023 14:49 2 | entering extended mode 3 | **./_main.tex 4 | (_main.tex 5 | LaTeX2e <2020-10-01> patch level 4 6 | L3 programming layer <2021-01-09> xparse <2020-03-03> (C:\Users\mmtobias\AppDat 7 | a\Local\Programs\MiKTeX\tex/latex/base\article.cls 8 | Document Class: article 2020/04/10 v1.4m Standard LaTeX document class 9 | (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo 10 | File: size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option) 11 | ) 12 | \c@part=\count177 13 | \c@section=\count178 14 | \c@subsection=\count179 15 | \c@subsubsection=\count180 16 | \c@paragraph=\count181 17 | \c@subparagraph=\count182 18 | \c@figure=\count183 19 | \c@table=\count184 20 | \abovecaptionskip=\skip47 21 | \belowcaptionskip=\skip48 22 | \bibindent=\dimen138 23 | ) (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsmath.st 24 | y 25 | Package: amsmath 2020/09/23 v2.17i AMS math features 26 | \@mathmargin=\skip49 27 | For additional information on amsmath, use the `?' option. 28 | (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amstext.sty 29 | Package: amstext 2000/06/29 v2.01 AMS text 30 | (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsgen.sty 31 | File: amsgen.sty 1999/11/30 v2.0 generic functions 32 | \@emptytoks=\toks15 33 | \ex@=\dimen139 34 | )) (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsbsy.st 35 | y 36 | Package: amsbsy 1999/11/29 v1.2d Bold Symbols 37 | \pmbraise@=\dimen140 38 | ) (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsopn.sty 39 | Package: amsopn 2016/03/08 v2.02 operator names 40 | ) 41 | \inf@bad=\count185 42 | LaTeX Info: Redefining \frac on input line 234. 43 | \uproot@=\count186 44 | \leftroot@=\count187 45 | LaTeX Info: Redefining \overline on input line 399. 46 | \classnum@=\count188 47 | \DOTSCASE@=\count189 48 | LaTeX Info: Redefining \ldots on input line 496. 49 | LaTeX Info: Redefining \dots on input line 499. 50 | LaTeX Info: Redefining \cdots on input line 620. 51 | \Mathstrutbox@=\box47 52 | \strutbox@=\box48 53 | \big@size=\dimen141 54 | LaTeX Font Info: Redeclaring font encoding OML on input line 743. 55 | LaTeX Font Info: Redeclaring font encoding OMS on input line 744. 56 | \macc@depth=\count190 57 | \c@MaxMatrixCols=\count191 58 | \dotsspace@=\muskip16 59 | \c@parentequation=\count192 60 | \dspbrk@lvl=\count193 61 | \tag@help=\toks16 62 | \row@=\count194 63 | \column@=\count195 64 | \maxfields@=\count196 65 | \andhelp@=\toks17 66 | \eqnshift@=\dimen142 67 | \alignsep@=\dimen143 68 | \tagshift@=\dimen144 69 | \tagwidth@=\dimen145 70 | \totwidth@=\dimen146 71 | \lineht@=\dimen147 72 | \@envbody=\toks18 73 | \multlinegap=\skip50 74 | \multlinetaggap=\skip51 75 | \mathdisplay@stack=\toks19 76 | LaTeX Info: Redefining \[ on input line 2923. 77 | LaTeX Info: Redefining \] on input line 2924. 78 | ) 79 | (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\amssymb.sty 80 | Package: amssymb 2013/01/14 v3.01 AMS font symbols 81 | 82 | (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\amsfonts.st 83 | y 84 | Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support 85 | \symAMSa=\mathgroup4 86 | \symAMSb=\mathgroup5 87 | LaTeX Font Info: Redeclaring math symbol \hbar on input line 98. 88 | LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold' 89 | (Font) U/euf/m/n --> U/euf/b/n on input line 106. 90 | )) (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/lm\lmodern.sty 91 | Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts 92 | LaTeX Font Info: Overwriting symbol font `operators' in version `normal' 93 | (Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22. 94 | LaTeX Font Info: Overwriting symbol font `letters' in version `normal' 95 | (Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23. 96 | LaTeX Font Info: Overwriting symbol font `symbols' in version `normal' 97 | (Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24. 98 | LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal' 99 | (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25. 100 | LaTeX Font Info: Overwriting symbol font `operators' in version `bold' 101 | (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26. 102 | LaTeX Font Info: Overwriting symbol font `letters' in version `bold' 103 | (Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27. 104 | LaTeX Font Info: Overwriting symbol font `symbols' in version `bold' 105 | (Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28. 106 | LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold' 107 | (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29. 108 | LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' 109 | (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31. 110 | LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' 111 | (Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32. 112 | LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' 113 | (Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33. 114 | LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' 115 | (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34. 116 | LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold' 117 | (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35. 118 | LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' 119 | (Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36. 120 | LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' 121 | (Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37. 122 | LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' 123 | (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38. 124 | ) (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty 125 | Package: iftex 2020/03/06 v1.0d TeX engine tests 126 | ) (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/base\fontenc.sty 127 | Package: fontenc 2020/08/10 v2.0s Standard LaTeX package 128 | LaTeX Font Info: Trying to load font information for T1+lmr on input line 11 129 | 2. 130 | (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/lm\t1lmr.fd 131 | File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern 132 | )) (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/base\inputenc.sty 133 | Package: inputenc 2020/08/01 v1.3d Input encoding file 134 | \inpenc@prehook=\toks20 135 | \inpenc@posthook=\toks21 136 | ) (C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\tex/latex/base\textcomp.sty 137 | Package: textcomp 2020/02/02 v2.0n Standard LaTeX package 138 | ) 139 | 140 | ! Sorry, but C:\Users\mmtobias\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe did not succeed. 141 | 142 | ! The log file hopefully contains the information to get MiKTeX going again: 143 | 144 | ! C:\Users\mmtobias\AppData\Local\MiKTeX\miktex\log\pdflatex.log 145 | -------------------------------------------------------------------------------- /_main.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/_main.rds -------------------------------------------------------------------------------- /assessment/instructions.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | pdf_document: 4 | highlight: tango 5 | urlcolor: blue 6 | --- 7 | 8 | 16 | 17 | 18 | \raggedright 19 | 20 | 21 | ```{=latex} 22 | \definecolor{codegray}{gray}{0.96} 23 | \let\textttOrig\texttt 24 | \renewcommand{\texttt}[1]{\textttOrig{\colorbox{codegray}{#1}}} 25 | ``` 26 | 27 | Assessment: WORKSHOP TITLE 28 | ========================== 29 | 30 | DESCRIPTION 31 | 32 | Links 33 | ----- 34 | 35 | + [GradPathways Badge](link) 36 | + [Event page](link) 37 | + [Workshop reader](link) 38 | 39 | 40 | 41 | Environment Setup 42 | ----------------- 43 | 44 | Rubric 45 | ------ 46 | 47 | 48 | 49 | 1. Working code: were you able to produce successful script for each prompt? 50 | 2. Understanding your actions: can you explain what your actions do and why you 51 | implemented them? 52 | 3. Critical reflection: do your short answers provide context (conceptual, 53 | domain-specific, etc.) for your actions? 54 | 55 | 56 | \pagebreak 57 | 58 | Prompts 59 | ------- 60 | 61 | 1. PROMPT ONE... 62 | 63 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/.nojekyll -------------------------------------------------------------------------------- /docs/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Page not found | Intro to Desktop GIS with QGIS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 | 71 | 136 | 137 |
138 |
139 | 144 | 145 |
146 |
147 | 148 |
149 |
150 |

Page not found

151 |

The page you requested cannot be found (perhaps it was moved or renamed).

152 |

You may want to try searching to find the page's new location, or use 153 | the table of contents to find the page you are looking for.

154 |
155 |
156 | 157 |
158 |
159 |
160 | 161 | 162 |
163 |
164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 204 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /docs/QGIS_Workshop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/QGIS_Workshop.pdf -------------------------------------------------------------------------------- /docs/_main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/_main.pdf -------------------------------------------------------------------------------- /docs/additional-resources.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 Additional Resources | Intro to Desktop GIS with QGIS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 | 71 | 136 | 137 |
138 |
139 | 144 | 145 |
146 |
147 | 148 |
149 |
150 |

14 Additional Resources

151 |

Below are some additional resource to help you along your future learning journey:

152 | 158 | 159 |
160 |
161 | 162 |
163 |
164 |
165 | 166 | 167 |
168 |
169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 209 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /docs/download-data.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 6 Download Data | Intro to Desktop GIS with QGIS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 | 71 | 136 | 137 |
138 |
139 | 144 | 145 |
146 |
147 | 148 |
149 |
150 |

6 Download Data

151 |

In this workshop, we’ll be using the following data:

152 |
    153 |
  1. Digital Elevation Model (DEM) of San Francisco
  2. 154 |
  3. Streets
  4. 155 |
  5. Trees
  6. 156 |
  7. Seismic Hazard Zones
  8. 157 |
  9. City of San Francisco Boundary (shoreline)
  10. 158 |
159 |

You can download all of this data from this Box Folder Online. Use the Download button in the upper right corner of the screen to download a zipped file containing all of the workshop data (sometimes you’ll need to dismiss a message at the top of the screen before you can see the download button). Unzip the file to a location on your computer that you can find later.

160 | 161 |
162 |
163 | 164 |
165 |
166 |
167 | 168 | 169 |
170 |
171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 211 | 212 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /docs/images/Map_BigTreesInZone.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Map_BigTreesInZone.PNG -------------------------------------------------------------------------------- /docs/images/Map_CanaryPineLocations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Map_CanaryPineLocations.png -------------------------------------------------------------------------------- /docs/images/Raster_DEM.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Raster_DEM.PNG -------------------------------------------------------------------------------- /docs/images/Raster_LayerProperties.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Raster_LayerProperties.PNG -------------------------------------------------------------------------------- /docs/images/Tool_AddMap.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_AddMap.PNG -------------------------------------------------------------------------------- /docs/images/Tool_Deselect.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_Deselect.PNG -------------------------------------------------------------------------------- /docs/images/Tool_ExpressionButton.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_ExpressionButton.PNG -------------------------------------------------------------------------------- /docs/images/Tool_FieldCalculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_FieldCalculator.png -------------------------------------------------------------------------------- /docs/images/Tool_GoBack.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_GoBack.PNG -------------------------------------------------------------------------------- /docs/images/Tool_MoveItem.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_MoveItem.PNG -------------------------------------------------------------------------------- /docs/images/Tool_Pan.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_Pan.PNG -------------------------------------------------------------------------------- /docs/images/Tool_SelectFeaturesUsingExpression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_SelectFeaturesUsingExpression.png -------------------------------------------------------------------------------- /docs/images/Tool_ZoomInOut.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_ZoomInOut.PNG -------------------------------------------------------------------------------- /docs/images/Tool_ZoomToSelection.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Tool_ZoomToSelection.PNG -------------------------------------------------------------------------------- /docs/images/Vector_CanaryPine.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Vector_CanaryPine.PNG -------------------------------------------------------------------------------- /docs/images/Vector_ClassifiedRoads.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/Vector_ClassifiedRoads.PNG -------------------------------------------------------------------------------- /docs/images/geometries_data_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/images/geometries_data_types.png -------------------------------------------------------------------------------- /docs/introduction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 1 Introduction | Intro to Desktop GIS with QGIS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 | 71 | 136 | 137 |
138 |
139 | 144 | 145 |
146 |
147 | 148 |
149 |
150 |

1 Introduction

151 |

This tutorial uses QGIS 3.x to teach the basics of desktop mapping software for beginners with no previous mapping experience.

152 |

This workshop has been taught on multiple occasions, some of which have video recordings you can watch:

153 | 161 | 162 |
163 |
164 | 165 |
166 |
167 |
168 | 169 | 170 |
171 |
172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 212 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /docs/libs/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/libs/anchor-sections-1.1.0/anchor-sections-hash.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section::before {content: '#';font-size: 80%;} 3 | -------------------------------------------------------------------------------- /docs/libs/anchor-sections-1.1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | .hasAnchor:hover a.anchor-section {visibility: visible;} 4 | ul > li > .anchor-section {display: none;} 5 | -------------------------------------------------------------------------------- /docs/libs/anchor-sections-1.1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function () { 2 | // If section divs is used, we need to put the anchor in the child header 3 | const headers = document.querySelectorAll("div.hasAnchor.section[class*='level'] > :first-child") 4 | 5 | headers.forEach(function (x) { 6 | // Add to the header node 7 | if (!x.classList.contains('hasAnchor')) x.classList.add('hasAnchor') 8 | // Remove from the section or div created by Pandoc 9 | x.parentElement.classList.remove('hasAnchor') 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/css/fontawesome/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/docs/libs/gitbook-2.6.7/css/fontawesome/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/css/plugin-bookdown.css: -------------------------------------------------------------------------------- 1 | .book .book-header h1 { 2 | padding-left: 20px; 3 | padding-right: 20px; 4 | } 5 | .book .book-header.fixed { 6 | position: fixed; 7 | right: 0; 8 | top: 0; 9 | left: 0; 10 | border-bottom: 1px solid rgba(0,0,0,.07); 11 | } 12 | span.search-highlight { 13 | background-color: #ffff88; 14 | } 15 | @media (min-width: 600px) { 16 | .book.with-summary .book-header.fixed { 17 | left: 300px; 18 | } 19 | } 20 | @media (max-width: 1240px) { 21 | .book .book-body.fixed { 22 | top: 50px; 23 | } 24 | .book .book-body.fixed .body-inner { 25 | top: auto; 26 | } 27 | } 28 | @media (max-width: 600px) { 29 | .book.with-summary .book-header.fixed { 30 | left: calc(100% - 60px); 31 | min-width: 300px; 32 | } 33 | .book.with-summary .book-body { 34 | transform: none; 35 | left: calc(100% - 60px); 36 | min-width: 300px; 37 | } 38 | .book .book-body.fixed { 39 | top: 0; 40 | } 41 | } 42 | 43 | .book .book-body.fixed .body-inner { 44 | top: 50px; 45 | } 46 | .book .book-body .page-wrapper .page-inner section.normal sub, .book .book-body .page-wrapper .page-inner section.normal sup { 47 | font-size: 85%; 48 | } 49 | 50 | @media print { 51 | .book .book-summary, .book .book-body .book-header, .fa { 52 | display: none !important; 53 | } 54 | .book .book-body.fixed { 55 | left: 0px; 56 | } 57 | .book .book-body,.book .book-body .body-inner, .book.with-summary { 58 | overflow: visible !important; 59 | } 60 | } 61 | .kable_wrapper { 62 | border-spacing: 20px 0; 63 | border-collapse: separate; 64 | border: none; 65 | margin: auto; 66 | } 67 | .kable_wrapper > tbody > tr > td { 68 | vertical-align: top; 69 | } 70 | .book .book-body .page-wrapper .page-inner section.normal table tr.header { 71 | border-top-width: 2px; 72 | } 73 | .book .book-body .page-wrapper .page-inner section.normal table tr:last-child td { 74 | border-bottom-width: 2px; 75 | } 76 | .book .book-body .page-wrapper .page-inner section.normal table td, .book .book-body .page-wrapper .page-inner section.normal table th { 77 | border-left: none; 78 | border-right: none; 79 | } 80 | .book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr, .book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr > td { 81 | border-top: none; 82 | } 83 | .book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr:last-child > td { 84 | border-bottom: none; 85 | } 86 | 87 | div.theorem, div.lemma, div.corollary, div.proposition, div.conjecture { 88 | font-style: italic; 89 | } 90 | span.theorem, span.lemma, span.corollary, span.proposition, span.conjecture { 91 | font-style: normal; 92 | } 93 | div.proof>*:last-child:after { 94 | content: "\25a2"; 95 | float: right; 96 | } 97 | .header-section-number { 98 | padding-right: .5em; 99 | } 100 | #header .multi-author { 101 | margin: 0.5em 0 -0.5em 0; 102 | } 103 | #header .date { 104 | margin-top: 1.5em; 105 | } 106 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/css/plugin-clipboard.css: -------------------------------------------------------------------------------- 1 | div.sourceCode { 2 | position: relative; 3 | } 4 | 5 | .copy-to-clipboard-button { 6 | position: absolute; 7 | right: 0; 8 | top: 0; 9 | visibility: hidden; 10 | } 11 | 12 | .copy-to-clipboard-button:focus { 13 | outline: 0; 14 | } 15 | 16 | div.sourceCode:hover > .copy-to-clipboard-button { 17 | visibility: visible; 18 | } 19 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/css/plugin-fontsettings.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Theme 1 3 | */ 4 | .color-theme-1 .dropdown-menu { 5 | background-color: #111111; 6 | border-color: #7e888b; 7 | } 8 | .color-theme-1 .dropdown-menu .dropdown-caret .caret-inner { 9 | border-bottom: 9px solid #111111; 10 | } 11 | .color-theme-1 .dropdown-menu .buttons { 12 | border-color: #7e888b; 13 | } 14 | .color-theme-1 .dropdown-menu .button { 15 | color: #afa790; 16 | } 17 | .color-theme-1 .dropdown-menu .button:hover { 18 | color: #73553c; 19 | } 20 | /* 21 | * Theme 2 22 | */ 23 | .color-theme-2 .dropdown-menu { 24 | background-color: #2d3143; 25 | border-color: #272a3a; 26 | } 27 | .color-theme-2 .dropdown-menu .dropdown-caret .caret-inner { 28 | border-bottom: 9px solid #2d3143; 29 | } 30 | .color-theme-2 .dropdown-menu .buttons { 31 | border-color: #272a3a; 32 | } 33 | .color-theme-2 .dropdown-menu .button { 34 | color: #62677f; 35 | } 36 | .color-theme-2 .dropdown-menu .button:hover { 37 | color: #f4f4f5; 38 | } 39 | .book .book-header .font-settings .font-enlarge { 40 | line-height: 30px; 41 | font-size: 1.4em; 42 | } 43 | .book .book-header .font-settings .font-reduce { 44 | line-height: 30px; 45 | font-size: 1em; 46 | } 47 | 48 | /* sidebar transition background */ 49 | div.book.color-theme-1 { 50 | background: #f3eacb; 51 | } 52 | .book.color-theme-1 .book-body { 53 | color: #704214; 54 | background: #f3eacb; 55 | } 56 | .book.color-theme-1 .book-body .page-wrapper .page-inner section { 57 | background: #f3eacb; 58 | } 59 | 60 | /* sidebar transition background */ 61 | div.book.color-theme-2 { 62 | background: #1c1f2b; 63 | } 64 | 65 | .book.color-theme-2 .book-body { 66 | color: #bdcadb; 67 | background: #1c1f2b; 68 | } 69 | .book.color-theme-2 .book-body .page-wrapper .page-inner section { 70 | background: #1c1f2b; 71 | } 72 | .book.font-size-0 .book-body .page-inner section { 73 | font-size: 1.2rem; 74 | } 75 | .book.font-size-1 .book-body .page-inner section { 76 | font-size: 1.4rem; 77 | } 78 | .book.font-size-2 .book-body .page-inner section { 79 | font-size: 1.6rem; 80 | } 81 | .book.font-size-3 .book-body .page-inner section { 82 | font-size: 2.2rem; 83 | } 84 | .book.font-size-4 .book-body .page-inner section { 85 | font-size: 4rem; 86 | } 87 | .book.font-family-0 { 88 | font-family: Georgia, serif; 89 | } 90 | .book.font-family-1 { 91 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 92 | } 93 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { 94 | color: #704214; 95 | } 96 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a { 97 | color: inherit; 98 | } 99 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, 100 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2, 101 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3, 102 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4, 103 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5, 104 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { 105 | color: inherit; 106 | } 107 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, 108 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 { 109 | border-color: inherit; 110 | } 111 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { 112 | color: inherit; 113 | } 114 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { 115 | background-color: inherit; 116 | } 117 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote { 118 | border-color: #c4b29f; 119 | opacity: 0.9; 120 | } 121 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, 122 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { 123 | background: #fdf6e3; 124 | color: #657b83; 125 | border-color: #f8df9c; 126 | } 127 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight { 128 | background-color: inherit; 129 | } 130 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th, 131 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td { 132 | border-color: #f5d06c; 133 | } 134 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr { 135 | color: inherit; 136 | background-color: #fdf6e3; 137 | border-color: #444444; 138 | } 139 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { 140 | background-color: #fbeecb; 141 | } 142 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { 143 | color: #bdcadb; 144 | } 145 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a { 146 | color: #3eb1d0; 147 | } 148 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, 149 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2, 150 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3, 151 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4, 152 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5, 153 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { 154 | color: #fffffa; 155 | } 156 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, 157 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 { 158 | border-color: #373b4e; 159 | } 160 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { 161 | color: #373b4e; 162 | } 163 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr { 164 | background-color: #373b4e; 165 | } 166 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote { 167 | border-color: #373b4e; 168 | } 169 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre, 170 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code { 171 | color: #9dbed8; 172 | background: #2d3143; 173 | border-color: #2d3143; 174 | } 175 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight { 176 | background-color: #282a39; 177 | } 178 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th, 179 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td { 180 | border-color: #3b3f54; 181 | } 182 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr { 183 | color: #b6c2d2; 184 | background-color: #2d3143; 185 | border-color: #3b3f54; 186 | } 187 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { 188 | background-color: #35394b; 189 | } 190 | .book.color-theme-1 .book-header { 191 | color: #afa790; 192 | background: transparent; 193 | } 194 | .book.color-theme-1 .book-header .btn { 195 | color: #afa790; 196 | } 197 | .book.color-theme-1 .book-header .btn:hover { 198 | color: #73553c; 199 | background: none; 200 | } 201 | .book.color-theme-1 .book-header h1 { 202 | color: #704214; 203 | } 204 | .book.color-theme-2 .book-header { 205 | color: #7e888b; 206 | background: transparent; 207 | } 208 | .book.color-theme-2 .book-header .btn { 209 | color: #3b3f54; 210 | } 211 | .book.color-theme-2 .book-header .btn:hover { 212 | color: #fffff5; 213 | background: none; 214 | } 215 | .book.color-theme-2 .book-header h1 { 216 | color: #bdcadb; 217 | } 218 | .book.color-theme-1 .book-body .navigation { 219 | color: #afa790; 220 | } 221 | .book.color-theme-1 .book-body .navigation:hover { 222 | color: #73553c; 223 | } 224 | .book.color-theme-2 .book-body .navigation { 225 | color: #383f52; 226 | } 227 | .book.color-theme-2 .book-body .navigation:hover { 228 | color: #fffff5; 229 | } 230 | /* 231 | * Theme 1 232 | */ 233 | .book.color-theme-1 .book-summary { 234 | color: #afa790; 235 | background: #111111; 236 | border-right: 1px solid rgba(0, 0, 0, 0.07); 237 | } 238 | .book.color-theme-1 .book-summary .book-search { 239 | background: transparent; 240 | } 241 | .book.color-theme-1 .book-summary .book-search input, 242 | .book.color-theme-1 .book-summary .book-search input:focus { 243 | border: 1px solid transparent; 244 | } 245 | .book.color-theme-1 .book-summary ul.summary li.divider { 246 | background: #7e888b; 247 | box-shadow: none; 248 | } 249 | .book.color-theme-1 .book-summary ul.summary li i.fa-check { 250 | color: #33cc33; 251 | } 252 | .book.color-theme-1 .book-summary ul.summary li.done > a { 253 | color: #877f6a; 254 | } 255 | .book.color-theme-1 .book-summary ul.summary li a, 256 | .book.color-theme-1 .book-summary ul.summary li span { 257 | color: #877f6a; 258 | background: transparent; 259 | font-weight: normal; 260 | } 261 | .book.color-theme-1 .book-summary ul.summary li.active > a, 262 | .book.color-theme-1 .book-summary ul.summary li a:hover { 263 | color: #704214; 264 | background: transparent; 265 | font-weight: normal; 266 | } 267 | /* 268 | * Theme 2 269 | */ 270 | .book.color-theme-2 .book-summary { 271 | color: #bcc1d2; 272 | background: #2d3143; 273 | border-right: none; 274 | } 275 | .book.color-theme-2 .book-summary .book-search { 276 | background: transparent; 277 | } 278 | .book.color-theme-2 .book-summary .book-search input, 279 | .book.color-theme-2 .book-summary .book-search input:focus { 280 | border: 1px solid transparent; 281 | } 282 | .book.color-theme-2 .book-summary ul.summary li.divider { 283 | background: #272a3a; 284 | box-shadow: none; 285 | } 286 | .book.color-theme-2 .book-summary ul.summary li i.fa-check { 287 | color: #33cc33; 288 | } 289 | .book.color-theme-2 .book-summary ul.summary li.done > a { 290 | color: #62687f; 291 | } 292 | .book.color-theme-2 .book-summary ul.summary li a, 293 | .book.color-theme-2 .book-summary ul.summary li span { 294 | color: #c1c6d7; 295 | background: transparent; 296 | font-weight: 600; 297 | } 298 | .book.color-theme-2 .book-summary ul.summary li.active > a, 299 | .book.color-theme-2 .book-summary ul.summary li a:hover { 300 | color: #f4f4f5; 301 | background: #252737; 302 | font-weight: 600; 303 | } 304 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/css/plugin-search.css: -------------------------------------------------------------------------------- 1 | .book .book-summary .book-search { 2 | padding: 6px; 3 | background: transparent; 4 | position: absolute; 5 | top: -50px; 6 | left: 0px; 7 | right: 0px; 8 | transition: top 0.5s ease; 9 | } 10 | .book .book-summary .book-search input, 11 | .book .book-summary .book-search input:focus, 12 | .book .book-summary .book-search input:hover { 13 | width: 100%; 14 | background: transparent; 15 | border: 1px solid #ccc; 16 | box-shadow: none; 17 | outline: none; 18 | line-height: 22px; 19 | padding: 7px 4px; 20 | color: inherit; 21 | box-sizing: border-box; 22 | } 23 | .book.with-search .book-summary .book-search { 24 | top: 0px; 25 | } 26 | .book.with-search .book-summary ul.summary { 27 | top: 50px; 28 | } 29 | .with-search .summary li[data-level] a[href*=".html#"] { 30 | display: none; 31 | } 32 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/css/plugin-table.css: -------------------------------------------------------------------------------- 1 | .book .book-body .page-wrapper .page-inner section.normal table{display:table;width:100%;border-collapse:collapse;border-spacing:0;overflow:auto}.book .book-body .page-wrapper .page-inner section.normal table td,.book .book-body .page-wrapper .page-inner section.normal table th{padding:6px 13px;border:1px solid #ddd}.book .book-body .page-wrapper .page-inner section.normal table tr{background-color:#fff;border-top:1px solid #ccc}.book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n){background-color:#f8f8f8}.book .book-body .page-wrapper .page-inner section.normal table th{font-weight:700} 2 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/js/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.4 3 | * https://zenorocha.github.io/clipboard.js 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n indicates arrow keys):', 82 | '/: navigate to previous/next page', 83 | 's: Toggle sidebar']; 84 | if (config.search !== false) info.push('f: Toggle search input ' + 85 | '(use //Enter in the search input to navigate through search matches; ' + 86 | 'press Esc to cancel search)'); 87 | if (config.info !== false) gitbook.toolbar.createButton({ 88 | icon: 'fa fa-info', 89 | label: 'Information about the toolbar', 90 | position: 'left', 91 | onClick: function(e) { 92 | e.preventDefault(); 93 | window.alert(info.join('\n\n')); 94 | } 95 | }); 96 | 97 | // highlight the current section in TOC 98 | var href = window.location.pathname; 99 | href = href.substr(href.lastIndexOf('/') + 1); 100 | // accentuated characters need to be decoded (#819) 101 | href = decodeURIComponent(href); 102 | if (href === '') href = 'index.html'; 103 | var li = $('a[href^="' + href + location.hash + '"]').parent('li.chapter').first(); 104 | var summary = $('ul.summary'), chaps = summary.find('li.chapter'); 105 | if (li.length === 0) li = chaps.first(); 106 | li.addClass('active'); 107 | chaps.on('click', function(e) { 108 | chaps.removeClass('active'); 109 | $(this).addClass('active'); 110 | gs.set('tocScrollTop', summary.scrollTop()); 111 | }); 112 | 113 | var toc = config.toc; 114 | // collapse TOC items that are not for the current chapter 115 | if (toc && toc.collapse) (function() { 116 | var type = toc.collapse; 117 | if (type === 'none') return; 118 | if (type !== 'section' && type !== 'subsection') return; 119 | // sections under chapters 120 | var toc_sub = summary.children('li[data-level]').children('ul'); 121 | if (type === 'section') { 122 | toc_sub.hide() 123 | .parent().has(li).children('ul').show(); 124 | } else { 125 | toc_sub.children('li').children('ul').hide() 126 | .parent().has(li).children('ul').show(); 127 | } 128 | li.children('ul').show(); 129 | var toc_sub2 = toc_sub.children('li'); 130 | if (type === 'section') toc_sub2.children('ul').hide(); 131 | summary.children('li[data-level]').find('a') 132 | .on('click.bookdown', function(e) { 133 | if (href === $(this).attr('href').replace(/#.*/, '')) 134 | $(this).parent('li').children('ul').toggle(); 135 | }); 136 | })(); 137 | 138 | // add tooltips to the 's that are truncated 139 | $('a').each(function(i, el) { 140 | if (el.offsetWidth >= el.scrollWidth) return; 141 | if (typeof el.title === 'undefined') return; 142 | el.title = el.text; 143 | }); 144 | 145 | // restore TOC scroll position 146 | var pos = gs.get('tocScrollTop'); 147 | if (typeof pos !== 'undefined') summary.scrollTop(pos); 148 | 149 | // highlight the TOC item that has same text as the heading in view as scrolling 150 | if (toc && toc.scroll_highlight !== false && li.length > 0) (function() { 151 | // scroll the current TOC item into viewport 152 | var ht = $(window).height(), rect = li[0].getBoundingClientRect(); 153 | if (rect.top >= ht || rect.top <= 0 || rect.bottom <= 0) { 154 | summary.scrollTop(li[0].offsetTop); 155 | } 156 | // current chapter TOC items 157 | var items = $('a[href^="' + href + '"]').parent('li.chapter'), 158 | m = items.length; 159 | if (m === 0) { 160 | items = summary.find('li.chapter'); 161 | m = items.length; 162 | } 163 | if (m === 0) return; 164 | // all section titles on current page 165 | var hs = bookInner.find('.page-inner').find('h1,h2,h3'), n = hs.length, 166 | ts = hs.map(function(i, el) { return $(el).text(); }); 167 | if (n === 0) return; 168 | var scrollHandler = function(e) { 169 | var ht = $(window).height(); 170 | clearTimeout($.data(this, 'scrollTimer')); 171 | $.data(this, 'scrollTimer', setTimeout(function() { 172 | // find the first visible title in the viewport 173 | for (var i = 0; i < n; i++) { 174 | var rect = hs[i].getBoundingClientRect(); 175 | if (rect.top >= 0 && rect.bottom <= ht) break; 176 | } 177 | if (i === n) return; 178 | items.removeClass('active'); 179 | for (var j = 0; j < m; j++) { 180 | if (items.eq(j).children('a').first().text() === ts[i]) break; 181 | } 182 | if (j === m) j = 0; // highlight the chapter title 183 | // search bottom-up for a visible TOC item to highlight; if an item is 184 | // hidden, we check if its parent is visible, and so on 185 | while (j > 0 && items.eq(j).is(':hidden')) j--; 186 | items.eq(j).addClass('active'); 187 | }, 250)); 188 | }; 189 | bookInner.on('scroll.bookdown', scrollHandler); 190 | bookBody.on('scroll.bookdown', scrollHandler); 191 | })(); 192 | 193 | // do not refresh the page if the TOC item points to the current page 194 | $('a[href="' + href + '"]').parent('li.chapter').children('a') 195 | .on('click', function(e) { 196 | bookInner.scrollTop(0); 197 | bookBody.scrollTop(0); 198 | return false; 199 | }); 200 | 201 | var toolbar = config.toolbar; 202 | if (!toolbar || toolbar.position !== 'static') { 203 | var bookHeader = $('.book-header'); 204 | bookBody.addClass('fixed'); 205 | bookHeader.addClass('fixed') 206 | .css('background-color', bookBody.css('background-color')) 207 | .on('click.bookdown', function(e) { 208 | // the theme may have changed after user clicks the theme button 209 | bookHeader.css('background-color', bookBody.css('background-color')); 210 | }); 211 | } 212 | 213 | }); 214 | 215 | gitbook.events.bind("page.change", function(e) { 216 | // store TOC scroll position 217 | var summary = $('ul.summary'); 218 | gs.set('tocScrollTop', summary.scrollTop()); 219 | }); 220 | 221 | var bookBody = $('.book-body'), bookInner = bookBody.find('.body-inner'); 222 | var chapterTitle = function() { 223 | return bookInner.find('.page-inner').find('h1,h2').first().text(); 224 | }; 225 | var saveScrollPos = function(e) { 226 | // save scroll position before page is reloaded 227 | gs.set('bodyScrollTop', { 228 | body: bookBody.scrollTop(), 229 | inner: bookInner.scrollTop(), 230 | focused: document.hasFocus(), 231 | title: chapterTitle() 232 | }); 233 | }; 234 | $(document).on('servr:reload', saveScrollPos); 235 | 236 | // check if the page is loaded in an iframe (e.g. the RStudio preview window) 237 | var inIFrame = function() { 238 | var inIframe = true; 239 | try { inIframe = window.self !== window.top; } catch (e) {} 240 | return inIframe; 241 | }; 242 | if (inIFrame()) { 243 | $(window).on('blur unload', saveScrollPos); 244 | } 245 | 246 | $(function(e) { 247 | var pos = gs.get('bodyScrollTop'); 248 | if (pos) { 249 | if (pos.title === chapterTitle()) { 250 | if (pos.body !== 0) bookBody.scrollTop(pos.body); 251 | if (pos.inner !== 0) bookInner.scrollTop(pos.inner); 252 | } 253 | } 254 | if ((pos && pos.focused) || !inIFrame()) bookInner.find('.page-wrapper').focus(); 255 | // clear book body scroll position 256 | gs.remove('bodyScrollTop'); 257 | }); 258 | 259 | }); 260 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/js/plugin-clipboard.js: -------------------------------------------------------------------------------- 1 | gitbook.require(["gitbook", "jQuery"], function(gitbook, $) { 2 | 3 | var copyButton = ''; 4 | var clipboard; 5 | 6 | gitbook.events.bind("page.change", function() { 7 | 8 | if (!ClipboardJS.isSupported()) return; 9 | 10 | // the page.change event is thrown twice: before and after the page changes 11 | if (clipboard) { 12 | // clipboard is already defined but we are on the same page 13 | if (clipboard._prevPage === window.location.pathname) return; 14 | // clipboard is already defined and url path change 15 | // we can deduct that we are before page changes 16 | clipboard.destroy(); // destroy the previous events listeners 17 | clipboard = undefined; // reset the clipboard object 18 | return; 19 | } 20 | 21 | $(copyButton).prependTo("div.sourceCode"); 22 | 23 | clipboard = new ClipboardJS(".copy-to-clipboard-button", { 24 | text: function(trigger) { 25 | return trigger.parentNode.textContent; 26 | } 27 | }); 28 | 29 | clipboard._prevPage = window.location.pathname 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/js/plugin-fontsettings.js: -------------------------------------------------------------------------------- 1 | gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { 2 | var fontState; 3 | 4 | var THEMES = { 5 | "white": 0, 6 | "sepia": 1, 7 | "night": 2 8 | }; 9 | 10 | var FAMILY = { 11 | "serif": 0, 12 | "sans": 1 13 | }; 14 | 15 | // Save current font settings 16 | function saveFontSettings() { 17 | gitbook.storage.set("fontState", fontState); 18 | update(); 19 | } 20 | 21 | // Increase font size 22 | function enlargeFontSize(e) { 23 | e.preventDefault(); 24 | if (fontState.size >= 4) return; 25 | 26 | fontState.size++; 27 | saveFontSettings(); 28 | }; 29 | 30 | // Decrease font size 31 | function reduceFontSize(e) { 32 | e.preventDefault(); 33 | if (fontState.size <= 0) return; 34 | 35 | fontState.size--; 36 | saveFontSettings(); 37 | }; 38 | 39 | // Change font family 40 | function changeFontFamily(index, e) { 41 | e.preventDefault(); 42 | 43 | fontState.family = index; 44 | saveFontSettings(); 45 | }; 46 | 47 | // Change type of color 48 | function changeColorTheme(index, e) { 49 | e.preventDefault(); 50 | 51 | var $book = $(".book"); 52 | 53 | if (fontState.theme !== 0) 54 | $book.removeClass("color-theme-"+fontState.theme); 55 | 56 | fontState.theme = index; 57 | if (fontState.theme !== 0) 58 | $book.addClass("color-theme-"+fontState.theme); 59 | 60 | saveFontSettings(); 61 | }; 62 | 63 | function update() { 64 | var $book = gitbook.state.$book; 65 | 66 | $(".font-settings .font-family-list li").removeClass("active"); 67 | $(".font-settings .font-family-list li:nth-child("+(fontState.family+1)+")").addClass("active"); 68 | 69 | $book[0].className = $book[0].className.replace(/\bfont-\S+/g, ''); 70 | $book.addClass("font-size-"+fontState.size); 71 | $book.addClass("font-family-"+fontState.family); 72 | 73 | if(fontState.theme !== 0) { 74 | $book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, ''); 75 | $book.addClass("color-theme-"+fontState.theme); 76 | } 77 | }; 78 | 79 | function init(config) { 80 | var $bookBody, $book; 81 | 82 | //Find DOM elements. 83 | $book = gitbook.state.$book; 84 | $bookBody = $book.find(".book-body"); 85 | 86 | // Instantiate font state object 87 | fontState = gitbook.storage.get("fontState", { 88 | size: config.size || 2, 89 | family: FAMILY[config.family || "sans"], 90 | theme: THEMES[config.theme || "white"] 91 | }); 92 | 93 | update(); 94 | }; 95 | 96 | 97 | gitbook.events.bind("start", function(e, config) { 98 | var opts = config.fontsettings; 99 | if (!opts) return; 100 | 101 | // Create buttons in toolbar 102 | gitbook.toolbar.createButton({ 103 | icon: 'fa fa-font', 104 | label: 'Font Settings', 105 | className: 'font-settings', 106 | dropdown: [ 107 | [ 108 | { 109 | text: 'A', 110 | className: 'font-reduce', 111 | onClick: reduceFontSize 112 | }, 113 | { 114 | text: 'A', 115 | className: 'font-enlarge', 116 | onClick: enlargeFontSize 117 | } 118 | ], 119 | [ 120 | { 121 | text: 'Serif', 122 | onClick: _.partial(changeFontFamily, 0) 123 | }, 124 | { 125 | text: 'Sans', 126 | onClick: _.partial(changeFontFamily, 1) 127 | } 128 | ], 129 | [ 130 | { 131 | text: 'White', 132 | onClick: _.partial(changeColorTheme, 0) 133 | }, 134 | { 135 | text: 'Sepia', 136 | onClick: _.partial(changeColorTheme, 1) 137 | }, 138 | { 139 | text: 'Night', 140 | onClick: _.partial(changeColorTheme, 2) 141 | } 142 | ] 143 | ] 144 | }); 145 | 146 | 147 | // Init current settings 148 | init(opts); 149 | }); 150 | }); 151 | 152 | 153 | -------------------------------------------------------------------------------- /docs/libs/gitbook-2.6.7/js/plugin-search.js: -------------------------------------------------------------------------------- 1 | gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { 2 | var index = null; 3 | var fuse = null; 4 | var _search = {engine: 'lunr', opts: {}}; 5 | var $searchInput, $searchLabel, $searchForm; 6 | var $highlighted = [], hi, hiOpts = { className: 'search-highlight' }; 7 | var collapse = false, toc_visible = []; 8 | 9 | function init(config) { 10 | // Instantiate search settings 11 | _search = gitbook.storage.get("search", { 12 | engine: config.search.engine || 'lunr', 13 | opts: config.search.options || {}, 14 | }); 15 | }; 16 | 17 | // Save current search settings 18 | function saveSearchSettings() { 19 | gitbook.storage.set("search", _search); 20 | } 21 | 22 | // Use a specific index 23 | function loadIndex(data) { 24 | // [Yihui] In bookdown, I use a character matrix to store the chapter 25 | // content, and the index is dynamically built on the client side. 26 | // Gitbook prebuilds the index data instead: https://github.com/GitbookIO/plugin-search 27 | // We can certainly do that via R packages V8 and jsonlite, but let's 28 | // see how slow it really is before improving it. On the other hand, 29 | // lunr cannot handle non-English text very well, e.g. the default 30 | // tokenizer cannot deal with Chinese text, so we may want to replace 31 | // lunr with a dumb simple text matching approach. 32 | if (_search.engine === 'lunr') { 33 | index = lunr(function () { 34 | this.ref('url'); 35 | this.field('title', { boost: 10 }); 36 | this.field('body'); 37 | }); 38 | data.map(function(item) { 39 | index.add({ 40 | url: item[0], 41 | title: item[1], 42 | body: item[2] 43 | }); 44 | }); 45 | return; 46 | } 47 | fuse = new Fuse(data.map((_data => { 48 | return { 49 | url: _data[0], 50 | title: _data[1], 51 | body: _data[2] 52 | }; 53 | })), Object.assign( 54 | { 55 | includeScore: true, 56 | threshold: 0.1, 57 | ignoreLocation: true, 58 | keys: ["title", "body"] 59 | }, 60 | _search.opts 61 | )); 62 | } 63 | 64 | // Fetch the search index 65 | function fetchIndex() { 66 | return $.getJSON(gitbook.state.basePath+"/search_index.json") 67 | .then(loadIndex); // [Yihui] we need to use this object later 68 | } 69 | 70 | // Search for a term and return results 71 | function search(q) { 72 | let results = []; 73 | switch (_search.engine) { 74 | case 'fuse': 75 | if (!fuse) return; 76 | results = fuse.search(q).map(function(result) { 77 | var parts = result.item.url.split('#'); 78 | return { 79 | path: parts[0], 80 | hash: parts[1] 81 | }; 82 | }); 83 | break; 84 | case 'lunr': 85 | default: 86 | if (!index) return; 87 | results = _.chain(index.search(q)).map(function(result) { 88 | var parts = result.ref.split("#"); 89 | return { 90 | path: parts[0], 91 | hash: parts[1] 92 | }; 93 | }) 94 | .value(); 95 | } 96 | 97 | // [Yihui] Highlight the search keyword on current page 98 | $highlighted = $('.page-inner') 99 | .unhighlight(hiOpts).highlight(q, hiOpts).find('span.search-highlight'); 100 | scrollToHighlighted(0); 101 | 102 | return results; 103 | } 104 | 105 | // [Yihui] Scroll the chapter body to the i-th highlighted string 106 | function scrollToHighlighted(d) { 107 | var n = $highlighted.length; 108 | hi = hi === undefined ? 0 : hi + d; 109 | // navignate to the previous/next page in the search results if reached the top/bottom 110 | var b = hi < 0; 111 | if (d !== 0 && (b || hi >= n)) { 112 | var path = currentPath(), n2 = toc_visible.length; 113 | if (n2 === 0) return; 114 | for (var i = b ? 0 : n2; (b && i < n2) || (!b && i >= 0); i += b ? 1 : -1) { 115 | if (toc_visible.eq(i).data('path') === path) break; 116 | } 117 | i += b ? -1 : 1; 118 | if (i < 0) i = n2 - 1; 119 | if (i >= n2) i = 0; 120 | var lnk = toc_visible.eq(i).find('a[href$=".html"]'); 121 | if (lnk.length) lnk[0].click(); 122 | return; 123 | } 124 | if (n === 0) return; 125 | var $p = $highlighted.eq(hi); 126 | $p[0].scrollIntoView(); 127 | $highlighted.css('background-color', ''); 128 | // an orange background color on the current item and removed later 129 | $p.css('background-color', 'orange'); 130 | setTimeout(function() { 131 | $p.css('background-color', ''); 132 | }, 2000); 133 | } 134 | 135 | function currentPath() { 136 | var href = window.location.pathname; 137 | href = href.substr(href.lastIndexOf('/') + 1); 138 | return href === '' ? 'index.html' : href; 139 | } 140 | 141 | // Create search form 142 | function createForm(value) { 143 | if ($searchForm) $searchForm.remove(); 144 | if ($searchLabel) $searchLabel.remove(); 145 | if ($searchInput) $searchInput.remove(); 146 | 147 | $searchForm = $('
', { 148 | 'class': 'book-search', 149 | 'role': 'search' 150 | }); 151 | 152 | $searchLabel = $('
70 | 71 | 136 | 137 |
138 |
139 | 144 | 145 |
146 |
147 | 148 |
149 |
150 |

9 Saving Project Files

151 |

Now that we’ve added data to our project, let’s save it so we can come back to it later.

152 |
    153 |
  1. Click on the blue floppy disk icon (or from the File menu, select Save).
  2. 154 |
  3. Navigate to where you want to save your project file.
  4. 155 |
  5. In the File name box, type the name you would like your file to have. Give it a descriptive name so you’ll remember what the file was for.
  6. 156 |
  7. Click Save.
  8. 157 |
158 |

Note for ESRI users: QGIS’ .qgs and .qgz file are analogous to ArcMap’s .mxd files.

159 | 160 |
161 |
162 | 163 |
164 |
165 |
166 | 167 | 168 |
169 |
170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /docs/start-qgis-open-a-new-project.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 7 Start QGIS & Open a New Project | Intro to Desktop GIS with QGIS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 | 71 | 136 | 137 |
138 |
139 | 144 | 145 |
146 |
147 | 148 |
149 |
150 |

7 Start QGIS & Open a New Project

151 |

Start QGIS in the way you typically open any program on your particular computer’s operating system. It’s normal that it may take a minute to open.

152 |

When QGIS opens, you may see a list of recent projects, or if this is a new installation, there may not be any listed. It doesn’t matter which you see, because we want to start a new project. To do this, click on the Project menu in the upper left of the window and select New - or you can click the white page icon that is usually near the Project menu on the tool bar.

153 | 154 |
155 |
156 | 157 |
158 |
159 |
160 | 161 | 162 |
163 |
164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 204 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /docs/what-is-gis.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 2 What is GIS? | Intro to Desktop GIS with QGIS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 | 71 | 136 | 137 |
138 |
139 | 144 | 145 |
146 |
147 | 148 |
149 |
150 |

2 What is GIS?

151 |

GIS stands for either Geographic Information System or Geographic Information Science, depending on what aspect of the term we are interested in.

152 |

Geographic Information System typically refers to the software, like QGIS, we use to create spatial data and to investigate spatial relationships between that data.

153 |

Geographic Information Science is the framework we use to ask questions about the spatial relationship between data.

154 |

It’s good to understand the difference, but you’ll rarely hear people distinguish between the two. We’ll do both today - work with the software and ask questions about the spatial relationships in our chosen datasets.

155 | 156 |
157 |
158 | 159 |
160 |
161 |
162 | 163 | 164 |
165 |
166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 206 | 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /images/Map_BigTreesInZone.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Map_BigTreesInZone.PNG -------------------------------------------------------------------------------- /images/Map_CanaryPineLocations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Map_CanaryPineLocations.png -------------------------------------------------------------------------------- /images/Raster_DEM.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Raster_DEM.PNG -------------------------------------------------------------------------------- /images/Raster_LayerProperties.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Raster_LayerProperties.PNG -------------------------------------------------------------------------------- /images/Tool_AddMap.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_AddMap.PNG -------------------------------------------------------------------------------- /images/Tool_Deselect.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_Deselect.PNG -------------------------------------------------------------------------------- /images/Tool_ExpressionButton.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_ExpressionButton.PNG -------------------------------------------------------------------------------- /images/Tool_FieldCalculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_FieldCalculator.png -------------------------------------------------------------------------------- /images/Tool_GoBack.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_GoBack.PNG -------------------------------------------------------------------------------- /images/Tool_MoveItem.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_MoveItem.PNG -------------------------------------------------------------------------------- /images/Tool_MoveItemContent.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_MoveItemContent.PNG -------------------------------------------------------------------------------- /images/Tool_Pan.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_Pan.PNG -------------------------------------------------------------------------------- /images/Tool_SelectFeaturesUsingExpression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_SelectFeaturesUsingExpression.png -------------------------------------------------------------------------------- /images/Tool_ZoomInOut.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_ZoomInOut.PNG -------------------------------------------------------------------------------- /images/Tool_ZoomToSelection.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Tool_ZoomToSelection.PNG -------------------------------------------------------------------------------- /images/Vector_CanaryPine.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Vector_CanaryPine.PNG -------------------------------------------------------------------------------- /images/Vector_ClassifiedRoads.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/Vector_ClassifiedRoads.PNG -------------------------------------------------------------------------------- /images/geometries_data_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/d3bcdb344ccfb802520a169ef1190901f9918bcf/images/geometries_data_types.png -------------------------------------------------------------------------------- /images/test: -------------------------------------------------------------------------------- 1 | images for projects 2 | -------------------------------------------------------------------------------- /index.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Intro to Desktop GIS with QGIS 3 | author: [Michele Tobias] 4 | date: "`r Sys.Date()`" 5 | 6 | github-repo: ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS 7 | url: "[https://github.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS]" 8 | 9 | lang: en-us 10 | 11 | site: "bookdown::bookdown_site" 12 | knit: "bookdown::render_book" 13 | output: 14 | bookdown::gitbook: 15 | fig_caption: false 16 | config: 17 | toc: 18 | before: | 19 |
  • 20 | 21 |
  • 22 |
  • Intro to Desktop GIS with QGIS
  • 23 | after: | 24 | 25 | CC BY-SA 4.0 26 | 27 | collapse: section 28 | sharing: no 29 | view: https://github.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/blob/master/%s 30 | edit: https://github.com/ucdavisdatalab/Intro-to-Desktop-GIS-with-QGIS/edit/master/%s 31 | --- 32 | 33 | # Overview {-} 34 | 35 | ## Workshop Description 36 | This introductory-level workshop will focus upon the fundamental concepts and skills needed to explore and analyze data using Geographic Information Systems (GIS) software with examples using the QGIS platform. 37 | 38 | ## Prerequisites 39 | No prior experience with QGIS or other GIS software is needed, though attendees should be comfortable learning new computer applications, working with the basics of spreadsheets, and managing, organizing, and moving computer files on their operating system. 40 | 41 | You should download and install [QGIS](https://qgis.org/) on your computer. This workshop was last proofed for version 3.30. 42 | 43 | The data we'll use in this workshop is available in this [Box Folder Online](https://ucdavis.box.com/s/cnlz6ejmje4qgf7z80h7ygbwydc65kkm). 44 | 45 | ## Learning Objectives 46 | By the end of this workshop, you will be able to: 47 | 48 | + Define GIS and geospatial concepts and terminology. 49 | + Know the difference between vector and raster data types 50 | + Properly connect and add data to a QGIS project 51 | + Know where to find the attributes of your data in QGIS 52 | + Perform basic selections and queries in QGIS 53 | + Symbolize data by attributes 54 | + Assemble a basic map for export 55 | -------------------------------------------------------------------------------- /knit.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | show_help = function() { 4 | # ' Show a help message 5 | cat("Render a workshop reader website with Bookdown.\nArguments:\n") 6 | cat("[-h | --help]\t Show this help message\n") 7 | cat("[-p | --pdf]\t Include to render a PDF while building site\n") 8 | quit() 9 | } 10 | 11 | main = function(args) { 12 | # ' Run the script 13 | if ("-h" %in% args || "--help" %in% args) { 14 | show_help() 15 | } 16 | if ("-p" %in% args || "--pdf" %in% args) { 17 | bookdown::render_book( 18 | "index.Rmd", output_format = "pdf_document", output_file = "docs/_main" 19 | ) 20 | } 21 | bookdown::render_book("index.Rmd") 22 | } 23 | 24 | 25 | if (!interactive()) { 26 | args = commandArgs(trailingOnly=TRUE) 27 | main(args) 28 | } 29 | --------------------------------------------------------------------------------