Bagaimana cara saya mempublikasikan raster PostGIS menggunakan GeoServer?
Saya telah menghabiskan banyak waktu untuk mencoba membuat sumber data Raster menggunakan Image Mosaic JDBC tetapi tidak berhasil.
Langkah-langkah yang dilakukan:
1. Mengunduh dan Menginstal ekstensi JDBC Image Mosaic (berfungsi ok)
2. Membuat file "Parameter Koneksi":
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>
di mana "mosaic" adalah tabel (kolom: nama, titletable, minX, minY, maxX, maxY, resX, resY) yang berisi satu baris: "gfm, testrastertable,,,,,,,,"
3. Menyimpan file konfigurasi di. ./geoserver/data_dir/coverages/
4. Saat mencoba menambahkan penyimpanan data JDBC Image Mosaic, saya menerima galat berikut:
Error: Could not list layers for this store, an error occurred retrieving them: Unable to acquire a reader for this coverage with format: ImageMosaicJDBC
Pembaruan: Log 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