Как публиковать растры PostGIS с помощью GeoServer?
Я потратил много времени, пытаясь создать источник данных Raster, используя Image Mosaic JDBC, но безуспешно.
Выполненные шаги:
1. Загрузил и установил расширение JDBC Image Mosaic (работало нормально)
2. Создала файлы «Параметры соединения»:
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>
где «мозаика» - это таблица (столбцы: имя, заголовок, minX, minY, maxX, maxY, resX, resY), содержащая одну строку: «gfm, testrastertable,,,,,,,»
3. Сохраненные файлы конфигурации в. ./geoserver/data_dir/coverages/
4. При попытке добавить хранилище данных JDBC Image Mosaic я получаю следующую ошибку:
Error: Could not list layers for this store, an error occurred retrieving them: Unable to acquire a reader for this coverage with format: ImageMosaicJDBC
Обновление: журнал 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