Merge "Issue #2947 Improve support for Satellite combined products." into development
Former-commit-id:a61e0dff2e
[formerly2eba6b705e
] [formerly5c223a8ce3
] [formerly35891b2dcd
[formerly5c223a8ce3
[formerly 4f1ca4c4dfeb84b582bfe7fe8375fb9f619cdd94]]] Former-commit-id:35891b2dcd
Former-commit-id: 46064df15844f46a8ec4d9674773f826e2cd2908 [formerly91698d222b
] Former-commit-id:648df0eead
This commit is contained in:
commit
355fe1f5f1
6 changed files with 73 additions and 40 deletions
|
@ -37,9 +37,11 @@ import com.raytheon.uf.viz.truecolor.extension.ITrueColorImagingExtension.Channe
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Aug 20, 2012 mschenke Initial creation
|
* Aug 20, 2012 mschenke Initial creation
|
||||||
|
* Apr 18, 2014 2947 bsteffen Support unitless data.
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -117,20 +119,22 @@ public class ChannelInfo {
|
||||||
* the unit to set
|
* the unit to set
|
||||||
*/
|
*/
|
||||||
public void setUnit(Unit<?> unit) {
|
public void setUnit(Unit<?> unit) {
|
||||||
this.unit = unit;
|
if (unit == null) {
|
||||||
|
this.unit = Unit.ONE;
|
||||||
|
} else {
|
||||||
|
this.unit = unit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "unit")
|
@XmlElement(name = "unit")
|
||||||
public void setUnitString(String unit) {
|
public void setUnitString(String unit) {
|
||||||
if (unit != null) {
|
if (unit != null) {
|
||||||
this.unit = UnitFormat.getUCUMInstance().parseObject(unit,
|
setUnit(UnitFormat.getUCUMInstance().parseObject(unit,
|
||||||
new ParsePosition(0));
|
new ParsePosition(0)));
|
||||||
} else {
|
} else {
|
||||||
this.unit = null;
|
setUnit(null);
|
||||||
}
|
|
||||||
if (this.unit == null) {
|
|
||||||
this.unit = Unit.ONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUnitString() {
|
public String getUnitString() {
|
||||||
|
|
|
@ -24,6 +24,8 @@ import java.util.HashMap;
|
||||||
import java.util.IdentityHashMap;
|
import java.util.IdentityHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.measure.converter.UnitConverter;
|
||||||
|
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
import org.eclipse.swt.graphics.Rectangle;
|
||||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||||
|
|
||||||
|
@ -63,9 +65,10 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Aug 6, 2012 mschenke Initial creation
|
* Aug 06, 2012 mschenke Initial creation
|
||||||
|
* Apr 18, 2014 2947 bsteffen Support unitless data.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -422,11 +425,16 @@ public class TrueColorResourceGroup extends
|
||||||
} else if (object instanceof ColorMapCapability) {
|
} else if (object instanceof ColorMapCapability) {
|
||||||
ColorMapParameters params = ((ColorMapCapability) object)
|
ColorMapParameters params = ((ColorMapCapability) object)
|
||||||
.getColorMapParameters();
|
.getColorMapParameters();
|
||||||
|
UnitConverter toDisplay = params
|
||||||
|
.getColorMapToDisplayConverter();
|
||||||
|
if (toDisplay == null) {
|
||||||
|
toDisplay = UnitConverter.IDENTITY;
|
||||||
|
}
|
||||||
ChannelInfo ci = channelInfoMap.get(params);
|
ChannelInfo ci = channelInfoMap.get(params);
|
||||||
if (ci != null) {
|
if (ci != null) {
|
||||||
ci.setRangeMin(params.getDataToDisplayConverter().convert(
|
ci.setRangeMin(toDisplay.convert(
|
||||||
params.getColorMapMin()));
|
params.getColorMapMin()));
|
||||||
ci.setRangeMax(params.getDataToDisplayConverter().convert(
|
ci.setRangeMax(toDisplay.convert(
|
||||||
params.getColorMapMax()));
|
params.getColorMapMax()));
|
||||||
ci.setUnit(params.getDisplayUnit());
|
ci.setUnit(params.getDisplayUnit());
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ import com.raytheon.viz.core.gl.images.GLOffscreenColormappedImage;
|
||||||
* Nov 20, 2013 2492 bsteffen Mosaic in image units.
|
* Nov 20, 2013 2492 bsteffen Mosaic in image units.
|
||||||
* Apr 08, 2014 2950 bsteffen Always use float for maximum precision
|
* Apr 08, 2014 2950 bsteffen Always use float for maximum precision
|
||||||
* offscreen so interpolation works.
|
* offscreen so interpolation works.
|
||||||
|
* Apr 18, 2014 2947 bsteffen Fix mosaicing of datamapped images.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -144,7 +145,7 @@ public abstract class GLMosaicImageExtension extends
|
||||||
|
|
||||||
GLColormappedImageExtension.setupDataMapping(gl,
|
GLColormappedImageExtension.setupDataMapping(gl,
|
||||||
(AbstractGLColormappedImage) image,
|
(AbstractGLColormappedImage) image,
|
||||||
writeToImage.getDataUnit(), 2, 3);
|
writeToImage.getDataUnit(), GL.GL_TEXTURE2, GL.GL_TEXTURE3);
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
// Fall through here, no actual rendering will occur
|
// Fall through here, no actual rendering will occur
|
||||||
|
|
|
@ -69,6 +69,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
||||||
* Nov 06, 2012 15157 D. Friedman Allow configured inclusion percentage
|
* Nov 06, 2012 15157 D. Friedman Allow configured inclusion percentage
|
||||||
* Oct 10, 2013 2104 mschenke Fixed broken percentage calculation
|
* Oct 10, 2013 2104 mschenke Fixed broken percentage calculation
|
||||||
* Mar 11, 2014 2896 bsteffen Limit the number of divisions.
|
* Mar 11, 2014 2896 bsteffen Limit the number of divisions.
|
||||||
|
* Apr 18, 2014 2947 bsteffen limit divisions more for pretiled data.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -298,7 +299,7 @@ public class SatBestResResourceData extends AbstractRequestableResourceData {
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getInclusionPercentage(IDescriptor descriptor,
|
private double getInclusionPercentage(IDescriptor descriptor,
|
||||||
ResourcePair rp, Polygon extent) throws VizException {
|
ResourcePair rp, Polygon extent) {
|
||||||
Double totalPercentage = Double.NaN;
|
Double totalPercentage = Double.NaN;
|
||||||
GeneralGridGeometry targetGeometry = descriptor.getGridGeometry();
|
GeneralGridGeometry targetGeometry = descriptor.getGridGeometry();
|
||||||
try {
|
try {
|
||||||
|
@ -313,10 +314,14 @@ public class SatBestResResourceData extends AbstractRequestableResourceData {
|
||||||
request.setDistinct(true);
|
request.setDistinct(true);
|
||||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||||
.sendRequest(request);
|
.sendRequest(request);
|
||||||
|
IGridGeometryProvider[] coverages = response.getFieldObjects(
|
||||||
|
"coverage", IGridGeometryProvider.class);
|
||||||
|
int maxDivisions = 1024;
|
||||||
|
if (coverages.length > 0) {
|
||||||
|
maxDivisions = Math.max(16, maxDivisions / coverages.length);
|
||||||
|
}
|
||||||
Geometry area = null;
|
Geometry area = null;
|
||||||
for (Map<String, Object> result : response.getResults()) {
|
for (IGridGeometryProvider provider : coverages) {
|
||||||
IGridGeometryProvider provider = (IGridGeometryProvider) result
|
|
||||||
.get("coverage");
|
|
||||||
GridGeometry2D gridGeometry = provider.getGridGeometry();
|
GridGeometry2D gridGeometry = provider.getGridGeometry();
|
||||||
|
|
||||||
double envWidth = gridGeometry.getEnvelope().getSpan(0);
|
double envWidth = gridGeometry.getEnvelope().getSpan(0);
|
||||||
|
@ -326,14 +331,14 @@ public class SatBestResResourceData extends AbstractRequestableResourceData {
|
||||||
|
|
||||||
int xDiv = (int) (envWidth / 100);
|
int xDiv = (int) (envWidth / 100);
|
||||||
int yDiv = (int) (envHeight / 100);
|
int yDiv = (int) (envHeight / 100);
|
||||||
if (xDiv * yDiv > 1024 * 1024) {
|
if ((long) xDiv * (long) yDiv > maxDivisions * maxDivisions) {
|
||||||
/* Don't wasste too much time/memory, preserve aspect ratio. */
|
/* Don't waste too much time/memory, preserve aspect ratio. */
|
||||||
if (xDiv > yDiv) {
|
if (xDiv > yDiv) {
|
||||||
yDiv = 1024 * yDiv / xDiv;
|
yDiv = maxDivisions * yDiv / xDiv;
|
||||||
xDiv = 1024;
|
xDiv = maxDivisions;
|
||||||
} else {
|
} else {
|
||||||
xDiv = 1024 * xDiv / yDiv;
|
xDiv = maxDivisions * xDiv / yDiv;
|
||||||
yDiv = 1024;
|
yDiv = maxDivisions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Geometry intersection = EnvelopeIntersection
|
Geometry intersection = EnvelopeIntersection
|
||||||
|
|
|
@ -58,18 +58,26 @@ import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||||
import com.raytheon.uf.viz.datacube.DataCubeContainer;
|
import com.raytheon.uf.viz.datacube.DataCubeContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Resource which displays multiple Satellite resources simultaneously. It is
|
||||||
|
* designed for displaying multiple, potentially overlapping regions such as
|
||||||
|
* the GOES East/West CONUS displays. This resource takes advantage of the
|
||||||
|
* mosaicing capability to render all teh satellite products into a single
|
||||||
|
* composite so that alpha changes are consistent for overlapping areas.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Feb 19, 2009 jsanchez Initial creation
|
* Feb 19, 2009 jsanchez Initial creation
|
||||||
* Mar 10, 2009 800 jsanchez Returned a single display name at a time.
|
* Mar 10, 2009 800 jsanchez Returned a single display name at a time.
|
||||||
* Mar 20, 2009 jsanchez Constructed resource with highest frequency first.
|
* Mar 20, 2009 jsanchez Constructed resource with highest
|
||||||
* Apr 29, 2009 2295 jsanchez Removed the size parameter in getFrequencyIndex().
|
* frequency first.
|
||||||
* Jun 17, 2009 2493 jsanchez Displayed both times in CONUS scale.
|
* Apr 29, 2009 2295 jsanchez Removed the size parameter in
|
||||||
|
* getFrequencyIndex().
|
||||||
|
* Jun 17, 2009 2493 jsanchez Displayed both times in CONUS scale.
|
||||||
|
* Apr 18, 2014 2947 bsteffen Allow resources being blended to omit
|
||||||
|
* load properties.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -147,8 +155,12 @@ public class SatBlendedResourceData extends AbstractRequestableResourceData
|
||||||
if (rp.getResource() != null) {
|
if (rp.getResource() != null) {
|
||||||
rp.setResourceData(rp.getResource().getResourceData());
|
rp.setResourceData(rp.getResource().getResourceData());
|
||||||
}
|
}
|
||||||
rp.getLoadProperties().overrideCapabilities(
|
LoadProperties props = rp.getLoadProperties();
|
||||||
loadProperties.getCapabilities());
|
if (props == null) {
|
||||||
|
props = new LoadProperties();
|
||||||
|
rp.setLoadProperties(props);
|
||||||
|
}
|
||||||
|
props.overrideCapabilities(loadProperties.getCapabilities());
|
||||||
boolean success = true;
|
boolean success = true;
|
||||||
try {
|
try {
|
||||||
success = rp.instantiateResource(descriptor, false);
|
success = rp.instantiateResource(descriptor, false);
|
||||||
|
|
|
@ -41,7 +41,6 @@ import com.raytheon.uf.common.colormap.prefs.DataMappingPreferences;
|
||||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||||
import com.raytheon.uf.common.dataplugin.satellite.SatMapCoverage;
|
import com.raytheon.uf.common.dataplugin.satellite.SatMapCoverage;
|
||||||
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
||||||
import com.raytheon.uf.common.dataplugin.satellite.units.SatelliteUnits;
|
|
||||||
import com.raytheon.uf.common.geospatial.IGridGeometryProvider;
|
import com.raytheon.uf.common.geospatial.IGridGeometryProvider;
|
||||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||||
|
@ -60,12 +59,14 @@ import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.drawables.ColorMapLoader;
|
import com.raytheon.uf.viz.core.drawables.ColorMapLoader;
|
||||||
import com.raytheon.uf.viz.core.drawables.IRenderable;
|
import com.raytheon.uf.viz.core.drawables.IRenderable;
|
||||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension.ImageProvider;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractPluginDataObjectResource;
|
import com.raytheon.uf.viz.core.rsc.AbstractPluginDataObjectResource;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||||
import com.raytheon.viz.satellite.SatelliteConstants;
|
import com.raytheon.viz.satellite.SatelliteConstants;
|
||||||
import com.raytheon.viz.satellite.inventory.DerivedSatelliteRecord;
|
import com.raytheon.viz.satellite.inventory.DerivedSatelliteRecord;
|
||||||
import com.raytheon.viz.satellite.tileset.SatDataRetriever;
|
import com.raytheon.viz.satellite.tileset.SatDataRetriever;
|
||||||
|
@ -98,7 +99,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Nov 20, 2013 2492 bsteffen Always get min/max values from style
|
* Nov 20, 2013 2492 bsteffen Always get min/max values from style
|
||||||
* rules.
|
* rules.
|
||||||
* Apr 09, 2014 2947 bsteffen Improve flexibility of sat derived
|
* Apr 09, 2014 2947 bsteffen Improve flexibility of sat derived
|
||||||
* parameters.
|
* parameters, implement ImageProvider
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -106,7 +107,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* @version 1
|
* @version 1
|
||||||
*/
|
*/
|
||||||
public class SatResource extends
|
public class SatResource extends
|
||||||
AbstractPluginDataObjectResource<SatResourceData, IMapDescriptor> {
|
AbstractPluginDataObjectResource<SatResourceData, IMapDescriptor>
|
||||||
|
implements ImageProvider {
|
||||||
|
|
||||||
/** String id to look for satellite-provided data values */
|
/** String id to look for satellite-provided data values */
|
||||||
public static final String SATELLITE_DATA_INTERROGATE_ID = "satelliteDataValue";
|
public static final String SATELLITE_DATA_INTERROGATE_ID = "satelliteDataValue";
|
||||||
|
@ -268,7 +270,7 @@ public class SatResource extends
|
||||||
|
|
||||||
private void initializeFirstFrame(SatelliteRecord record)
|
private void initializeFirstFrame(SatelliteRecord record)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
SatelliteUnits.register();
|
getCapability(ImagingCapability.class).setProvider(this);
|
||||||
ColorMapParameters colorMapParameters = null;
|
ColorMapParameters colorMapParameters = null;
|
||||||
IColorMap colorMap = null;
|
IColorMap colorMap = null;
|
||||||
String cmName = null;
|
String cmName = null;
|
||||||
|
@ -463,6 +465,7 @@ public class SatResource extends
|
||||||
record.getCreatingEntity());
|
record.getCreatingEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public List<DrawableImage> getImages(IGraphicsTarget target,
|
public List<DrawableImage> getImages(IGraphicsTarget target,
|
||||||
PaintProperties paintProps) throws VizException {
|
PaintProperties paintProps) throws VizException {
|
||||||
SatRenderable renderable = (SatRenderable) getOrCreateRenderable(paintProps
|
SatRenderable renderable = (SatRenderable) getOrCreateRenderable(paintProps
|
||||||
|
|
Loading…
Add table
Reference in a new issue