Regie.A (4) [Avatar] Offline
#1
Hello,

I tried loading the kauai.bil image from p. 380-381 using the statement:

/usr/lib/postgresql/8.4/bin/raster2pgsql -s 26904 -r -c -I -M -t 200x200 kauai.bil gis_schema.kauai > kauai.sql

this is not exactly the same as the one noted in the book since Postgis 2.0 not follows http://www.postgis.org/documentation/manual-svn/using_raster.xml.html

then, I loaded the data using:

psql -h localhost -U postgres -d raster_testing -f kauai.sql

unfortunately, there was an error:

INSERT 0 1
INSERT 0 1
INSERT 0 1
psql:kauai.sql:549: ERROR: syntax error at or near "ON"
LINE 1: CREATE INDEX ON "gis_schema"."kauai" USING gist (st_convexhu...
^
psql:kauai.sql:550: ERROR: current transaction is aborted, commands ignored until end of transaction block
ROLLBACK
psql:kauai.sql:552: ERROR: relation "gis_schema.kauai" does not exist
Regie.A (4) [Avatar] Offline
#2
Re: loading large and georeferenced rasters - p. 380 - 381
then, I tried a shortened version:

/usr/lib/postgresql/8.4/bin/raster2pgsql -s 26904 -t 200x200 kauai.bil gis_schema.kauai > kauai.sql
psql -h localhost -U postgres -d raster_testing -f kauai.sql

No error messages. Then, I ran the following (as stated in p. 381) in pgAdmin:

SELECT count(*) As num_rasters, ST_Height(rast) As height,
ST_Width(rast) As width, ST_SRID(rast) As srid,
ST_NumBands(rast) As num_bands,
ST_BandPixelType(rast,1) As btype
FROM gis_schema.kauai
GROUP BY ST_Height(rast) ,
ST_Width(rast), ST_SRID(rast),
ST_NumBands(rast),
ST_BandPixelType(rast,1);

The query result gave me exactly what is found in p. 382. Does this mean that the raster image was correctly loaded into the database? I am asking since I loaded it in QGIS 1.7 but got an error. (The pele.png file loaded in QGIS 1.7 without a problem).

What's the difference between the first (longer) statement and the second (shorter) statement?

Thanks very much.

Regie