Hands-On Geospatial Analysis with R and QGIS
eBook - ePub

Hands-On Geospatial Analysis with R and QGIS

A beginner's guide to manipulating, managing, and analyzing spatial data using R and QGIS 3.2.2

  1. 354 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On Geospatial Analysis with R and QGIS

A beginner's guide to manipulating, managing, and analyzing spatial data using R and QGIS 3.2.2

Book details
Book preview
Table of contents
Citations

About This Book

Practical examples with real-world projects in GIS, Remote sensing, Geospatial data management and Analysis using the R programming language

Key Features

  • Understand the basics of R and QGIS to work with GIS and remote sensing data
  • Learn to manage, manipulate, and analyze spatial data using R and QGIS
  • Apply machine learning algorithms to geospatial data using R and QGIS

Book Description

Managing spatial data has always been challenging and it's getting more complex as the size of data increases. Spatial data is actually big data and you need different tools and techniques to work your way around to model and create different workflows. R and QGIS have powerful features that can make this job easier.

This book is your companion for applying machine learning algorithms on GIS and remote sensing data. You'll start by gaining an understanding of the nature of spatial data and installing R and QGIS. Then, you'll learn how to use different R packages to import, export, and visualize data, before doing the same in QGIS. Screenshots are included to ease your understanding.

Moving on, you'll learn about different aspects of managing and analyzing spatial data, before diving into advanced topics. You'll create powerful data visualizations using ggplot2, ggmap, raster, and other packages of R. You'll learn how to use QGIS 3.2.2 to visualize and manage (create, edit, and format) spatial data. Different types of spatial analysis are also covered using R. Finally, you'll work with landslide data from Bangladesh to create a landslide susceptibility map using different machine learning algorithms.

By reading this book, you'll transition from being a beginner to an intermediate user of GIS and remote sensing data in no time.

What you will learn

  • Install R and QGIS
  • Get familiar with the basics of R programming and QGIS
  • Visualize quantitative and qualitative data to create maps
  • Find out the basics of raster data and how to use them in R and QGIS
  • Perform geoprocessing tasks and automate them using the graphical modeler of QGIS
  • Apply different machine learning algorithms on satellite data for landslide susceptibility mapping and prediction

Who this book is for

This book is great for geographers, environmental scientists, statisticians, and every professional who deals with spatial data. If you want to learn how to handle GIS and remote sensing data, then this book is for you. Basic knowledge of R and QGIS would be helpful but is not necessary.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Hands-On Geospatial Analysis with R and QGIS by Shammunul Islam in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Programación. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788996983

Setting Up R and QGIS Environments for Geospatial Tasks

This chapter will walk its readers through the different stages of setting up the R and QGIS environments. R and QGIS are both free and open source software that can be used for various geospatial tasks. R benefits from more than 10,000 packages developed by its community, and QGIS also benefits from a number of plugins that are available to QGIS users. QGIS can complement R, and vice versa, for the conduct of many sophisticated geospatial tasks, and many statistical and machine learning algorithms can be very easily applied using R with the help of QGIS.
The first segment of the book starts by discussing how to install R and getting to know its environment. That is followed by data types in R, and different operations in R, and then getting acquainted with writing functions and plotting. The second segment consists of installing QGIS, learning the QGIS environment, and getting help in QGIS.
The following topics are to be covered in this chapter:
  • Installing R
  • Basic data types and the data structure in R
  • Looping, functions, and apply family in R
  • Plotting in R
  • Installing QGIS
  • Getting to know the QGIS environment.

Installing R

R is an open source programming language and software used for statistical computing and graphics, which has benefited greatly from the continuous contributions of its user community. Graphics in R are of very high quality, and, although it was not primarily developed for GIS purposes, with the development of packages such as ggmap, tmap, sf, raster, sp, and so on, R can work as a GIS environment itself. Furthermore, R codes can be written inside QGIS and we can also work on QGIS inside R using the RQGIS package.
We will now install R with the help of snapshots of each of the step-by-step instructions provided. The following steps have been implemented in Microsoft Windows and should also be applicable to Mac or other platforms with a little tweaking. There are no specific requirements for computer configuration, but any modern desktop or laptop will be sufficient to run the examples provided in this book.
Download R software from the following site and click on download R: https://www.r-project.org/.
Now we need to select a CRAN mirror; we will use the first link to download R.
Now we will need to click on Download R for Windows:
Click install R for the first time, as we can see from the following screenshot:
Now we just need to double-click the .exe file that we have downloaded and continue to click to accept all the defaults to complete the download of R. After we have installed R, we need to open it, and it will look similar to the following screenshot. For this installation process, a 64-bit computer is being used, but if you are using a 32-bit computer, your R windows will reflect that:
We are finally ready to rock and roll using R. But before that, we need a little bit more familiarity with R, or perhaps we need a refresher.

Basic data types and data structures in R

Before we start delving deep into R for geospatial analysis, we need to have a good understanding of how R handles and stores different types of data. We also need to know how to undertake different operations on that data.

Basic data types in R

There are three main data types in R, and they are as follows:
  • Numerics
  • Logical or Boolean
  • Character
Numerics are any numbers with decimal values; thus, 21.0 and 21.1 are both numerics. We can use addition, subtraction, multiplication, division, and so on, with these numerics. Interestingly, R also considers integer numbers to be numerics. Logical or Boolean data consists of TRUE and FALSE; they are mainly used for different comparisons. The character variable consists of text, such as the name of something. We write character values in R by putting our character values inside "", or double quotes.

Variable

Just before digging any deeper, we need to know how to assign values to any variable. So, what is a variable? It's like a container, which holds different value(s) of different types (or the same type). When assigning multiple values to any variable, we write the variable name to the left, followed by an <- or = and then the value. So, if we want to assign 2 to a variable x,...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Packt Upsell
  4. Contributors
  5. Preface
  6. Setting Up R and QGIS Environments for Geospatial Tasks
  7. Fundamentals of GIS Using R and QGIS
  8. Creating Geospatial Data
  9. Working with Geospatial Data
  10. Remote Sensing Using R and QGIS
  11. Point Pattern Analysis
  12. Spatial Analysis
  13. GRASS, Graphical Modelers, and Web Mapping
  14. Classification of Remote Sensing Images
  15. Landslide Susceptibility Mapping
  16. Other Books You May Enjoy