46,44 €
Practical examples with real-world projects in GIS, Remote sensing, Geospatial data management and Analysis using the R programming language
Key Features
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
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.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 186
Veröffentlichungsjahr: 2018
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author(s), nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Richa TripathiAcquisition Editor: Divya PoojariContent Development Editor: Ishita VoraTechnical Editor: Snehal DalmetCopy Editor: Safis EditingProject Coordinator: Namrata SwettaProofreader: Safis EditingIndexer: Pratik ShirodkarGraphics: Jisha ChirayilProduction Coordinator: Arvindkumar Gupta
First published: November 2018
Production reference: 1301118
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78899-167-4
www.packtpub.com
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Shammunul Islam is a consulting spatial data scientist at the Institute of Remote Sensing, Jahangirnagar University. His guidance is being applied toward the development of an adaptation tracking mechanism for a UNDP project in Bangladesh. He has provided data science training to the executives of Shwapno, the largest retail brand in Bangladesh. Mr. Islam has developed applications for automating statistical and econometric analysis for a variety of data sources, ranging from weather stations to socio-economic surveys. He has also consulted as a statistician for a number of surveys. He completed his MA in Climate and Society from Columbia University, New York, in 2014 on a full scholarship, before which he completed an honors degree in statistics and a master's degree in development studies.
Ana-Cornelia BADEA is a professor at the Faculty of Geodesy, Technical University of Civil Engineering, Bucharest. She defended habilitation in the field of geodetic engineering, and is a director of the Engineering Geodetic Measurements and Spatial Data Infrastructures Research Center. She is a UTCB representative at FIG. Her research interests focus primarily on modern geospatial data acquisition technologies, 3D modeling, GIS analysis, GIS-BIM integration, project management, concepts of urban cadastre, cadastral GIS applications, mobile mapping, and web GIS applications. She is the author and co-author of over 90 scientific papers at national and international conferences, as well as 10 books. She is president of the editorial board of the Journal of Geodesy, Cartography, and Cadastre, and the Union of Romanian surveyors, and is involved in numerous international editorial committees. She is a member of the ASRO ISO TC 359 committee on geospatial data standardization and is involved in project evaluation for national and international calls.
Brad Hamson is a spatial analyst and developer in the Seattle area whose professional interests include spatial data engineering, systems engineering, remote sensing, data science, and designing geospatial software applications. He is currently a graduate student pursuing a Master of Science degree in engineering management from the School of Engineering and Applied Science at George Washington University. He holds a Bachelor of Science degree in geography and environmental planning from Towson University, with a focus on geographic information sciences. Brad has extensive experience designing, implementing, and operating enterprise geographic information systems and solutions using proprietary and open source technologies. His specialist areas include spatial analysis using Python, system architecture and design, software development, spatial database design, data visualization, cartography, and graphic design.
Chima Obi is the lead geospatial analyst at AGERPoint Inc. His areas of expertise include processing lidar data, feature extraction from raster files, data visualization, big data analytics, and Python and R programming, as well as exploring other open source geospatial tools. He attained his bachelor's degree in soil science from the Federal University of Technology Owerri, Nigeria, in 2010. He then moved to the United States, where he obtained his master's degree in environmental science and obtained a certificate in geospatial information systems in 2016.
Prior to working at AGERPoint, he worked as a geospatial analyst at the West Virginia District of Highways throughout 2015 and 2016. He has extensive experience in the analysis of geospatial data.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Title Page
Copyright and Credits
Hands-On Geospatial Analysis with R and QGIS
Packt Upsell
Why subscribe?
Packt.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Setting Up R and QGIS Environments for Geospatial Tasks
Installing R
Basic data types and data structures in R
Basic data types in R 
Variable
Data structures in R 
Vectors
Basic operations with vector
Matrix
Array
Data frames
Lists
Factor
Looping, functions, and apply family in R
Looping in R
Functions in R
Apply family – lapply, sapply, apply, tapply
apply
lapply
sapply
tapply
Plotting in R
Installing QGIS
Getting to know the QGIS environment
Summary
Questions
Further reading
Fundamentals of GIS Using R and QGIS
GIS in R
Data types in GIS
Vector data
Raster data
Plotting point data
Importing point data from Excel
Plotting lines and polygons data in R
Adding point data on polygon data
Changing projection system
Plotting quantitative and qualitative data on a map
Using tmap for easier plotting
Vector data in QGIS
Adding Excel data in QGIS using joins 
Adding CSV layers in QGIS 
Showing multiple labels using text chart diagrams
Adding a background map
Summary
Questions
Further reading
Creating Geospatial Data
Getting data from the web
Downloading data from Natural Earth
Downloading data from DIVA-GIS
Downloading data from EarthExplorer
Creating vector data
Creating point data
Creating polygon data
Adding features to vector data
Digitizing a map
Working with databases
Creating a SpatiaLite database
Adding a shapefile to a database
Summary
Questions
Further reading
Working with Geospatial Data
Working with vector data in R
Combining shapefiles in R
Clipping in R
Difference in R
Area calculation in R
Working with vector data in QGIS
Combining shapefiles
Converting vector data types
Polygons into lines
Lines into polygons
Clipping
Difference
Buffer
Intersection
Statistical summary of vector layers
Using field calculators for advanced field calculations
Summary
Remote Sensing Using R and QGIS
Basics of remote sensing
Basic terminologies
Remote sensing image characteristics
Atmospheric correction
Working with raster data in R
Reading raster data
Stacking raster data
Changing the projection system of a raster file
False color composite
Slope, aspect, and hillshade
Slope
Aspect
Hillshade
Normalized Difference Vegetation Index (NDVI)
Classifying the NDVI
Working with raster data in QGIS
False color composite
Raster mosaic
Clip raster by mask layer
Projection system
Changing projection systems
Sampling raster data using points
Reclassifying rasters
Slope, aspect, and hillshade in QGIS
Slope
Summary
Questions
Point Pattern Analysis
Introduction to point pattern analysis
The ppp object
Creating a ppp object from a CSV file
Marked point patterns
Analysis of point patterns
Quadrat test
G-function
K-function
L-function
Spatial segregation for a bivariate marked point pattern
Summary
Spatial Analysis
Testing autocorrelation
Preparing data
Moran's I index for autocorrelation
Modeling autocorrelation
Spatial autoregression
Generalized linear model
Modeling count data using Poisson GLM
Spatial interpolation
Nearest-neighbor interpolation
Inverse distance weighting 
Geostatistics
Some important concepts
Variograms
Kriging
Checking residuals 
Summary
GRASS, Graphical Modelers, and Web Mapping
GRASS GIS
Basics of GRASS GIS
Database
Location
Mapset
Creating a mapset
Importing vector data in GRASS
Importing raster data in GRASS
False color composite in GRASS
Graphical modeler
Web mapping
Web mapping in QGIS
Summary
Classification of Remote Sensing Images
Classification of raster data
Supervised classification
Supervised classification in QGIS
Creating a validation shapefile
Unsupervised classification
Summary
Landslide Susceptibility Mapping
Landslides in Bangladesh
Landslide susceptibility modeling
Data preprocessing
Model building
Logistic regression
CART
Random forest
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
Where is something happening? Are there similarities between different areas with respect to an attribute of interest? Which area is most susceptible to a particular hazard? These and many other questions can be answered if you take location into account in your analysis. Location plays an important role and has critical implications for many policy decisions regarding environment, biodiversity, and socio-economy. This area is increasingly being studied by researchers and practitioners from many disciplines. In particular, in the realization of Sustainable Development Goals (SDGs), Geographic Information Systems (GIS), and remote sensing (RS), data can play a pivotal role.
R and QGIS are two examples of open source software that can be used free of charge for working with spatial data. By using them, we can answer many of our questions regarding location. For the last couple of years, R, a language originally intended for statisticians, has also been used as GIS software. We can readily call any spatial package in R and apply it to our data. QGIS is very powerful GIS software that enables users to perform many complex spatial tasks. QGIS and R both have a very strong user community and, by combining these two according to their relative advantages, you can perform very sophisticated and complex spatial analysis tasks.
This book covers both R and QGIS, unlike the other books on the market. Assuming you have zero, or rudimentary, knowledge of GIS and RS, this book will have transformed you from a beginner to an intermediate user of GIS and RS by the time you finish it. This book guides you from the initial step of setting up the software, to spatial analysis, geostatistics, and applying different models for landslide susceptibility mapping by providing hands-on examples, code, and screenshots. After reading this book, you should be able to generalize the examples to your spatial problems and create susceptibility maps using machine learning algorithms.
This book is great for geographers, environmental scientists, statisticians, and professionals who deal with spatial data. If you want to learn how to handle GIS and RS data, then this book is for you. Basic knowledge of R and QGIS would be helpful, but is not necessary.
Chapter 1, Setting Up R and QGIS Environments for Geospatial Tasks, shows how to set up the R and QGIS environments necessary for this book. The basics of R programming are covered, and you are introduced to the interface of QGIS.
Chapter 2, Fundamentals of GIS Using R and QGIS, details the different ways that spatial data is handled by R and QGIS. You are introduced to the steps that need to be followed to set up different projection systems and re-project data in this software. Packages such as sp, maptools, rgeos, sf, ggplot2, ggmap, and tmap in R are covered, showing how spatial data can be imported, exported, and visualized with the R engine. This chapter also shows how to do the same tasks with QGIS, with the help of detailed descriptions and screenshots. You will learn how to visualize quantitative and qualitative data in both R and QGIS.
Chapter 3, Creating Geospatial Data, provides a detailed overview of how to create geospatial data. This chapter will shed light on how vector and raster data is stored and how you can create point data, line data, and polygon data. Using QGIS, you will also be introduced to the digitization of maps.
Chapter 4, Working with Geospatial Data, explains how to query data for information extraction, how to use different joins, how to dissolve polygons, how to use buffering, and more. R and QGIS are both used to accomplish these tasks.
Chapter 5, Remote Sensing Using R and QGIS, begins with the basics of RS. The steps required to load and visualize remote sensing in R and QGIS are followed by band arithmetic, stacking and unstacking raster images, and other basic operations with RS data.
Chapter 6, Point Pattern Analysis, starts with the basic terminology of point pattern process (PPP) such as points, events, marks, windows, the spatial point pattern, and the spatial point process. It then explains how to use R to create R objects. You are then introduced to the PPP analysis for spatial randomness checking using quadrat testing, G-function, K-function and L-function, and others.
Chapter 7, Spatial Analysis, introduces readers to testing and modeling autocorrelation, fitting generalized linear models, and geostatistics. Checking the spatial autocorrelation of data using Moran's I is covered here, followed by spatial regression and a generalized linear model. Spatial interpolation and the basics of geostatistics are also discussed here.
Chapter 8, GRASS, Graphical Modelers, and Web Mapping, focuses on some more open source software, GRASS GIS, which can be used with QGIS. The chapter explains how to set up GRASS GIS and perform GRASS operations. Automating tasks using the graphical modeler is also covered. You will also learn how to make web maps inside QGIS.
Chapter 9, Classification of Remote Sensing Images, covers the basics of remote sensing image classification using QGIS 3.2.2. Supervised classification using the SCP plugin of QGIS is used to show how you can classify landsat images.
Chapter 10, Landslide Susceptibility Mapping, is a case study-based chapter where you are introduced to the different steps needed to make landslide susceptibility maps. Using the historical data of landslide events in Bangladesh, this chapter provides a step-by-step guide to the process of creating a landslide susceptibility map. In doing so, R and QGIS are used together. Logistic regression and decision-tree-based algorithms are used to fit models, and the accuracy of those models are then computed.
Basic knowledge of mathematics, such as addition and subtraction, is sufficient to follow this book.
If you are working with spatial data or plan to work with spatial data, you will benefit most by generalizing the examples in this book to your research question.
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packt.com
.
Select the
SUPPORT
tab.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-On-Geospatial-Analysis-with-R-and-QGIS. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781788991674_ColorImages.pdf.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
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.
