[GIS] Problem in importing raster data from PostGIS to Geoserver

geoserverpostgisraster

I am using Opengeo Suite 3.0.2, PostGIS 2.0.3 and PostgreSQl 9.2.

I am trying to import raster data from PostGIS to Geoserver but facing an error.

I follow this tutorial link to import the raster data from PostGIS.

http://dev.horizon.opengeo.org/opengeo-docs/geoserver/tutorials/imagemosaic-jdbc/imagemosaic-jdbc_tutorial.html

All steps are going good.

I used FWtools 2.2.4 to make tiles.
gdal_retile works fine.

These are my XML configuration files…

rasterdata.pgraster.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<!DOCTYPE ImageMosaicJDBCConfig [ <!ENTITY mapping PUBLIC "mapping" "mapping.pgraster.xml.inc"> 
<!ENTITY connect PUBLIC "connect" "connect.pgraster.xml.inc"> ]> 
<config version="1.0"> 
<coverageName name="slp"/> 
<coordsys name="EPSG:4326"/> 
<scaleop interpolation="1"/> &mapping; &connect; 
</config>

connect.pgraster.xml.inc

<connect>
<dstype value="DBCP"/> 
<username value="postgres" /> 
<password value="postgre" /> 
<jdbcUrl value="jdbc:postgresql://localhost:5432/spatial_db" /> 
<driverClassName value="org.postgresql.Driver"/> 
<maxActive value="10"/> 
<maxIdle value="0"/> 
</connect>

mapping.pgraster.xml.inc

<spatialExtension name="postgis"/>
<mapping> 
<masterTable name="rasterdata_master2" > 
  <coverageNameAttribute name="slp"/> 
  <maxXAttribute name="maxx"/> 
  <maxYAttribute name="maxy"/> 
  <minXAttribute name="minx"/> 
  <minYAttribute name="miny"/> 
  <resXAttribute name="resx"/> 
  <resYAttribute name="resy"/> 
  <tileTableNameAtribute name="TileTable" /> 
  <spatialTableNameAtribute name="SpatialTable" />
</masterTable> 
<tileTable> 
  <blobAttributeName name="rast" /> 
  <keyAttributeName name="rid" /> 
</tileTable> 
<spatialTable>
  <keyAttributeName name="rid" />
  <geomAttributeName name="geom" />
  <tileMaxXAttribute name="maxX"/>
  <tileMaxYAttribute name="maxY"/>
  <tileMinXAttribute name="minX"/>
  <tileMinYAttribute name="minY"/>
</spatialTable>
</mapping>

After that I used the DDL generation utility which creates 4 Sql Scripts.

I execute the required script which creates the metadata tables.

now I used java utility to import the image data. That also works fine.

But when I try to use the image mosaic jdbc plugin to import the raster data through jdbc database, it gives an error, i.e. "Could not list layers for this store, an error occurred retrieving them: Argument "value" should not be null."

I am not able to insert the screenshot right now, so can't show you the screenshot of error.

Thanks

Akhil

Best Answer

I recommend the same as in How to publish PostGIS Rasters in Geoserver?: Following the configuration instructions for the PostGIS raster plugin, you should try replacing

<spatialExtension name="postgis"/>

with

<spatialExtension name="pgraster"/>

in configration file mapping.postgis.xml.inc.

Also, maybe <password value="postgre" /> in connect.pgraster.xml.inc is a typo for <password value="postgres" />.

Related Question