O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hands-On Geospatial Analysis with R and QGIS

Book Description

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.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Geospatial Analysis with R and QGIS
  3. Packt Upsell
    1. Why subscribe?
    2. Packt.com
  4. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Setting Up R and QGIS Environments for Geospatial Tasks
    1. Installing R
    2. Basic data types and data structures in R
      1. Basic data types in R 
      2. Variable
      3. Data structures in R 
        1. Vectors
          1. Basic operations with vector
        2. Matrix
        3. Array
        4. Data frames
        5. Lists
        6. Factor
    3. Looping, functions, and apply family in R
      1. Looping in R
      2. Functions in R
      3. Apply family – lapply, sapply, apply, tapply
        1. apply
        2. lapply
        3. sapply
        4. tapply
    4. Plotting in R
    5. Installing QGIS
    6. Getting to know the QGIS environment
    7. Summary
    8. Questions
    9. Further reading
  7. Fundamentals of GIS Using R and QGIS
    1. GIS in R
      1. Data types in GIS
        1. Vector data
        2. Raster data
      2. Plotting point data
        1. Importing point data from Excel
      3. Plotting lines and polygons data in R
        1. Adding point data on polygon data
      4. Changing projection system
      5. Plotting quantitative and qualitative data on a map
      6. Using tmap for easier plotting
    2. Vector data in QGIS
      1. Adding Excel data in QGIS using joins 
      2. Adding CSV layers in QGIS 
        1. Showing multiple labels using text chart diagrams
      3. Adding a background map
    3. Summary
    4. Questions
    5. Further reading
  8. Creating Geospatial Data
    1. Getting data from the web
      1. Downloading data from Natural Earth
      2. Downloading data from DIVA-GIS
      3. Downloading data from EarthExplorer
    2. Creating vector data
      1. Creating point data
      2. Creating polygon data
        1. Adding features to vector data
    3. Digitizing a map
    4. Working with databases
      1. Creating a SpatiaLite database
      2. Adding a shapefile to a database
    5. Summary
    6. Questions
    7. Further reading
  9. Working with Geospatial Data
    1. Working with vector data in R
      1. Combining shapefiles in R
      2. Clipping in R
      3. Difference in R
      4. Area calculation in R
    2. Working with vector data in QGIS
      1. Combining shapefiles
      2. Converting vector data types
        1. Polygons into lines
        2. Lines into polygons
      3. Clipping
      4. Difference
      5. Buffer
      6. Intersection
      7. Statistical summary of vector layers
      8. Using field calculators for advanced field calculations
    3. Summary
  10. Remote Sensing Using R and QGIS
    1. Basics of remote sensing
      1. Basic terminologies
      2. Remote sensing image characteristics
      3. Atmospheric correction
    2. Working with raster data in R
      1. Reading raster data
      2. Stacking raster data
      3. Changing the projection system of a raster file
      4. False color composite
      5. Slope, aspect, and hillshade
        1. Slope
        2. Aspect
        3. Hillshade
      6. Normalized Difference Vegetation Index (NDVI)
        1. Classifying the NDVI
    3. Working with raster data in QGIS
      1. False color composite
      2. Raster mosaic
      3. Clip raster by mask layer
      4. Projection system
      5. Changing projection systems
      6. Sampling raster data using points
      7. Reclassifying rasters
      8. Slope, aspect, and hillshade in QGIS
        1. Slope
    4. Summary
    5. Questions
  11. Point Pattern Analysis
    1. Introduction to point pattern analysis
      1. The ppp object
      2. Creating a ppp object from a CSV file
      3. Marked point patterns
    2. Analysis of point patterns
      1. Quadrat test
      2. G-function
      3. K-function
      4. L-function
      5. Spatial segregation for a bivariate marked point pattern
    3. Summary
  12. Spatial Analysis
    1. Testing autocorrelation
      1. Preparing data
      2. Moran's I index for autocorrelation
    2. Modeling autocorrelation
      1. Spatial autoregression
    3. Generalized linear model
      1. Modeling count data using Poisson GLM
    4. Spatial interpolation
      1. Nearest-neighbor interpolation
      2. Inverse distance weighting 
    5. Geostatistics
      1. Some important concepts
      2. Variograms
      3. Kriging
        1. Checking residuals 
    6. Summary
  13. GRASS, Graphical Modelers, and Web Mapping
    1. GRASS GIS
      1. Basics of GRASS GIS
        1. Database
        2. Location
        3. Mapset
      2. Creating a mapset
      3. Importing vector data in GRASS
      4. Importing raster data in GRASS
      5. False color composite in GRASS
      6. Graphical modeler
    2. Web mapping
      1. Web mapping in QGIS
    3. Summary
  14. Classification of Remote Sensing Images
    1. Classification of raster data
    2. Supervised classification
      1. Supervised classification in QGIS
      2. Creating a validation shapefile
    3. Unsupervised classification
    4. Summary
  15. Landslide Susceptibility Mapping
    1. Landslides in Bangladesh
    2. Landslide susceptibility modeling
      1. Data preprocessing
      2. Model building
        1. Logistic regression
        2. CART
        3. Random forest
    3. Summary
  16. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think