[postgis-users] How to import/export PostGIS Raster data? Tools?

Stefan Keller sfkeller at gmail.com
Thu Nov 25 09:57:25 PST 2010


To import raster data into PostGIS as raster type one has to use
gdal2wktraster.py which uses GDAL. To export PostGIS raster type it's
GDAL too.

=> What's now the current and future state of the art for
importing/exporting PostGIS Raster?

There are two sentences in the PostGIS book regarding this (chap.
13.3.2, page 409: "Currently GDAL PostGIS WKT Raster can only read
PostGIS raster data type and export to other raster formats." and
chap. 13.9.1, page 437: "Currently the PostGIS WKT Raster GDAL driver
can only export to other raster formats."

To me it's as follows: For importing there's GDAL and gdal2wktraster.
gdal2wktraster takes any GDAL supported raster format as input and
writes SQL (in PostGIS Raster WKT syntax) - similar how shp2pgsql
functions for vector formats. gdal2wktraster is a Python script which
uses GDAL and the "GDAL PostGIS WKT Raster driver". Since many API
tools build on top of GDAL, these tools are already capable of using
PostGIS raster data (input) if their GDAL library is compiled with
PostGIS WKT Raster support.

=> Correct? What would be a better import (embedded SQL command? An
.exe/.so program like raster2pgsql without GDAL)?

Regarding export - meaning exporting from a Postgres table containing
PostGIS raster attribute - to any raster format, it's unclear to me:
First, there's gdal_translate (given GDAL and the above mentioned
driver is installed).

=> Correct? What would be a better export (embedded SQL command? An
.exe/.so program like pgsql2raster)?
=> What is the relationship and status of the project PGCHIP
(http://simon.benjamin.free.fr/pgchip/ )?

Yours, S.



More information about the postgis-users mailing list