|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.coverage.raster.geom.RasterGeoReference
public class RasterGeoReference
The RasterGeoReference
defines methods for transformations between a raster crs and a world crs. For
this purpose the origin of the upper left raster grid and the size in world coordinate units of a raster grid (pixel)
must be specified.
Alternatively an angle between the x axis and a rectangular base axis (as well as y rotation between the y axis and
the rectangular basis) may be defined.
This implementation is world crs axis order aware. See
http://wiki.deegree.org/deegreeWiki/deegree3/RasterInnerOuterIssue for a discussion on the location of the origin on
a raster grid.
Nested Class Summary | |
---|---|
static class |
RasterGeoReference.OriginLocation
The OriginLocation defines the mapping location of the world origin to the underlying raster. |
Constructor Summary | |
---|---|
RasterGeoReference(RasterGeoReference.OriginLocation location,
double resolutionX,
double resolutionY,
double origin0,
double origin1)
Constructs a raster reference with given resolutions and origin. |
|
RasterGeoReference(RasterGeoReference.OriginLocation location,
double resolutionX,
double resolutionY,
double origin0,
double origin1,
CRS crs)
Constructs a raster reference with given resolutions and origin. |
|
RasterGeoReference(RasterGeoReference.OriginLocation location,
double resolutionX,
double resolutionY,
double rotationX,
double rotationY,
double origin0,
double origin1,
CRS crs)
Constructs a raster reference with given resolutions, origin and rotations. |
Method Summary | |
---|---|
RasterRect |
convertEnvelopeToRasterCRS(Envelope envelope)
Converts an envelope in world coordinates to raster coordinates, note the envelope in world coordinates is defined over min/max (lower left/upper right), whereas a RasterRect is defined as min(upperleft) with a width and height. |
static RasterGeoReference |
create(RasterGeoReference.OriginLocation location,
Envelope envelope,
int width,
int height)
Create a raster reference which has it's origin at the min[0] and max[1] of the given Envelope. |
RasterGeoReference |
createRelocatedReference(Envelope envelope)
Returns new RasterGeoReference with the origin set to the min[0],max[1] of the envelope but other values are taken from this instance. |
RasterGeoReference |
createRelocatedReference(RasterGeoReference.OriginLocation targetLocation)
Returns new RasterGeoReference with the origin set to the given target location. |
RasterGeoReference |
createRelocatedReference(RasterGeoReference.OriginLocation targetLocation,
Envelope envelope)
Returns new RasterGeoReference with the origin set to the min[0],max[1] of the envelope and the OriginLocation to the given one. |
Envelope |
getEnvelope(int width,
int height,
CRS crs)
Returns an Envelope for a raster with given size. |
Envelope |
getEnvelope(RasterGeoReference.OriginLocation targetLocation,
int width,
int height,
CRS crs)
Returns an Envelope for a raster with given size. |
Envelope |
getEnvelope(RasterGeoReference.OriginLocation targetLocation,
RasterRect rasterRect,
CRS crs)
Returns an Envelope for a raster with given size and given x,y raster location. |
Envelope |
getEnvelope(RasterRect rasterRect,
CRS crs)
Returns an Envelope for a raster with given size and given x,y raster location. |
double[] |
getOrigin()
|
double[] |
getOrigin(RasterGeoReference.OriginLocation target)
|
RasterGeoReference.OriginLocation |
getOriginLocation()
|
int[] |
getRasterCoordinate(double worldX,
double worldY)
Return the raster coordinate denoted by the given world coordinate. |
double[] |
getRasterCoordinateUnrounded(double worldX,
double worldY)
Return the raster coordinate denoted by the given world coordinate. |
double |
getResolutionX()
|
double |
getResolutionY()
|
double |
getRotationX()
|
double |
getRotationY()
|
int[] |
getSize(Envelope env)
Returns the size in pixel of a raster that extends within given Envelope. |
double[] |
getWorldCoordinate(double rasterX,
double rasterY)
Return the world coordinate denoted by the given raster position. |
static RasterGeoReference |
merger(RasterGeoReference geoRef1,
RasterGeoReference geoRef2)
Merge two Raster references. |
Envelope |
relocateEnvelope(RasterGeoReference.OriginLocation targetLocation,
Envelope envelope)
Relocates the given minimum and maximum points of the given envelope to the target origin location definition. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RasterGeoReference(RasterGeoReference.OriginLocation location, double resolutionX, double resolutionY, double rotationX, double rotationY, double origin0, double origin1, CRS crs)
location
- of the origin on the upper left pixel.resolutionX
- the resolution of one pixel on the x axis in the rasterresolutionY
- the resolution of one pixel on the y axis in the rasterrotationX
- rotation about x-axisrotationY
- rotation about y-axisorigin0
- ordinate of the origin of the first axis defined in the world crsorigin1
- ordinate of the origin of the second axis defined in the world crscrs
- in which the origin is defined.public RasterGeoReference(RasterGeoReference.OriginLocation location, double resolutionX, double resolutionY, double origin0, double origin1, CRS crs)
location
- of the origin on the upper left pixel.resolutionX
- the resolution of one pixel on the x axis in the rasterresolutionY
- the resolution of one pixel on the y axis in the rasterorigin0
- ordinate of the origin of the first axis defined in the world crsorigin1
- ordinate of the origin of the second axis defined in the world crscrs
- in which the origin is defined.public RasterGeoReference(RasterGeoReference.OriginLocation location, double resolutionX, double resolutionY, double origin0, double origin1)
location
- of the origin on the upper left pixel.resolutionX
- the resolution of one pixel on the x axis in the rasterresolutionY
- the resolution of one pixel on the y axis in the rasterorigin0
- ordinate of the origin of the first axis defined in the world crsorigin1
- ordinate of the origin of the second axis defined in the world crsMethod Detail |
---|
public static RasterGeoReference create(RasterGeoReference.OriginLocation location, Envelope envelope, int width, int height)
location
- of the origin can be center or outerenvelope
- to get the appropriate values from.width
- of the underlying raster needed to calculate the resolution.height
- of the underlying raster needed to calculate the resolution.
null
if the given envelope is null
public int[] getRasterCoordinate(double worldX, double worldY)
worldX
- x position in the world coordinate system, for which raster coordinates should be calculated.worldY
- y position in the world coordinate system, for which raster coordinates should be calculated.
public double[] getRasterCoordinateUnrounded(double worldX, double worldY)
worldX
- x position in the world coordinate system, for which raster coordinates should be calculated.worldY
- y position in the world coordinate system, for which raster coordinates should be calculated.
public double[] getWorldCoordinate(double rasterX, double rasterY)
rasterX
- x position in the raster for which world coordinates should be calculated.rasterY
- y position in the raster for which world coordinates should be calculated.
public RasterRect convertEnvelopeToRasterCRS(Envelope envelope)
envelope
- envelope in world coordinates
public Envelope getEnvelope(int width, int height, CRS crs)
width
- in raster coordinatesheight
- in raster coordinatescrs
- the coordinate system for the envelope
public Envelope getEnvelope(RasterRect rasterRect, CRS crs)
rasterRect
- defining the x,y raster coordinates (as integers) as well as the width and height of the raster.crs
- the coordinate system for the envelope
public Envelope getEnvelope(RasterGeoReference.OriginLocation targetLocation, RasterRect rasterRect, CRS crs)
targetLocation
- of the origin, specifies if the the newly created envelope should consider the origin located at the
OUTER or CENTER of a pixel.rasterRect
- defining the x,y raster coordinates (as integers) as well as the width and height of the raster.crs
- the coordinate system for the envelope
public Envelope getEnvelope(RasterGeoReference.OriginLocation targetLocation, int width, int height, CRS crs)
targetLocation
- of the origin, specifies if the the newly created envelope should consider the origin located at the
OUTER or CENTER of a pixel.width
- in raster coordinatesheight
- in raster coordinatescrs
- the coordinate system for the envelope
public int[] getSize(Envelope env)
env
- Envelope for the
public static RasterGeoReference merger(RasterGeoReference geoRef1, RasterGeoReference geoRef2)
geoRef1
- geoRef2
-
public RasterGeoReference createRelocatedReference(Envelope envelope)
envelope
- to get the origin from.
null
if the envelope is null
public RasterGeoReference createRelocatedReference(RasterGeoReference.OriginLocation targetLocation, Envelope envelope)
targetLocation
- envelope
- to get the origin from.
null
if the envelope is null
public RasterGeoReference createRelocatedReference(RasterGeoReference.OriginLocation targetLocation)
targetLocation
- of the new reference
null
or equals this one.public Envelope relocateEnvelope(RasterGeoReference.OriginLocation targetLocation, Envelope envelope)
RasterGeoReference
's origin location. This
method effectively adds or subtracts half a resolution of the ordinates of the given Envelope. Different CRS's
are supported.
targetLocation
- the preferred location of the origin. *envelope
- to relocate.
null
if the envelope is
null
public double[] getOrigin()
public double[] getOrigin(RasterGeoReference.OriginLocation target)
target
- the location the new origin, may be null
public double getResolutionX()
public double getResolutionY()
public double getRotationX()
public double getRotationY()
public RasterGeoReference.OriginLocation getOriginLocation()
public String toString()
toString
in class Object
|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |