Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical GIS

You're reading from   Practical GIS Learn novice to advanced topics such as QGIS, Spatial data analysis, and more

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781787123328
Length 428 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
G√°bor Farkas G√°bor Farkas
Author Profile Icon G√°bor Farkas
G√°bor Farkas
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Setting Up Your Environment FREE CHAPTER 2. Accessing GIS Data With QGIS 3. Using Vector Data Effectively 4. Creating Digital Maps 5. Exporting Your Data 6. Feeding a PostGIS Database 7. A PostGIS Overview 8. Spatial Analysis in QGIS 9. Spatial Analysis on Steroids - Using PostGIS 10. A Typical GIS Problem 11. Showcasing Your Data 12. Styling Your Data in GeoServer 13. Creating a Web Map Appendix

Querying rasters

As PostGIS has limited raster capabilities compared to the sophisticated algorithms that GRASS GIS has, we have no way to calculate walking distances in our spatial database. However, in PostGIS, we can query raster tables and carry out basic terrain analysis, like calculating aspect. Querying raster layers with points is a surprisingly fast operation in PostGIS, as it can use the bounding boxes of raster tiles for geometry indexing, transform our points to pixel coordinates in the correct tile, and get the corresponding value from the stored binary raster by calculating an offset in bytes. We can use the ST_Value function to query raster data as follows:

    SELECT h.*, ST_Value(r.rast, h.geom) AS elevation
FROM spatial.vw_semifinalhouses h, spatial.srtm r
WHERE ST_Intersects(r.rast, h.geom);

The only limitation of ST_Value is that it only accepts single...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image