How to publish PostGIS Rasters in Geoserver?

gdalinfo landsat.tif

Driver: GTiff/GeoTIFF
Files: landsat.tif
Size is 1773, 1428
Coordinate System is `'
Origin = (177595.474744186009048,471385.819080783985555)
Pixel Size = (30.000000000000000,-30.000000000000000)
Image Structure Metadata:
Corner Coordinates:
Upper Left  (  177595.475,  471385.819) 
Lower Left  (  177595.475,  428545.819) 
Upper Right (  230785.475,  471385.819) 
Lower Right (  230785.475,  428545.819) 
Center      (  204190.475,  449965.819) 
Band 1 Block=1773x1 Type=Byte, ColorInterp=Red
Band 2 Block=1773x1 Type=Byte, ColorInterp=Green
Band 3 Block=1773x1 Type=Byte, ColorInterp=Blue

step 1) raster2pgsql

  raster2pgsql -s 4737 -I -M -C landsat.tif -t 100x100 -l 2,4,6 public.land mosaic | psql -U dragonman -d nyc 

step 2) MosicPlugIn install

step 3) creat MOSAIC table

create table {schema}.MOSAIC (NAME varchar(254) not null, TileTable varchar(254)not null, minX FLOAT8,minY FLOAT8, maxX FLOAT8, maxY FLOAT8,resX FLOAT8, resY FLOAT8, primary key (NAME,TileTable)) insert into MOSAIC (name, tiletable) values ('oek', 'landmosaic'); insert into MOSAIC (name, tiletable) values ('oek', 'o_2_landmosaic'); insert into MOSAIC (name, tiletable) values ('oek', 'o_4_landmosaic'); insert into MOSAIC (name, tiletable) values ('oek', 'o_6_landmosaic');

step 4) geoserver create config file (mapping, connenct, config xml file)

  create a directory /data/coverages this needs to contain 3 files: connect.pgraster.xml.inc, mapping.pgraster.xml.inc, oek.pgraster.xml

step 5) geoserver store create publish

< >Geoserver Error Log

Caused by: java.lang.Exception: Unable to acquire test coverage for format:ImageMosaicJDBC at org.geoserver.catalog.CatalogBuilder.buildCoverage(CatalogBuilder.java:970) at org.geoserver.catalog.CatalogBuilder.buildCoverage(CatalogBuilder.java:856) at org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:346)

  • Have you enabled Raster extension in PostGIS ? – Sunil May 16 '16 at 11:25
  • Have you take a look at this tutorial? – MickyInTheSky May 16 '16 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.