How to publish additional postgis raster layer attributes in geoserver?

868 Views Asked by At

i was wondering if any of You can help me with my problem. I'm storing some rasters in Postgis database. Each raster is in its own table and besides 'rid' and 'rast' columns, I manualy added other columns to store raster attributes such as 'metadata'...

I have successfully imported rasters in geoserver using ImageMosaic JDBC and in Layers Preview (OpenLayers) I can see rasters and use getFeatureInfo function, but the problem is that function getFeatureInfo returns table with correct pixel value , 'rid' field is empty (only table header apears) and no other attribute is shown (not even attribute header in table). I'm using default geoserver method for layer preview function.

mapping.postgis.xml.inc file

<!-- possible values: universal,postgis,db2,mysql,oracle -->
<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" /> 
    <keyAttributeName name="rid" />
    <textAttributeName name="metadata" />
</tileTable>
</mapping>

connect.postgis.xml.inc

<connect>
    <!-- value DBCP or JNDI -->
    <dstype value="DBCP"/>
    <!--   <jndiReferenceName value=""/>  -->
    <username value="postgres" />
    <password value="postgres" />
    <jdbcUrl value="jdbc:postgresql://localhost:5432/web_kartografija" />
    <driverClassName value="org.postgresql.Driver"/>
    <maxActive value="10"/>
    <maxIdle value="0"/>
</connect>

layer.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="jan"/> <!--   Name of the table in database  -->
    <coordsys name="EPSG:4326"/>
    <!-- interpolation 1 = nearest neighbour, 2 = bilinear, 3 = bicubic -->
    <scaleop  interpolation="1"/>
    <verify cardinality="false"/>
    &mapping;
    &connect;
</config>

I tried to include <textAttributeName name="metadata" /> as a column name where aditional data is stored, but still no effect. Can anobudy help me with this problem ? Thanks in advance !

0

There are 0 best solutions below