Hi,
One place (getNoDataValue()) in the pgraster driver in imagemosaic-jdbc assumes
that the raster column in the database is named 'rast', so setting
blobAttributeName
to something different doesn't work.
I'm attaching a proposed fix. I can submit a PR if needed, but I'll wait for
comments first.
Frank
--
Frank Gevaerts [email protected]
fks bvba - Formal and Knowledge Systems http://www.fks.be/
Schampbergstraat 32 Tel: ++32-(0)11-21 49 11
B-3511 KURINGEN-HASSELT Fax: ++32-(0)11-22 04 19
>From 3aefe638e857f60593a5e072f1dec297d3a711ab Mon Sep 17 00:00:00 2001
From: Frank Gevaerts <[email protected]>
Date: Thu, 30 Jun 2016 11:22:43 +0200
Subject: [PATCH 1/5] Use blobAttributeName correctly in JDBCAccessPGRaster.
---
.../geotools/gce/imagemosaic/jdbc/custom/JDBCAccessPGRaster.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/plugin/imagemosaic-jdbc/src/main/java/org/geotools/gce/imagemosaic/jdbc/custom/JDBCAccessPGRaster.java b/modules/plugin/imagemosaic-jdbc/src/main/java/org/geotools/gce/imagemosaic/jdbc/custom/JDBCAccessPGRaster.java
index e42e5cb..7d3597d 100644
--- a/modules/plugin/imagemosaic-jdbc/src/main/java/org/geotools/gce/imagemosaic/jdbc/custom/JDBCAccessPGRaster.java
+++ b/modules/plugin/imagemosaic-jdbc/src/main/java/org/geotools/gce/imagemosaic/jdbc/custom/JDBCAccessPGRaster.java
@@ -334,7 +334,7 @@ public class JDBCAccessPGRaster extends JDBCAccessCustom {
Please note: alternatively this value could be loaded from mosaic config file,
we could add an optional element/attribute to specify this value.
*/
- Number noDataValue = getNoDataValue(imageLevelInfo.getTileTableName(), con);
+ Number noDataValue = getNoDataValue(imageLevelInfo.getTileTableName(), getConfig().getBlobAttributeNameInTileTable(), con);
imageLevelInfo.setNoDataValue(noDataValue);
getLevelInfos().add(imageLevelInfo);
@@ -365,12 +365,12 @@ public class JDBCAccessPGRaster extends JDBCAccessCustom {
/*
extract noDataValues for each overview from overview raster tables
*/
- private Number getNoDataValue(String coverageTableName, Connection con) throws SQLException {
+ private Number getNoDataValue(String coverageTableName, String blobAttributeName, Connection con) throws SQLException {
PreparedStatement s = null;
ResultSet res = null;
try {
- String stmt = "select ST_BandNoDataValue(rast) from " + coverageTableName + " limit 1";
+ String stmt = "select ST_BandNoDataValue(" + blobAttributeName + ") from " + coverageTableName + " limit 1";
s = con.prepareStatement(stmt);
res = s.executeQuery();
--
2.8.1
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel