Come posso pubblicare i raster PostGIS usando GeoServer?
Ho trascorso molto tempo a cercare di creare un'origine dati Raster utilizzando Image Mosaic JDBC, ma senza fortuna.
Passaggi eseguiti:
1. Download e installazione dell'estensione JDBC Image Mosaic (funzionata correttamente)
2. Creazione dei file "Parametro di connessione":
connect.postgis.xml.inc:
<connect>
<dstype value="DBCP"/>
<username value="postgres" />
<password value="password" />
<jdbcUrl value="jdbc:postgresql://localhost:5432/db1" />
<driverClassName value="org.postgresql.Driver"/>
<maxActive value="10"/>
<maxIdle value="0"/>
</connect>
mapping.postgis.xml.inc:
<spatialExtension name="postgis"/>
<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>
osm.postgis.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE ImageMosaicJDBCConfig [
<!ENTITY mapping PUBLIC "mapping" "mapping.postgis.xml.inc">
<!ENTITY connect PUBLIC "connect" "connect.postgis.xml.inc">]>
<config version="1.0">
<coverageName name="gfm"/>
<coordsys name="EPSG:25832"/>
<!-- interpolation 1 = nearest neighbour, 2 = bilinear, 3 = bicubic -->
<scaleop interpolation="1"/>
<verify cardinality="false"/>
&mapping;
&connect;
</config>
dove "mosaic" è una tabella (colonne: nome, titolabile, minX, minY, maxX, maxY, resX, resY) contenente una riga: "gfm, testrastertable,,,,,,",
3. Salva i file di configurazione in. ./geoserver/data_dir/coverages/
4. Durante il tentativo di aggiungere un archivio dati JDBC di Image Mosaic ricevo il seguente errore:
Error: Could not list layers for this store, an error occurred retrieving them: Unable to acquire a reader for this coverage with format: ImageMosaicJDBC
Aggiornamento: registro geoserver
2012-10-24 14:09:11,404 DEBUG [org.geoserver] - Thread 14 locking in mode WRITE
2012-10-24 14:09:11,404 DEBUG [org.geoserver] - Thread 14 got the lock in mode WRITE
2012-10-24 14:09:11,406 DEBUG [geoserver.config] - Persisting coverage store raster_store
2012-10-24 14:09:11,408 DEBUG [geoserver.config] - Persisted org.geoserver.catalog.impl.CoverageStoreInfoImpl to /opt/geoserver/data_dir/workspaces/raster/raster_store/coveragestore.xml
2012-10-24 14:09:11,416 DEBUG [geoserver.config] - Persisted $Proxy15 to /opt/geoserver/data_dir/global.xml
2012-10-24 14:09:11,438 ERROR [imagemosaic.jdbc] -
2012-10-24 14:09:11,438 WARN [imagemosaic.jdbc] -
java.io.IOException
at org.geotools.gce.imagemosaic.jdbc.ImageMosaicJDBCReader.<init>(ImageMosaicJDBCReader.java:163)
at org.geotools.gce.imagemosaic.jdbc.ImageMosaicJDBCFormat.getReader(ImageMosaicJDBCFormat.java:209)
....
2012-10-24 14:09:11,439 INFO [geoserver.web] - Getting list of coverages for saved store file:coverages/osm.postgis.xml
java.lang.RuntimeException: Could not list layers for this store, an error occurred retrieving them: Unable to acquire a reader for this coverage with format: ImageMosaicJDBC
at org.geoserver.web.data.layer.NewLayerPageProvider.getItems(NewLayerPageProvider.java:115)
...
Caused by: java.lang.Exception: Unable to acquire a reader for this coverage with format: ImageMosaicJDBC
at org.geoserver.catalog.CatalogBuilder.buildCoverage(CatalogBuilder.java:812)
at org.geoserver.web.data.layer.NewLayerPageProvider.getItems(NewLayerPageProvider.java:82)
... 95 more
2012-10-24 14:09:11,441 DEBUG [geoserver.config] - Removing coverage store raster_store
2012-10-24 14:09:11,446 DEBUG [geoserver.config] - Persisted $Proxy15 to /opt/geoserver/data_dir/global.xml
2012-10-24 14:09:11,459 DEBUG [org.geoserver] - Thread 14 releasing the lock in mode WRITE