com.esri.arcgis.datasourcesraster
Class StatsHistogram

java.lang.Object
  extended by com.esri.arcgis.datasourcesraster.StatsHistogram
All Implemented Interfaces:
IStatsHistogram, com.esri.arcgis.interop.RemoteObjRef, IPersist, IPersistStream, Externalizable, Serializable

public class StatsHistogram
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IStatsHistogram, IPersist, IPersistStream, Externalizable

A raster statistics and histogram class.

Description

StatsHistogram is a helper object that provides the statistics and histogram of a raster for the RasterStretchColorRampRenderer and the RasterRGBRenderer objects. The statistics and histogram can be created either from scratch by using this object, or by using RasterCalcStatsHistogram object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
StatsHistogram()
          Constructs a StatsHistogram using ArcGIS Engine.
StatsHistogram(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
StatsHistogram theStatsHistogram = (StatsHistogram) obj;
 
Method Summary
 void accumulate(double value, int count)
          Accumulates a value and its count.
 void empty()
          Empties this RasterStatsHistogram and marks it invalid.
 boolean equals(Object o)
          Compare this object with another
 void getClassID(GUID[] pClassID)
          getClassID
static String getClsid()
          getClsid.
 Object getHistogram()
          The histogram values of the statistics.
 double getMax()
          The maximum value of the historgram.
 double getMean()
          The mean value of the historgram.
 double getMin()
          The minimum value of the historgram.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 double getStdDev()
          The standard deviation value of the historgram.
 int hashCode()
          the hashcode for this object
 boolean hasHistogram()
          Checks if this StatsHistogram has histogram.
 boolean hasStats()
          Checks if this StatsHistogram has stats.
 void isDirty()
          isDirty
 void load(IStream pstm)
          load
 void putHistogramMinmax(double min, double max)
          Sets histogram min and max range.
 void putStats(double min, double max, double mean, double stdDev)
          Computes stats and histogram from a given Raster.
 void queryHistogramMinmax(double[] min, double[] max)
          Gets histogram min and max range.
 void queryStats(double[] min, double[] max, double[] mean, double[] stdDev)
          Computes stats and histogram from a given Raster.
 void readExternal(ObjectInput in)
           
 void save(IStream pstm, int fClearDirty)
          save
 void setHistogram(Object histogram)
          The histogram values of the statistics.
 void setMax(double max)
          The maximum value of the historgram.
 void setMean(double mean)
          The mean value of the historgram.
 void setMin(double min)
          The minimum value of the historgram.
 void setStdDev(double stdDev)
          The standard deviation value of the historgram.
 void update()
          Updates the histogram after accumulation.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

StatsHistogram

public StatsHistogram()
               throws IOException,
                      UnknownHostException
Constructs a StatsHistogram using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

StatsHistogram

public StatsHistogram(Object obj)
               throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
StatsHistogram theStatsHistogram = (StatsHistogram) obj;

Construct a StatsHistogram using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to StatsHistogram.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getMin

public double getMin()
              throws IOException,
                     AutomationException
The minimum value of the historgram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMin in interface IStatsHistogram
Returns:
The min
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMin

public void setMin(double min)
            throws IOException,
                   AutomationException
The minimum value of the historgram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setMin in interface IStatsHistogram
Parameters:
min - The min (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMax

public double getMax()
              throws IOException,
                     AutomationException
The maximum value of the historgram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMax in interface IStatsHistogram
Returns:
The max
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMax

public void setMax(double max)
            throws IOException,
                   AutomationException
The maximum value of the historgram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setMax in interface IStatsHistogram
Parameters:
max - The max (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMean

public double getMean()
               throws IOException,
                      AutomationException
The mean value of the historgram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMean in interface IStatsHistogram
Returns:
The mean
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMean

public void setMean(double mean)
             throws IOException,
                    AutomationException
The mean value of the historgram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setMean in interface IStatsHistogram
Parameters:
mean - The mean (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStdDev

public double getStdDev()
                 throws IOException,
                        AutomationException
The standard deviation value of the historgram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getStdDev in interface IStatsHistogram
Returns:
The stdDev
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setStdDev

public void setStdDev(double stdDev)
               throws IOException,
                      AutomationException
The standard deviation value of the historgram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setStdDev in interface IStatsHistogram
Parameters:
stdDev - The stdDev (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

putHistogramMinmax

public void putHistogramMinmax(double min,
                               double max)
                        throws IOException,
                               AutomationException
Sets histogram min and max range.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
putHistogramMinmax in interface IStatsHistogram
Parameters:
min - The min (in)
max - The max (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryHistogramMinmax

public void queryHistogramMinmax(double[] min,
                                 double[] max)
                          throws IOException,
                                 AutomationException
Gets histogram min and max range.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryHistogramMinmax in interface IStatsHistogram
Parameters:
min - The min (out: use single element array)
max - The max (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHistogram

public Object getHistogram()
                    throws IOException,
                           AutomationException
The histogram values of the statistics.

Remarks

This method returns a single dimensional array of value of size 256. Each value in the array is the normalized count of pixels in the specific bin.

The pixel values in the raster, if they are beyond 0-255, will be binned (or reclassfied) to 0-255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getHistogram in interface IStatsHistogram
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setHistogram

public void setHistogram(Object histogram)
                  throws IOException,
                         AutomationException
The histogram values of the statistics.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setHistogram in interface IStatsHistogram
Parameters:
histogram - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

putStats

public void putStats(double min,
                     double max,
                     double mean,
                     double stdDev)
              throws IOException,
                     AutomationException
Computes stats and histogram from a given Raster.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
putStats in interface IStatsHistogram
Parameters:
min - The min (in)
max - The max (in)
mean - The mean (in)
stdDev - The stdDev (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryStats

public void queryStats(double[] min,
                       double[] max,
                       double[] mean,
                       double[] stdDev)
                throws IOException,
                       AutomationException
Computes stats and histogram from a given Raster.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryStats in interface IStatsHistogram
Parameters:
min - The min (out: use single element array)
max - The max (out: use single element array)
mean - The mean (out: use single element array)
stdDev - The stdDev (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

empty

public void empty()
           throws IOException,
                  AutomationException
Empties this RasterStatsHistogram and marks it invalid.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
empty in interface IStatsHistogram
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

hasStats

public boolean hasStats()
                 throws IOException,
                        AutomationException
Checks if this StatsHistogram has stats.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
hasStats in interface IStatsHistogram
Returns:
The b
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

hasHistogram

public boolean hasHistogram()
                     throws IOException,
                            AutomationException
Checks if this StatsHistogram has histogram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
hasHistogram in interface IStatsHistogram
Returns:
The b
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

accumulate

public void accumulate(double value,
                       int count)
                throws IOException,
                       AutomationException
Accumulates a value and its count.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
accumulate in interface IStatsHistogram
Parameters:
value - The value (in)
count - The count (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

update

public void update()
            throws IOException,
                   AutomationException
Updates the histogram after accumulation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
update in interface IStatsHistogram
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassID

public void getClassID(GUID[] pClassID)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDirty

public void isDirty()
             throws IOException,
                    AutomationException
isDirty

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isDirty in interface IPersistStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

load

public void load(IStream pstm)
          throws IOException,
                 AutomationException
load

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
load in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(IStream pstm,
                 int fClearDirty)
          throws IOException,
                 AutomationException
save

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
save in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
fClearDirty - The fClearDirty (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
                throws IOException,
                       AutomationException
getSizeMax

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSizeMax in interface IPersistStream
Parameters:
pcbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException