1

I am using GeoServer 2.3.3, PostGIS 2.1 and PostgreSQl 9.1. The Image Mosaic JDBC extension is also installed correctly.

I am trying to import raster data from PostGIS and publish in GeoServer but facing an error.I followed the following tutorial.

I have imported the raster to PostGIS using raster2pgsql, the command I used is:

raster2pgsql -M -I -C -e -Y -F -s 4326 -t 128x128 -l 2,4 geo_liss.tif public.raster_table | psql -U postgres -d postgis_test -h localhost -p 5433

I have even verified whether the image is imported into database correctly or not, by downloading it using gdal_translate.

http://docs.geotools.org/latest/userguide/library/coverage/pgraster.html

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="oek"/>
  <coordsys name="EPSG:4326"/>
  <!-- interpolation 1 = nearest neighbour, 2 = bipolar, 3 = bicubic -->
  <scaleop  interpolation="1"/>
<axisOrder ignore="false"/>
  &mapping;
  &connect;
</config>

connect.pgraster.xml.inc

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

mapping.pgraster.xml.inc

  <spatialExtension name="pgraster"/>
  <mapping>
  <masterTable name="mosaic" >
          <coverageNameAttribute name="name"/>
          <maxXAttribute name="maxx"/>
          <maxYAttribute name="maxy"/>
          <minXAttribute name="minx"/>
          <minYAttribute name="miny"/>
          <resXAttribute name="resx"/>
          <resYAttribute name="resy"/>
          <tileTableNameAtribute  name="tiletable" />
  </masterTable>
  <tileTable>
      <blobAttributeName name="rast" />
  </tileTable>
  </mapping>

I have stored these XML configuration files in the GeoServer data directory under the coverages folder.

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 have imported the raster data by giving the path of oek.pgrasterlxml in the URL required

As it doesn't work, I tried to import data in PostGIS database using import data in GeoServer. I have provided the SRS also. The data is imported correctly, but when I view it using OpenLayers I am unable to view, instead the WMS is providing an exception report:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> 
  <ServiceExceptionReport version="1.1.1" >
      <ServiceException>
  illegal bbox, minX: 0.0 is greater than maxX: -1.0
      </ServiceException>
  </ServiceExceptionReport>

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.