As a simple test case, I'm trying to configure the software stack of OpenGeo such that I can display a GeoTIFF as an overlay to a normal map like OSM. So I perform the following steps:
- Create a spatial data base with postGIS
- Load the GeoTIFF into the data base
- Import the data base to GeoServer
- Preview it as a map overlay in GeoServer (e.g. with GeoExplorer or OpenLayers)
In contrary to a direct import of the GeoTIFF to Geoserver (which works formidably), the table imported from the data base is marked as "vector data" and not "raster data" in the GeoServer web application.
In the Layer Preview, GeoExplorer does not display anything from the GeoTIFF and OpenLayers returns a WMS file reporting a
The requested Style can not be used with this layer.
The style specifies an attribute of geom and the layer is: opengeo:test
I believe the solution is quite simple but it seems I do not understand how GeoServer interprets raster data stored in postGIS.
Can anybody tell me what point I'm missing?
My steps in detail:
- Create a spatial data base with postGIS as documented, taking
template_postgisas a template and port 5432 as I operate on Ubuntu 12.04.
Load the GeoTIFF into the data base from the command line using
raster2pgsqlas in (http://suite.opengeo.org/docs/dataadmin/pgGettingStarted/raster2pgsql.html)
raster2pgsql -I -C -s 32632 test.tif public.testTable | psql -d test -h localhost -U opengeo
-I: flag to create the spatial GiST index for performance
-C: flag to apply the raster constraints
-s 32632: SRID of
test.tifreported by tool
test.tif: proper test GeoTIFF
public.testTable: new table in target schema
-d test: spatially enabled database
-U opengeo: owner of database (standard username)
- Import the data base to GeoServer as described in the official workshop