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

Paragon Corporation lr at pcorp.us
Thu Nov 25 10:25:49 PST 2010


Stefan,

> 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.
Correct - expect in PostGIS 2.0 its called raster2pgsql.py  and its no
longer wkt raster, but just  PostGIS Raster.  Ah the pains of writing about
something so much in flux.

> 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 
Correct
For importing there is gdal2wktraster -- in PostGIS 2.0 this is renamed to
raster2pgsql.  This is for importing
For exporting you use -- gdal_translate, gdal_warp etc.

>  Correct? What would be a better import (embedded SQL command? An .exe/.so
program like raster2pgsql without GDAL)?
The plan for future is a raster2pgsql.exe/so commandline that doesn't depend
on python, but still depends on GDAL (since PostGIS raster depends on GDAL
anyway) and in kind PostGIS 2.0 will depend on GDAL as well which may open
up many more interesting avenues in general for PostGIS.
 I'm not sure if we will see that exe/so  in 2.0 or 2.1 though.  I suspect
we won't see that until PostGIS 2.1

If Paul's fantasy of a release in January / February comes true, we
definitely won't see a commandline.  I'm thnking a release in March or April
is more realistic for 2.0, and frankly will make me a lot happier (since our
book won't be quite so obsolete
Since it mostly focuses on the 1.3-1.5 family of PostGISwith sprinklings of
PostGIS 2.0 changes along the way and jump into PostGIS 2.0 in the Raster
chapter)

Eventually GDAL will have both import and export functionality.  Right now
it just has just export functionality. Jorge Arevalo can talk more about
that since he's doing most of the work on the GDAL PostGIS raster driver.


>  What is the relationship and status of the project PGCHIP
(http://simon.benjamin.free.fr/pgchip/ )?
CHIP is a dead project started a really long time ago (almost as far back as
I can remember) and was the first attempt to introduce raster in PostGIS.
There is no relationship what so ever to my knowledge.  There are still
remnants of the code and SQL functions in the PostGIS code base which I'd
like to get rid of in PostGIS 2.0, since to me they just cause confusion and
bloat..   I'm not sure if anyone still uses CHIP though.  Perhaps someone
more knowledgeable can speak on it.


If you are interested in reviewing Chapter 13, we might be able to get you a
more updated version of it and versions as we change it.  Let us know.  It
has been pretty much rewritten and may undergo further revision before
publication.  Have to ask our publishers first if that is okay as they seem
pretty formal about those kind of things.


Thanks,
Regina and Leo
http://www.postgis.us





More information about the postgis-users mailing list