Merge branch 'asm_15.1.1' of ssh://10.201.30.8:29418/AWIPS2_baseline into master_15.1.1

Former-commit-id: 483383876bfe73eb58ec0eb314106288dab4d172
This commit is contained in:
Fay.Liang 2015-04-27 14:08:47 -04:00
commit 3d25551183
9 changed files with 99 additions and 66 deletions

View file

@ -36,6 +36,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.graphics.RGB;
import org.geotools.coverage.grid.GeneralGridEnvelope;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.geometry.jts.JTS;
@ -72,6 +73,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.LabelableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.ShadeableCapability;
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
import com.raytheon.viz.core.rsc.jts.JTSCompiler.JTSGeometryData;
import com.raytheon.viz.core.rsc.jts.JTSCompiler.PointStyle;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.rsc.GFEFonts;
@ -106,6 +108,7 @@ import com.vividsolutions.jts.io.WKBReader;
* assignments.
* Aug 21, 2014 #3459 randerso Restructured Map resource class hierarchy
* Sep 04, 2014 #3365 ccody Changes for removing Data_Delivery dependencies
* Apr 06, 2015 #17340 randerso Eliminated clipping to GFE domain, code cleanup
*
* </pre>
*
@ -259,8 +262,6 @@ public class ZoneSelectorResource extends DbMapResource {
.getRowColumnValue(i, "editarea");
if (zoneName == null) {
continue;
// TODO: what do we do with this?
// zoneName = "";
}
if ((limitZones != null)
@ -268,9 +269,6 @@ public class ZoneSelectorResource extends DbMapResource {
continue;
}
String wfo = (String) mappedResult
.getRowColumnValue(i, "wfo");
Geometry existingGeom = resultingGeoms
.get(zoneName);
if (existingGeom != null) {
@ -281,12 +279,18 @@ public class ZoneSelectorResource extends DbMapResource {
numPoints += g.getNumPoints();
resultingGeoms.put(zoneName, g);
if ((myWfo != null) && myWfo.equals(wfo)) {
if (existingGeom != null) {
wfoPoints -= existingGeom.getNumPoints();
if (myWfo != null) {
String wfo = (String) mappedResult
.getRowColumnValue(i, "wfo");
if (myWfo.equals(wfo)) {
if (existingGeom != null) {
wfoPoints -= existingGeom
.getNumPoints();
}
wfoPoints += g.getNumPoints();
wfoGeoms.add(g);
}
wfoPoints += g.getNumPoints();
wfoGeoms.add(g);
}
ZoneInfo info = req.rsc.getZoneInfo(zoneName);
@ -326,7 +330,7 @@ public class ZoneSelectorResource extends DbMapResource {
newOutlineShape.allocate(numPoints);
JTSCompiler outlineCompiler = new JTSCompiler(null,
newOutlineShape, req.descriptor, PointStyle.CROSS);
newOutlineShape, req.descriptor);
int i = 0;
result.shapeList = new IShadedShape[resultingGeoms.size()];
@ -824,18 +828,7 @@ public class ZoneSelectorResource extends DbMapResource {
}
}
protected String buildQuery(PixelExtent extent, double simpLev)
throws VizException {
Envelope env = null;
try {
Envelope e = descriptor.pixelToWorld(extent, descriptor.getCRS());
ReferencedEnvelope ref = new ReferencedEnvelope(e,
descriptor.getCRS());
env = ref.transform(MapUtil.LATLON_PROJECTION, true);
} catch (Exception e) {
throw new VizException("Error transforming extent", e);
}
protected String buildQuery(PixelExtent extent, double simpLev) {
DecimalFormat df = new DecimalFormat("0.######");
String suffix = "_"
@ -861,16 +854,11 @@ public class ZoneSelectorResource extends DbMapResource {
query.append(" FROM ");
query.append(resourceData.getTable());
// add the geospatial constraint
query.append(" WHERE ");
query.append(getGeospatialConstraint(geometryField, env));
// add any additional constraints
if (resourceData.getConstraints() != null) {
for (String constraint : resourceData.getConstraints()) {
query.append(" AND ");
query.append(constraint);
}
// add any constraints
String[] constraints = resourceData.getConstraints();
if ((constraints != null) && (constraints.length > 0)) {
query.append(" WHERE ").append(
StringUtils.join(constraints, " AND "));
}
query.append(';');
@ -899,12 +887,19 @@ public class ZoneSelectorResource extends DbMapResource {
private IShadedShape computeShape(IGraphicsTarget target,
IMapDescriptor descriptor, Geometry g, RGB color) {
IShadedShape newShadedShape = target.createShadedShape(false,
descriptor.getGridGeometry(), true);
new GeneralGridGeometry(descriptor.getGridGeometry()), true);
// new GeneralGridGeometry(descriptor.getGridGeometry()));
JTSCompiler shapeCompiler = new JTSCompiler(newShadedShape, null,
descriptor, PointStyle.CROSS);
descriptor);
JTSGeometryData geomData = shapeCompiler.createGeometryData();
geomData.setWorldWrapCorrect(true);
geomData.setPointStyle(PointStyle.CROSS);
try {
shapeCompiler.handle(g, color);
geomData.setGeometryColor(color);
shapeCompiler.handle(g, geomData);
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM,
"Error computing shaded shape", e);
@ -969,17 +964,11 @@ public class ZoneSelectorResource extends DbMapResource {
query.append(" FROM ");
query.append(resourceData.getTable());
// add the geospatial constraint
query.append(" WHERE ");
query.append(getGeospatialConstraint(
resourceData.getGeomField(), null));
// add any additional constraints
if (resourceData.getConstraints() != null) {
for (String constraint : resourceData.getConstraints()) {
query.append(" AND ");
query.append(constraint);
}
// add any constraints
String[] constraints = resourceData.getConstraints();
if ((constraints != null) && (constraints.length > 0)) {
query.append(" WHERE ").append(
StringUtils.join(constraints, " AND "));
}
query.append(';');
@ -1052,17 +1041,11 @@ public class ZoneSelectorResource extends DbMapResource {
query.append(" FROM ");
query.append(resourceData.getTable());
// add the geospatial constraint
query.append(" WHERE ");
query.append(getGeospatialConstraint(
resourceData.getGeomField(), null));
// add any additional constraints
if (resourceData.getConstraints() != null) {
for (String constraint : resourceData.getConstraints()) {
query.append(" AND ");
query.append(constraint);
}
// add any constraints
String[] constraints = resourceData.getConstraints();
if ((constraints != null) && (constraints.length > 0)) {
query.append(" WHERE ").append(
StringUtils.join(constraints, " AND "));
}
query.append(';');

View file

@ -235,6 +235,7 @@ import com.vividsolutions.jts.io.WKTReader;
* 11/03/2014 3353 rferrel Ignore GeoSpatialData notification when this is the instance layer will do an update.
* 02/09/2015 3954 dlovely Only draw "W" if the county is displayed.
* 02/25/2014 3353 rjpeter Fix synchronized use case, updated to not create dialog before init is finished.
* 04/24/2015 ASM #17394 D. Friedman Fix geometries that become invalid in local coordinate space.
* </pre>
*
* @author mschenke
@ -1363,6 +1364,44 @@ public class WarngenLayer extends AbstractStormTrackResource {
gData.localToLatLon = gData.latLonToLocal.inverse();
for (GeospatialData gd : gData.features) {
Geometry local = JTS.transform(gd.geometry, gData.latLonToLocal);
if (! local.isValid()) {
TopologyException topologyException = null;
try {
CountyUserData userData = (CountyUserData) local.getUserData();
local = local.buffer(0.0);
GeometryUtil.setUserData(local, userData);
} catch (TopologyException e) {
topologyException = e;
}
// Try to generate user-readable area name...
String ident = null;
try {
String name = (String) gd.attributes.get("NAME");
if (name == null) {
name = (String) gd.attributes.get("COUNTYNAME");
}
if (name != null) {
ident = String.format("%s (gid=%s)", name, gd.attributes.get(WarngenLayer.GID));
}
} catch (RuntimeException e) {
// ignore
}
// ...Fall back to displaying attributes map.
if (ident == null) {
ident = gd.attributes.toString();
}
Priority priority;
String format;
if (local.isValid()) {
format = "Geometry for area %s was invalid. It has been repaired.";
priority = Priority.INFO;
} else {
format = "Geometry for %s is invalid and cannot be repaired. Hatching this area may not be possible.";
priority = Priority.WARN;
}
statusHandler.handle(priority, String.format(format, ident),
topologyException);
}
gd.attributes.put(AREA, local.getArea());
gd.attributes.put(GeospatialDataList.LOCAL_GEOM, local);
gd.attributes.put(GeospatialDataList.LOCAL_PREP_GEOM,

View file

@ -72,7 +72,7 @@ ${PSQLBINDIR}psql -d maps -U ${PGUSER} -q -p ${PGPORT} -c "
USING gist
(the_geom);
"
sed -n "s/'/''/g;s/^[[:digit:]]*//;s/[[:blank:]]*\\([-\.[:digit:]]*\)[[:blank:]]\{1,\}\([-\.[:digit:]]*\)[[:blank:]]\{1,\}\([-\.[:digit:]]*\)[[:blank:]]\{1,\}p[[:blank:]]*\\([[:digit:]]*\)[[:blank:]]*\\([^|]*\)|\([[:digit:]]*\).*/INSERT INTO "${SCHEMA}"\."${TABLE}"(id,name,warngenlev,the_geom) VALUES(\4,'\5',\6,GeomFromText('POINT(\3 \2)',4326));/p" $FILEPATH | \
sed -n "s/'/''/g;s/^[[:digit:]]|[[:blank:]][:digit:]*//;s/[[:blank:]]*\\([-\.[:digit:]]*\)[[:blank:]]\{1,\}\([-\.[:digit:]]*\)[[:blank:]]\{1,\}\([-\.[:digit:]]*\)[[:blank:]]\{1,\}p[[:blank:]]*\\([[:digit:]]*\)[[:blank:]]*\\([^|]*\)|\([[:digit:]]*\).*/INSERT INTO "${SCHEMA}"\."${TABLE}"(id,name,warngenlev,the_geom) VALUES(\4,'\5',\6,GeomFromText('POINT(\3 \2)',4326));/p" $FILEPATH | \
${PSQLBINDIR}psql -d maps -U ${PGUSER} -q -p ${PGPORT}
${PGBINDIR}vacuumdb -d maps -t ${SCHEMA}.${TABLE} -U ${PGUSER} -p ${PGPORT} -qz

View file

@ -85,6 +85,7 @@ import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
* May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage
* Jul 23, 2014 3410 bclement location changed to floats
* Oct 02, 2014 3693 mapeters Added Pattern constants.
* Apr 22, 2015 DR 16923 MPorricelli Modified cleanMessage to eliminate extra spaces
*
* </pre>
*
@ -988,7 +989,8 @@ public class MetarDecoder extends AbstractDecoder {
}
/**
* Get rid of any control characters prior to parsing data.
* Get rid of any control characters and extraneous spaces
* prior to parsing data.
*
* @param message
* @return
@ -998,14 +1000,17 @@ public class MetarDecoder extends AbstractDecoder {
char lastChar = 0;
for (int i = 0; i < message.length(); i++) {
char c = message.charAt(i);
if (c < ' ') {
if (lastChar != c) {
sb.append(' ');
// if current char is a control char or space and prev char is
// not a space, then add a space to string
if (c <= ' ') {
if (lastChar != ' ') {
sb.append(' ');
lastChar = ' ';
}
} else {
sb.append(c);
lastChar = c;
}
lastChar = c;
}
return sb.toString();
}

View file

@ -4762,6 +4762,8 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
<contourLabeling labelSpacing="4">
<increment>5</increment>
</contourLabeling>
</contourStyle>
</styleRule>
<!-- Style Rule for nwpsCG1 to display Sig. Wave Height and Swell Height
in ft. -->

View file

@ -5589,6 +5589,8 @@
<colorbarLabeling>
<increment>2000</increment>
</colorbarLabeling>
</imageStyle>
</styleRule>
<!-- Style Rule for nwpsCG1 to display Sig. Wave Height and Swell Height
in ft. -->

View file

@ -21,6 +21,8 @@ function buildRPM()
--define "_topdir ${AWIPSII_TOP_DIR}" \
--define "_build_root ${AWIPSII_BUILD_ROOT}" \
--define "_baseline_workspace ${WORKSPACE}" \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--buildroot ${AWIPSII_BUILD_ROOT} \
${SPECS}
if [ $? -ne 0 ]; then

View file

@ -7,7 +7,7 @@
Name: awips2-yajsw
Summary: AWIPS II yajsw Distribution
Version: %{_yajsw_version}
Release: 2
Release: %{_component_version}.%{_component_release}%{?dist}
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: noarch

View file

@ -103,7 +103,7 @@ fi
%post
# replace the service list script with the edex service list script
if [ ! -f /etc/init.d/edexServiceList-datadelivery]; then
if [ ! -f /etc/init.d/edexServiceList-datadelivery ]; then
if [ -f /etc/init.d/edexServiceList ]; then
mv /etc/init.d/edexServiceList /etc/init.d/edexServiceList.orig
if [ $? -ne 0 ]; then