[postgis-users] error: type "raster" does not exist

john polo jpolo at mail.usf.edu
Mon Jan 13 17:54:50 PST 2020


Hi,

I'm learning to use PostGIS with PostgreSQL by way of the book _PostGIS 
In Action, 2ed_. I'm working in Windows 10. Using the following example 
from the book:

CREATE TABLE ch02.my_rasters (
     rid serial PRIMARY KEY,
     name varchar(100),
     rast raster);

I get the error in the subject line:

error: type "raster" does not exist

Searching for some help, I came across the note from 
https://postgis.net/docs/manual-3.0/raster.html

"[Raster] Requires PostGIS be compiled with GDAL support. Currently 
rasters can be implicitly converted to geometry type, but the conversion 
returns the ST_ConvexHull 
<https://postgis.net/docs/manual-3.0/RT_ST_ConvexHull.html> of the 
raster. This auto casting may be removed in the near future so don't 
rely on it."

I wasn't sure how to check PostGIS settings, but remembered that Ch.1 of 
the book suggested to use

SELECT postgis_full_version();

And when I looked at the result from that the first time, I did not 
notice that GDAL was missing. GDAL appeared to be installed, it was in 
my system environment variables. I reinstalled PostGIS and the select 
statement returns now:

POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="120" GEOS="3.8.0-CAPI-1.13.1 " 
PROJ="Rel. 5.2.0, September 15th, 2018" LIBXML="2.9.9" LIBJSON="0.12" 
LIBPROTOBUF="1.2.1" WAGYU="0.4.3 (Internal)"

When PostGIS installed, it requested to enable a couple of setting 
regarding rasters and I said yes. Currently, the relevant (I think) 
system variables are:

POSTGIS_ENABLE_OUTDB_RASTERS    1
POSTGIS_GDAL_ENABLED_DRIVERS    GTiff PNG JPEG GIF XYZ DTED USGSDEM AAIGrid
GDAL_DATA    C:\Program Files\PostgreSQL\12\gdal-data

I'm not sure why GDAL still doesn't register as part of the PostGIS 
settings. I would appreciate help in trying to get PostGIS and GDAL to 
work together for utilizing rasters.

best,

John

-- 
Enlightenment is ego's ultimate disappointment.
-Chogyam Trungpa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200113/50b1494c/attachment.html>


More information about the postgis-users mailing list