ilog.views.maps.geometry
Class IlvMapRaster

java.lang.Object
  extended by ilog.views.maps.IlvMapGeometry
      extended by ilog.views.maps.geometry.IlvMapArea
          extended by ilog.views.maps.geometry.IlvMapRaster

public class IlvMapRaster
extends IlvMapArea

This class defines a raster. A raster is a georeferenced array of values. It is defined on a rectangular area and has a value for each point in this area. It can be used, for example, to represent terrain elevations, atmospheric pressures, temperatures, and so on.

Since:
ILOG JViews 3.0

Constructor Summary
IlvMapRaster(IlvCoordinate upperLeftCorner, IlvCoordinate lowerRightCorner, int columns, int rows, short[] values)
          Initializes an instance of IlvMapRaster.
IlvMapRaster(IlvCoordinate upperLeftCorner, IlvCoordinate lowerRightCorner, int columns, int rows, short[] values, short unknownValue)
          Initializes an instance of IlvMapRaster that contains unknown values.
 
Method Summary
 boolean contains(IlvCoordinate c)
          Returns true if c is contained in the object.
 Rectangle2D getBounds(Rectangle2D result)
          Returns the bounds of this IlvMapGeometry
 int getColumns()
          Returns the number of columns in the raster.
 IlvCoordinate getLowerRightCorner()
          Returns the lower-right corner of the raster.
 IlvMapCurve getOutline()
          Returns the curve that represents the outline of this raster.
 int getRows()
          Returns the number of rows in the raster.
 IlvCoordinate getUpperLeftCorner()
          Returns the upper-left corner of the raster.
 short getValue(IlvCoordinate point)
          Returns the value of the raster at the specified point, expressed in the projection system of the geometry.
 short getValue(int column, int row)
          Returns the value corresponding to the given column and row.
 short[] getValues()
          Returns the array of values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMapRaster

public IlvMapRaster(IlvCoordinate upperLeftCorner,
                    IlvCoordinate lowerRightCorner,
                    int columns,
                    int rows,
                    short[] values,
                    short unknownValue)
Initializes an instance of IlvMapRaster that contains unknown values.

Parameters:
upperLeftCorner - Upper-left corner of the raster.
lowerRightCorner - Lower-right corner of the raster.
columns - Number of columns in the raster.
rows - Number of rows in the raster.
values - Array of values. The value of row y and of column x is accessed by values[y * columns + x]. The value of row 0 and column 0 is at the upper-left corner of the rectangle.
unknownValue - Value meaning "unknown value".

IlvMapRaster

public IlvMapRaster(IlvCoordinate upperLeftCorner,
                    IlvCoordinate lowerRightCorner,
                    int columns,
                    int rows,
                    short[] values)
Initializes an instance of IlvMapRaster.

Parameters:
upperLeftCorner - Upper-left corner of the raster.
lowerRightCorner - Lower-right corner of the raster.
columns - Number of columns in the raster.
rows - Number of rows in the raster.
values - Array of values. The value of row y and of column x is accessed by values[y * columns + x]. The value of row 0 and column 0 is at the upper-left corner of the rectangle.
Method Detail

getValues

public short[] getValues()
Returns the array of values.


getRows

public int getRows()
Returns the number of rows in the raster.


getColumns

public int getColumns()
Returns the number of columns in the raster.


getUpperLeftCorner

public IlvCoordinate getUpperLeftCorner()
Returns the upper-left corner of the raster.


getLowerRightCorner

public IlvCoordinate getLowerRightCorner()
Returns the lower-right corner of the raster.


getValue

public short getValue(int column,
                      int row)
               throws IlvMapUnknownValueException
Returns the value corresponding to the given column and row.

Parameters:
column - Column in the raster array.
row - Row in the raster array.
Throws:
IlvMapUnknownValueException - if the value is unknown.

getValue

public short getValue(IlvCoordinate point)
               throws IlvMapUnknownValueException
Returns the value of the raster at the specified point, expressed in the projection system of the geometry. The method computes the row and the column of the point and calls the getValue(column, row) method.

Parameters:
point - Point at which the value is queried, expressed in the projection coordinate system of the feature.
Throws:
IlvMapUnknownValueException - if the value is unknown or if the point is out of the area of the raster.

contains

public boolean contains(IlvCoordinate c)
Returns true if c is contained in the object.

Specified by:
contains in class IlvMapArea
Parameters:
c - The point to be checked.
Returns:
true if c is contained in the object.
Since:
JViews 3.5

getOutline

public IlvMapCurve getOutline()
Returns the curve that represents the outline of this raster. The outline of the image is a polyline created from the corner points of the image, in the following order:

Specified by:
getOutline in class IlvMapArea
Returns:
The outline of this raster.
Since:
JViews 3.5

getBounds

public Rectangle2D getBounds(Rectangle2D result)
Returns the bounds of this IlvMapGeometry

Specified by:
getBounds in class IlvMapGeometry


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.