Skip to content

Commit c53521d

Browse files
committed
work on kriging
1 parent eefe2eb commit c53521d

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

hmachine/src/main/java/org/hortonmachine/hmachine/geoframe/TestKriging.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public TestKriging() {
3131
GeoFrameGeoTable.HYDRO_METEO_STATION.tableName() + " WHERE " + //
3232
HydroMeteoStation.TYPE.columnName() + " = '" + HydroMeteoStationSchema.StationType.METEO + "'").intValue();
3333
valueReader.pMaxId = maxId;
34+
valueReader.preCacheData();
35+
3436
var krigingInterpolator = new KrigingAtCentroid();
3537
krigingInterpolator.inGeoframeDBPath = geoframeGpkg;
3638
krigingInterpolator.inVariableType = VarSchema.EnvironmentalVariableType.TEMPERATURE.getId();

hmachine/src/main/java/org/hortonmachine/hmachine/geoframe/utils/KrigingAtCentroid.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ public void init() {
127127
public void process() throws Exception {
128128
HashMap<Integer, double[]> h = null;
129129

130-
inGeoframeDb = EDb.GEOPACKAGE.getSpatialDb();
131-
inGeoframeDb.open(inGeoframeDBPath);
132130
SimpleFeatureCollection inStations = SpatialDbsImportUtils.tableToFeatureFCollection(inGeoframeDb,
133131
GeoFrameGeoTable.HYDRO_METEO_STATION.getSchema().getSQLName(), -1, -1, null,
134132
HydroMeteoStation.TYPE.columnName() + "='" + StationType.METEO + "'");
@@ -192,7 +190,6 @@ private void processTimestep(double[] variableMap, StationsSelection stations, S
192190
HashMap<Integer, double[]> out = kriging.outData;
193191

194192

195-
196193
inGeoframeDb.execOnConnection(conn -> {
197194
boolean autoCommit = conn.getAutoCommit();
198195
conn.setAutoCommit(false);
@@ -212,7 +209,6 @@ private void processTimestep(double[] variableMap, StationsSelection stations, S
212209
}
213210
return null;
214211
});
215-
216212
} catch (Exception e) {
217213
e.printStackTrace();
218214
}

0 commit comments

Comments
 (0)