Merge tag 'OB_16.2.1-23' into asm_16.2.1
16.2.1-23 Former-commit-id: 58689e4265e780a75c5e4c8e584afa27ea30e3f1
This commit is contained in:
commit
e7d7a5df40
5 changed files with 126 additions and 86 deletions
|
@ -19,6 +19,7 @@
|
||||||
# Last Modified: 10/30/15 by Joe Maloney, added -q flags to scp/ssh at end.
|
# Last Modified: 10/30/15 by Joe Maloney, added -q flags to scp/ssh at end.
|
||||||
# Last Modified: 11/25/15 by Tom LeFebvre, added switch to run tool from a cron or interactively.
|
# Last Modified: 11/25/15 by Tom LeFebvre, added switch to run tool from a cron or interactively.
|
||||||
# Last Modified: 11/29/15 by P. Santos, completed adding code to enable running Run_NWPS interactively or from a cron.
|
# Last Modified: 11/29/15 by P. Santos, completed adding code to enable running Run_NWPS interactively or from a cron.
|
||||||
|
# Last modified: 03/18/16 by Joe Maloney, a minor tweak to runManualNWPS_OutsideAWIPS call.
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
# The MenuItems list defines the GFE menu item(s) under which the
|
# The MenuItems list defines the GFE menu item(s) under which the
|
||||||
|
@ -216,5 +217,5 @@ class Procedure (SmartScript.SmartScript):
|
||||||
if cron:
|
if cron:
|
||||||
os.system('ssh -q px2f /awips2/GFESuite/nwps/bin/runManualNWPS_OutsideAWIPS.sh '+GFEDomainname)
|
os.system('ssh -q px2f /awips2/GFESuite/nwps/bin/runManualNWPS_OutsideAWIPS.sh '+GFEDomainname)
|
||||||
else:
|
else:
|
||||||
os.system('xterm -e ssh -q px2f /awips2/GFESuite/nwps/bin/runManualNWPS_OutsideAWIPS.sh '+GFEDomainname)
|
os.system('nohup xterm -iconic -e ssh -q px2f /awips2/GFESuite/nwps/bin/runManualNWPS_OutsideAWIPS.sh '+GFEDomainname+' &')
|
||||||
shutil.rmtree('/tmp/nwps/'+GFEDomainname)
|
shutil.rmtree('/tmp/nwps/'+GFEDomainname)
|
||||||
|
|
|
@ -93,6 +93,7 @@ import com.vividsolutions.jts.io.WKBReader;
|
||||||
* 07/15/13 2184 dhladky Remove all HUC's for storage except ALL
|
* 07/15/13 2184 dhladky Remove all HUC's for storage except ALL
|
||||||
* Nov 18, 2014 3831 dhladky StatusHandler logging. Proper list sizing. Geometry chunk sizing.
|
* Nov 18, 2014 3831 dhladky StatusHandler logging. Proper list sizing. Geometry chunk sizing.
|
||||||
* Aug 08, 2015 4722 dhladky Improved Grid support.
|
* Aug 08, 2015 4722 dhladky Improved Grid support.
|
||||||
|
* Apr 07, 2016 5491 tjensen Fix NullPointerException from getRawGeometries
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -366,7 +367,8 @@ public class FFMPTemplates {
|
||||||
HashMap<String, FFMPVirtualGageBasinMetaData> protoMap = readVGBDomainMap(
|
HashMap<String, FFMPVirtualGageBasinMetaData> protoMap = readVGBDomainMap(
|
||||||
dataKey, cwa);
|
dataKey, cwa);
|
||||||
String[] list = readVGBDomainList(dataKey, cwa);
|
String[] list = readVGBDomainList(dataKey, cwa);
|
||||||
LinkedHashMap<String, FFMPVirtualGageBasinMetaData> map = new LinkedHashMap<String, FFMPVirtualGageBasinMetaData>(list.length, 1.0f);
|
LinkedHashMap<String, FFMPVirtualGageBasinMetaData> map = new LinkedHashMap<>(
|
||||||
|
list.length, 1.0f);
|
||||||
|
|
||||||
// construct ordered map
|
// construct ordered map
|
||||||
for (String lid : list) {
|
for (String lid : list) {
|
||||||
|
@ -416,13 +418,17 @@ public class FFMPTemplates {
|
||||||
list = null;
|
list = null;
|
||||||
|
|
||||||
} catch (SerializationException se) {
|
} catch (SerializationException se) {
|
||||||
statusHandler.error("Serialization Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, se);
|
statusHandler.error("Serialization Exception: Write VGB: cwa: "
|
||||||
|
+ cwa + " dataKey: " + dataKey, se);
|
||||||
} catch (FileNotFoundException fnfe) {
|
} catch (FileNotFoundException fnfe) {
|
||||||
statusHandler.error("File Not found Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, fnfe);
|
statusHandler.error("File Not found Exception: Write VGB: cwa: "
|
||||||
|
+ cwa + " dataKey: " + dataKey, fnfe);
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
statusHandler.error("IO Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, ioe);
|
statusHandler.error("IO Exception: Write VGB: cwa: " + cwa
|
||||||
|
+ " dataKey: " + dataKey, ioe);
|
||||||
} catch (LocalizationOpFailedException e) {
|
} catch (LocalizationOpFailedException e) {
|
||||||
statusHandler.error("Localization Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, e);
|
statusHandler.error("Localization Exception: Write VGB: cwa: "
|
||||||
|
+ cwa + " dataKey: " + dataKey, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,13 +495,19 @@ public class FFMPTemplates {
|
||||||
list = null;
|
list = null;
|
||||||
|
|
||||||
} catch (SerializationException se) {
|
} catch (SerializationException se) {
|
||||||
statusHandler.error("Serialization Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, se);
|
statusHandler.error(
|
||||||
|
"Serialization Exception: Write Template: cwa: " + cwa
|
||||||
|
+ " dataKey:" + dataKey + " huc: " + huc, se);
|
||||||
} catch (FileNotFoundException fnfe) {
|
} catch (FileNotFoundException fnfe) {
|
||||||
statusHandler.error("File Not found Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, fnfe);
|
statusHandler.error(
|
||||||
|
"File Not found Exception: Write Template: cwa: " + cwa
|
||||||
|
+ " dataKey:" + dataKey + " huc: " + huc, fnfe);
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
statusHandler.error("IO Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, ioe);
|
statusHandler.error("IO Exception: Write Template: cwa: " + cwa
|
||||||
|
+ " dataKey:" + dataKey + " huc: " + huc, ioe);
|
||||||
} catch (LocalizationOpFailedException e) {
|
} catch (LocalizationOpFailedException e) {
|
||||||
statusHandler.error("Localization Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, e);
|
statusHandler.error("Localization Exception: Write Template: cwa: "
|
||||||
|
+ cwa + " dataKey:" + dataKey + " huc: " + huc, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -846,7 +858,8 @@ public class FFMPTemplates {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.error("Find Basin by lon lat failed: dataKey: "+dataKey+ " coor:"+coor.toString(), e);
|
statusHandler.error("Find Basin by lon lat failed: dataKey: "
|
||||||
|
+ dataKey + " coor:" + coor.toString(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -1010,7 +1023,8 @@ public class FFMPTemplates {
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.error("Failed to lookup County: dataKey: "+dataKey, e);
|
statusHandler.error("Failed to lookup County: dataKey: " + dataKey,
|
||||||
|
e);
|
||||||
}
|
}
|
||||||
|
|
||||||
FFMPCounties counties = new FFMPCounties(countyList);
|
FFMPCounties counties = new FFMPCounties(countyList);
|
||||||
|
@ -1087,8 +1101,8 @@ public class FFMPTemplates {
|
||||||
|
|
||||||
rect = HRAPCoordinates.getHRAPCoordinates();
|
rect = HRAPCoordinates.getHRAPCoordinates();
|
||||||
rect.setBounds(rect.x * primeSource.getHrapGridFactor(), rect.y
|
rect.setBounds(rect.x * primeSource.getHrapGridFactor(), rect.y
|
||||||
* primeSource.getHrapGridFactor(), rect.width
|
* primeSource.getHrapGridFactor(),
|
||||||
* primeSource.getHrapGridFactor(), rect.height
|
rect.width * primeSource.getHrapGridFactor(), rect.height
|
||||||
* primeSource.getHrapGridFactor());
|
* primeSource.getHrapGridFactor());
|
||||||
|
|
||||||
HRAPSubGrid hrapgrid = new HRAPSubGrid(rect,
|
HRAPSubGrid hrapgrid = new HRAPSubGrid(rect,
|
||||||
|
@ -1108,7 +1122,8 @@ public class FFMPTemplates {
|
||||||
} else if (primeSource.getDataType().equals(
|
} else if (primeSource.getDataType().equals(
|
||||||
FFMPSourceConfigurationManager.DATA_TYPE.GRID.getDataType())) {
|
FFMPSourceConfigurationManager.DATA_TYPE.GRID.getDataType())) {
|
||||||
// extract the Grid Coverage for use in site extents creation
|
// extract the Grid Coverage for use in site extents creation
|
||||||
GridCoverage coverage = FFMPUtils.getGridCoverageRecord(primeSource.getDataPath());
|
GridCoverage coverage = FFMPUtils.getGridCoverageRecord(primeSource
|
||||||
|
.getDataPath());
|
||||||
siteExtents = FFMPUtils.getGeometryText(coverage.getGeometry());
|
siteExtents = FFMPUtils.getGeometryText(coverage.getGeometry());
|
||||||
} else if (primeSource.getDataType().equals(
|
} else if (primeSource.getDataType().equals(
|
||||||
FFMPSourceConfigurationManager.DATA_TYPE.PDO.getDataType())) {
|
FFMPSourceConfigurationManager.DATA_TYPE.PDO.getDataType())) {
|
||||||
|
@ -1170,7 +1185,9 @@ public class FFMPTemplates {
|
||||||
getMaxExtent(), getSiteExtents(dataKey),
|
getMaxExtent(), getSiteExtents(dataKey),
|
||||||
mode.getMode()));
|
mode.getMode()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, "Unable to create FFMP Template for this dataKey: "+dataKey, e);
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
"Unable to create FFMP Template for this dataKey: "
|
||||||
|
+ dataKey, e);
|
||||||
}
|
}
|
||||||
} else if (huc.equals(FFMPRecord.COUNTY)) {
|
} else if (huc.equals(FFMPRecord.COUNTY)) {
|
||||||
list = getCountyFips(cwa, dataKey);
|
list = getCountyFips(cwa, dataKey);
|
||||||
|
@ -1243,7 +1260,8 @@ public class FFMPTemplates {
|
||||||
primary = true;
|
primary = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rawGeometries == null) {
|
if (rawGeometries == null
|
||||||
|
|| rawGeometries.isEmpty()) {
|
||||||
rawGeometries = getRawGeometries(dataKey, cwa);
|
rawGeometries = getRawGeometries(dataKey, cwa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1753,7 +1771,7 @@ public class FFMPTemplates {
|
||||||
if (results != null && results.length > 0) {
|
if (results != null && results.length > 0) {
|
||||||
|
|
||||||
if (pfafGeometries == null) {
|
if (pfafGeometries == null) {
|
||||||
pfafGeometries = new HashMap<Long, Geometry>(results.length, 1.0f);
|
pfafGeometries = new HashMap<>(results.length, 1.0f);
|
||||||
cwaRawGeometries.put(compositeKey,
|
cwaRawGeometries.put(compositeKey,
|
||||||
new SoftReference<Map<Long, Geometry>>(pfafGeometries));
|
new SoftReference<Map<Long, Geometry>>(pfafGeometries));
|
||||||
}
|
}
|
||||||
|
@ -1772,12 +1790,14 @@ public class FFMPTemplates {
|
||||||
if ((row.length >= (upstreamDepth + 9))
|
if ((row.length >= (upstreamDepth + 9))
|
||||||
&& (row[upstreamDepth + 9] != null)) {
|
&& (row[upstreamDepth + 9] != null)) {
|
||||||
try {
|
try {
|
||||||
pfafGeometries.put(basin.getPfaf(), reader
|
pfafGeometries.put(basin.getPfaf(),
|
||||||
.read((byte[]) row[upstreamDepth + 9])
|
reader.read((byte[]) row[upstreamDepth + 9])
|
||||||
.buffer(0));
|
.buffer(0));
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.error("Failure to add rawGeometry in loadBasins: "+siteKey, e);
|
statusHandler.error(
|
||||||
|
"Failure to add rawGeometry in loadBasins: "
|
||||||
|
+ siteKey, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1995,9 +2015,11 @@ public class FFMPTemplates {
|
||||||
list = SerializationUtil.transformFromThrift(long[].class,
|
list = SerializationUtil.transformFromThrift(long[].class,
|
||||||
FileUtil.file2bytes(f.getFile(), true));
|
FileUtil.file2bytes(f.getFile(), true));
|
||||||
} catch (SerializationException se) {
|
} catch (SerializationException se) {
|
||||||
statusHandler.error("Serialization Exception: Read Domain: cwa: "+cwa+" dataKey: "+dataKey+" huc: "+huc, se);
|
statusHandler.error("Serialization Exception: Read Domain: cwa: "
|
||||||
|
+ cwa + " dataKey: " + dataKey + " huc: " + huc, se);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
statusHandler.error("IO Exception: Read Domain: cwa: "+cwa+" dataKey: "+dataKey+" huc: "+huc, e);
|
statusHandler.error("IO Exception: Read Domain: cwa: " + cwa
|
||||||
|
+ " dataKey: " + dataKey + " huc: " + huc, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
@ -2032,9 +2054,11 @@ public class FFMPTemplates {
|
||||||
FileUtil.file2bytes(f.getFile(), true));
|
FileUtil.file2bytes(f.getFile(), true));
|
||||||
}
|
}
|
||||||
} catch (SerializationException se) {
|
} catch (SerializationException se) {
|
||||||
statusHandler.error("Serialization Exception: Domain Map: "+dataKey+" cwa:"+cwa+" huc: "+huc, se);
|
statusHandler.error("Serialization Exception: Domain Map: "
|
||||||
|
+ dataKey + " cwa:" + cwa + " huc: " + huc, se);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
statusHandler.error("IO Exception: Domain Map: "+dataKey+" cwa:"+cwa+" huc: "+huc, e);
|
statusHandler.error("IO Exception: Domain Map: " + dataKey
|
||||||
|
+ " cwa:" + cwa + " huc: " + huc, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
@ -2063,9 +2087,11 @@ public class FFMPTemplates {
|
||||||
.transformFromThrift(HashMap.class,
|
.transformFromThrift(HashMap.class,
|
||||||
FileUtil.file2bytes(f.getFile(), true));
|
FileUtil.file2bytes(f.getFile(), true));
|
||||||
} catch (SerializationException se) {
|
} catch (SerializationException se) {
|
||||||
statusHandler.error("Serialization Exception: Virtual Basins: "+dataKey+" cwa: "+cwa, se);
|
statusHandler.error("Serialization Exception: Virtual Basins: "
|
||||||
|
+ dataKey + " cwa: " + cwa, se);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
statusHandler.error("IO Exception: Virtual Basins: "+dataKey+" cwa: "+cwa, e);
|
statusHandler.error("IO Exception: Virtual Basins: " + dataKey
|
||||||
|
+ " cwa: " + cwa, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
@ -2091,9 +2117,12 @@ public class FFMPTemplates {
|
||||||
list = SerializationUtil.transformFromThrift(String[].class,
|
list = SerializationUtil.transformFromThrift(String[].class,
|
||||||
FileUtil.file2bytes(f.getFile(), true));
|
FileUtil.file2bytes(f.getFile(), true));
|
||||||
} catch (SerializationException se) {
|
} catch (SerializationException se) {
|
||||||
statusHandler.error("Serialization Exception: : Read Virtual Domain: cwa: "+cwa+" dataKey: "+dataKey, se);
|
statusHandler.error(
|
||||||
|
"Serialization Exception: : Read Virtual Domain: cwa: "
|
||||||
|
+ cwa + " dataKey: " + dataKey, se);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
statusHandler.error("IO Exception: : Read Virtual Domain: cwa: "+cwa+" dataKey: "+dataKey, e);
|
statusHandler.error("IO Exception: : Read Virtual Domain: cwa: "
|
||||||
|
+ cwa + " dataKey: " + dataKey, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
@ -2151,14 +2180,15 @@ public class FFMPTemplates {
|
||||||
if (rawGeomRef != null) {
|
if (rawGeomRef != null) {
|
||||||
pfafGeometries = rawGeomRef.get();
|
pfafGeometries = rawGeomRef.get();
|
||||||
}
|
}
|
||||||
if (pfafGeometries == null) {
|
if (pfafGeometries == null || pfafGeometries.isEmpty()) {
|
||||||
// TODO: add sync locking per cwa
|
// TODO: add sync locking per cwa
|
||||||
long t0 = System.currentTimeMillis();
|
long t0 = System.currentTimeMillis();
|
||||||
pfafGeometries = FFMPUtils.getRawGeometries(getMap(siteKey, cwa,
|
pfafGeometries = FFMPUtils.getRawGeometries(getMap(siteKey, cwa,
|
||||||
FFMPRecord.ALL).keySet());
|
FFMPRecord.ALL).keySet());
|
||||||
long t1 = System.currentTimeMillis();
|
long t1 = System.currentTimeMillis();
|
||||||
System.out.println("Retrieval of raw geometries for site "
|
statusHandler.handle(Priority.INFO,
|
||||||
+ siteKey + " cwa " + cwa + " took " + (t1 - t0) + " ms.");
|
"Retrieval of raw geometries for site " + siteKey + " cwa "
|
||||||
|
+ cwa + " took " + (t1 - t0) + " ms.");
|
||||||
cwaRawGeometries.put(compositeKey,
|
cwaRawGeometries.put(compositeKey,
|
||||||
new SoftReference<Map<Long, Geometry>>(pfafGeometries));
|
new SoftReference<Map<Long, Geometry>>(pfafGeometries));
|
||||||
}
|
}
|
||||||
|
@ -2362,10 +2392,14 @@ public class FFMPTemplates {
|
||||||
if (res >= 0.004) {
|
if (res >= 0.004) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
list = FFMPUtils.getUniqueCountyFips(cwa, getMaxExtent(),
|
list = FFMPUtils
|
||||||
getSiteExtents(dataKey), mode.getMode(), resolution);
|
.getUniqueCountyFips(cwa, getMaxExtent(),
|
||||||
|
getSiteExtents(dataKey), mode.getMode(),
|
||||||
|
resolution);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, "Unable to create FFMP Template for this dataKey: "+dataKey, e);
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
"Unable to create FFMP Template for this dataKey: "
|
||||||
|
+ dataKey, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list.size() > 0) {
|
if (list.size() > 0) {
|
||||||
|
|
|
@ -100,6 +100,7 @@ import com.vividsolutions.jts.io.WKTWriter;
|
||||||
* Aug 08, 2015 4722 dhladky Added Grid coverage and parsing methods.
|
* Aug 08, 2015 4722 dhladky Added Grid coverage and parsing methods.
|
||||||
* Sep 17, 2015 4756 dhladky Multiple guidance source bugs.
|
* Sep 17, 2015 4756 dhladky Multiple guidance source bugs.
|
||||||
* Feb 12, 2016 5370 dhladky Camel case for insertTime.
|
* Feb 12, 2016 5370 dhladky Camel case for insertTime.
|
||||||
|
* Apr 07, 2016 5491 tjensen Fix NullPointerException from getRawGeometries
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -371,8 +372,8 @@ public class FFMPUtils {
|
||||||
* @param extents
|
* @param extents
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static Object[] getBasins(String cwa, double buffer,
|
public static Object[] getBasins(String cwa, double buffer, String extents,
|
||||||
String extents, String mode) {
|
String mode) {
|
||||||
String lowestSimplificationLevel = ScanUtils
|
String lowestSimplificationLevel = ScanUtils
|
||||||
.getHighResolutionLevel("ffmp_basins");
|
.getHighResolutionLevel("ffmp_basins");
|
||||||
String highestSimplificationLevel = ScanUtils
|
String highestSimplificationLevel = ScanUtils
|
||||||
|
@ -424,7 +425,8 @@ public class FFMPUtils {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static Map<Long, Geometry> getRawGeometries(Collection<Long> pfafs) {
|
public static Map<Long, Geometry> getRawGeometries(Collection<Long> pfafs) {
|
||||||
HashMap<Long, Geometry> rval = null;
|
// Initialize rval to an empty Map to use as the default return value.
|
||||||
|
HashMap<Long, Geometry> rval = new HashMap<>();
|
||||||
if (pfafs.size() > 0) {
|
if (pfafs.size() > 0) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("SELECT pfaf_id, AsBinary("
|
builder.append("SELECT pfaf_id, AsBinary("
|
||||||
|
@ -448,7 +450,7 @@ public class FFMPUtils {
|
||||||
try {
|
try {
|
||||||
sq = SpatialQueryFactory.create();
|
sq = SpatialQueryFactory.create();
|
||||||
results = sq.dbRequest(builder.toString(), MAPS_DB);
|
results = sq.dbRequest(builder.toString(), MAPS_DB);
|
||||||
rval = new HashMap<Long, Geometry>(results.length, 1.0f);
|
rval = new HashMap<>(results.length, 1.0f);
|
||||||
} catch (SpatialException e) {
|
} catch (SpatialException e) {
|
||||||
statusHandler.error("Error querying Raw Geometries: +sql: "
|
statusHandler.error("Error querying Raw Geometries: +sql: "
|
||||||
+ builder.toString(), e);
|
+ builder.toString(), e);
|
||||||
|
@ -971,19 +973,19 @@ public class FFMPUtils {
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getFFGDataURI(GUIDANCE_TYPE type, String datasetid, String parameter,
|
public static String getFFGDataURI(GUIDANCE_TYPE type, String datasetid,
|
||||||
String plugin) {
|
String parameter, String plugin) {
|
||||||
DbQueryRequest request = new DbQueryRequest();
|
DbQueryRequest request = new DbQueryRequest();
|
||||||
request.setEntityClass(GridRecord.class.getName());
|
request.setEntityClass(GridRecord.class.getName());
|
||||||
request.addConstraint(GridConstants.PARAMETER_ABBREVIATION,
|
request.addConstraint(GridConstants.PARAMETER_ABBREVIATION,
|
||||||
new RequestConstraint(parameter));
|
new RequestConstraint(parameter));
|
||||||
|
|
||||||
if (type == GUIDANCE_TYPE.RFC) {
|
if (type == GUIDANCE_TYPE.RFC) {
|
||||||
request.addConstraint(GridConstants.DATASET_ID, new RequestConstraint(
|
request.addConstraint(GridConstants.DATASET_ID,
|
||||||
"FFG-" + datasetid.substring(1)));
|
new RequestConstraint("FFG-" + datasetid.substring(1)));
|
||||||
} else {
|
} else {
|
||||||
request.addConstraint(GridConstants.DATASET_ID, new RequestConstraint(
|
request.addConstraint(GridConstants.DATASET_ID,
|
||||||
datasetid));
|
new RequestConstraint(datasetid));
|
||||||
}
|
}
|
||||||
|
|
||||||
request.setOrderByField("dataTime.refTime", OrderMode.DESC);
|
request.setOrderByField("dataTime.refTime", OrderMode.DESC);
|
||||||
|
@ -994,8 +996,8 @@ public class FFMPUtils {
|
||||||
if (grids != null && grids.length > 0) {
|
if (grids != null && grids.length > 0) {
|
||||||
return grids[0].getDataURI();
|
return grids[0].getDataURI();
|
||||||
} else {
|
} else {
|
||||||
statusHandler.warn(
|
statusHandler.warn("No data available for this FFG Request: "
|
||||||
"No data available for this FFG Request: " + request.toString());
|
+ request.toString());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.error(
|
statusHandler.error(
|
||||||
|
@ -1471,7 +1473,8 @@ public class FFMPUtils {
|
||||||
coverage = record.getLocation();
|
coverage = record.getLocation();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
statusHandler.error("Query for Grid Coverage returned no results: DataSetID = "
|
statusHandler
|
||||||
|
.error("Query for Grid Coverage returned no results: DataSetID = "
|
||||||
+ datasetID);
|
+ datasetID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ import com.raytheon.uf.common.dataplugin.PluginException;
|
||||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
||||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE;
|
|
||||||
import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager;
|
import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager;
|
||||||
import com.raytheon.uf.common.monitor.config.FFTIDataManager;
|
import com.raytheon.uf.common.monitor.config.FFTIDataManager;
|
||||||
import com.raytheon.uf.common.monitor.processing.IMonitorProcessing;
|
import com.raytheon.uf.common.monitor.processing.IMonitorProcessing;
|
||||||
|
@ -63,6 +62,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
||||||
* Sep.09, 2015 4756 dhladky Further simplified configuration.
|
* Sep.09, 2015 4756 dhladky Further simplified configuration.
|
||||||
* Mar 04, 2016 5429 dhladky Special case for RFCFFG multi-RFC mosaics.
|
* Mar 04, 2016 5429 dhladky Special case for RFCFFG multi-RFC mosaics.
|
||||||
* Mar 29, 2016 5491 tjensen Special case for QPFSCAN
|
* Mar 29, 2016 5491 tjensen Special case for QPFSCAN
|
||||||
|
* Apr 02, 2016 5491 tjensen Fixed special case for QPFSCAN to be strict
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -482,7 +482,7 @@ public class FFMPConfig {
|
||||||
* RFC mosaic piece. Use existing sourceKey that designates that
|
* RFC mosaic piece. Use existing sourceKey that designates that
|
||||||
* mosaic piece.
|
* mosaic piece.
|
||||||
*/
|
*/
|
||||||
} else if (source.getSourceType().equals(SOURCE_TYPE.QPF.name())) {
|
} else if (source.getSourceName().equals("QPFSCAN")) {
|
||||||
/*
|
/*
|
||||||
* The special case of QPFSCAN. Use existing sourceKey that
|
* The special case of QPFSCAN. Use existing sourceKey that
|
||||||
* designates that mosaic piece.
|
* designates that mosaic piece.
|
||||||
|
|
|
@ -109,6 +109,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
||||||
* Aug 26, 2015 4777 dhladky Fixed bug in DPR accumulations.
|
* Aug 26, 2015 4777 dhladky Fixed bug in DPR accumulations.
|
||||||
* Sep 28, 2015 4756 dhladky Multiple Guidance upgrades.
|
* Sep 28, 2015 4756 dhladky Multiple Guidance upgrades.
|
||||||
* Feb 04, 2016 5311 dhladky Bug in creation of source bins fixed.
|
* Feb 04, 2016 5311 dhladky Bug in creation of source bins fixed.
|
||||||
|
* Apr 07, 2016 5491 tjensen Fix NullPointerException from getRawGeometries
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -377,7 +378,8 @@ public class FFMPProcessor {
|
||||||
} else {
|
} else {
|
||||||
if (checkLockStatus()) {
|
if (checkLockStatus()) {
|
||||||
lock();
|
lock();
|
||||||
if (cwaGeometries == null) {
|
if (cwaGeometries == null
|
||||||
|
|| cwaGeometries.isEmpty()) {
|
||||||
cwaGeometries = template
|
cwaGeometries = template
|
||||||
.getRawGeometries(dataKey,
|
.getRawGeometries(dataKey,
|
||||||
domain.getCwa());
|
domain.getCwa());
|
||||||
|
@ -902,7 +904,7 @@ public class FFMPProcessor {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (cwaGeometries == null) {
|
if (cwaGeometries == null || cwaGeometries.isEmpty()) {
|
||||||
cwaGeometries = template.getRawGeometries(dataKey, cwa);
|
cwaGeometries = template.getRawGeometries(dataKey, cwa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1007,7 +1009,7 @@ public class FFMPProcessor {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (cwaGeometries == null) {
|
if (cwaGeometries == null || cwaGeometries.isEmpty()) {
|
||||||
cwaGeometries = template.getRawGeometries(dataKey, cwa);
|
cwaGeometries = template.getRawGeometries(dataKey, cwa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1222,7 +1224,7 @@ public class FFMPProcessor {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (cwaGeometries == null) {
|
if (cwaGeometries == null || cwaGeometries.isEmpty()) {
|
||||||
cwaGeometries = template.getRawGeometries(siteKey, cwa);
|
cwaGeometries = template.getRawGeometries(siteKey, cwa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue