Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PostGIS Cookbook
  • Table Of Contents Toc
PostGIS Cookbook

PostGIS Cookbook

4.6 (12)
close
close
PostGIS Cookbook

PostGIS Cookbook

4.6 (12)

Overview of this book

Table of Contents (18 chapters)
close
close
PostGIS Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1
Index

Sharing and visualizing rasters through SQL


In a previous chapter, we used gdal_translate to export PostGIS rasters to a file. This provides a method for transferring files from one user to another or from one location to another. The only problem with this method is that you may not have access to the gdal_translate utility.

A different but equally functional approach is to use the ST_AsGDALRaster() family of functions available in PostGIS. In addition to ST_AsGDALRaster(), PostGIS provides ST_AsTIFF(), ST_AsPNG(), and ST_AsJPEG() to support the most common raster file formats.

To easily visualize raster files without the need for a GIS application, PostGIS 2.1 and later versions provide ST_ColorMap(). This function applies a built-in or user-specified color palette to a raster that, upon exporting with ST_AsGDALRaster(), can be viewed with any image viewer, such as a web browser.

Getting ready

In this recipe, we will use ST_AsTIFF() and ST_AsPNG() to export rasters to the GeoTIFF and PNG file...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PostGIS Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon