|
Array with georeferencing support. More...
#include <GeoFrame.h>
Public Member Functions | |
GeoFrame (unsigned int width=0, unsigned int height=0) | |
Default constructor. | |
void | reset () |
bool | projectionIsSet () const |
Returns true, if the geographical extent has been set. | |
bool | geometryIsSet () const |
Return true, if array area is greater than zero. | |
bool | bboxIsSet () const |
Returns true, if the bounding box (geographical extent) has been set. More... | |
bool | isDefined () const |
Returns true, if the projection, array area and geographical extent bounding box has been set. More... | |
virtual void | setGeometry (unsigned int width, unsigned int height) |
int | getFrameWidth () const |
Return the nominal width, not the width of the memory array which does not have to be allocated. | |
int | getFrameHeight () const |
Return the nominal height, not the height of the memory array which does not have to be allocated. | |
void | setBoundingBox (double lonLL, double latLL, double lonUR, double latUR) |
Sets bounding box in degrees OR in metres in the target coordinate system. More... | |
void | setBoundingBox (const drain::Rectangle< double > &bbox) |
Sets bounding box in degrees in the target coordinate system. | |
void | setBoundingBoxD (double lonLL, double latLL, double lonUR, double latUR) |
Sets bounding box in degrees in the target coordinate system. | |
void | setBoundingBoxD (const drain::Rectangle< double > &bboxD) |
Sets bounding box in degrees in the target coordinate system. | |
void | setBoundingBoxR (double lonLL, double latLL, double lonUR, double latUR) |
Sets bounding box in radians in the target coordinate system. | |
void | setBoundingBoxR (const drain::Rectangle< double > &bboxR) |
Sets bounding box in radians in the target coordinate system. | |
void | setBoundingBoxM (double xLL, double yLL, double xUR, double yUR) |
Sets bounding box in meters in the target coordinate system. More... | |
void | setBoundingBoxM (const drain::UniTuple< double, 4 > &bboxM) |
Sets bounding box in meters in the target coordinate system. | |
const drain::Rectangle< double > & | getBoundingBoxDeg () const |
Returns the geographical scope in Degrees. | |
const drain::Rectangle< double > & | getBoundingBoxNat () const |
Returns the geographical scope in Meters. | |
const drain::Rectangle< double > & | getBoundingBoxRad () const |
Returns the geographical scope in Radians. | |
void | getCenterPixel (drain::Rectangle< double > &pixelD) const |
double | getXScale () const |
Return horizontal resolution of a pixel in meters (if metric) or degrees (if unprojected, "latlon"). | |
double | getYScale () const |
Return vertical resolution of a pixel in meters (if metric) or degrees (if unprojected, "latlon"). | |
void | cropWithM (drain::Rectangle< double > &bboxM) |
Crops the initial bounding box with a given bounding box. | |
void | cropWithM (double xLL, double yLL, double xUR, double yUR) |
Crops the initial bounding box with a given bounding box. More... | |
virtual void | deg2pix (double lon, double lat, int &i, int &j) const |
Projects geographic coordinates to image coordinates. | |
void | deg2pix (const drain::Point2D< double > &loc, drain::Point2D< int > &pix) const |
Project geographic coordinates to image coordinates. | |
virtual void | deg2m (double lon, double lat, double &x, double &y) const |
Convert metric coordinates to degrees. | |
void | deg2m (const drain::Point2D< double > &pDeg, drain::Point2D< double > &pMet) const |
virtual void | pix2deg (int i, int j, double &lon, double &lat) const |
Calculates the geographic coordinates of the center of a pixel at (i,j). | |
virtual void | pix2rad (int i, int j, double &lon, double &lat) const |
Calculates the geographic coordinates [rad] of the center of a pixel at (i,j). | |
void | pix2deg (const drain::Point2D< int > &pix, drain::Point2D< double > &loc) const |
Calculates the geographic coordinates of the center of a pixel at (i,j). | |
virtual void | pix2LLdeg (int i, int j, double &lon, double &lat) const |
Calculates the geographic coordinates of the lower left corner of a pixel at (i,j). | |
virtual void | m2deg (double x, double y, double &lon, double &lat) const |
Convert metric coordinates to degrees. | |
virtual void | m2deg (const drain::Point2D< double > &pMetric, drain::Point2D< double > &pDeg) const |
Convert metric coordinates to degrees. | |
virtual void | m2pix (double x, double y, int &i, int &j) const |
Scales geographic map coordinates to image coordinates. More... | |
virtual void | m2pix (const drain::Point2D< double > &pMetric, drain::Point2D< int > &pImage) const |
virtual void | pix2m (int i, int j, double &x, double &y) const |
Scales image coordinates (i,j) to geographic map coordinates (x,y) in the pixel centres. More... | |
virtual void | pix2m (const drain::Point2D< int > &pImage, drain::Point2D< double > &pMetric) const |
virtual void | pix2LLm (int i, int j, double &x, double &y) const |
Scales image coordinates (i,j) to geographic map coordinates (x,y) of the lower left corner pixel. More... | |
void | setProjection (const std::string &projDef) |
Sets the projection of the image as a Proj string. | |
void | setProjectionEPSG (int epsg) |
Sets the projection of the image as a EPSG code. | |
void | updateProjection () |
Updates bboxex, if needed. | |
const std::string & | getProjection () const |
Returns the projection of the composite image as a proj4 std::string. | |
const std::string & | getCoordinateSystem () const |
Returns the source projection (should be radian array, lon & lat). | |
const drain::Rectangle< double > & | getDataBBoxNat () const |
Return the actual geographical boundingBox suggested by implied by input data. | |
const drain::Rectangle< double > & | getDataOverlapBBoxNat () const |
Return the common overlapping geographical area (intersection) implied by input data. | |
void | updateDataExtentDeg (const drain::Rectangle< double > &inputBBoxDeg) |
Extend to include this input. More... | |
void | updateDataExtentNat (const drain::Rectangle< double > &inputBBoxNat) |
bool | isLongLat () const |
virtual std::ostream & | toStream (std::ostream &ostr) const |
Public Attributes | |
drain::Proj6 | projGeo2Native |
Radial to metric. | |
Protected Member Functions | |
void | updateBoundingBoxR () |
Proj 6 NEW: Given BBox in geo coords [deg], adjust geo coords [rad]. More... | |
void | updateBoundingBoxD () |
Given BBox in geo coords [rad], adjust geo coords [deg]. More... | |
void | updateBoundingBoxM () |
Given BBox in geo coords [rad], adjust metric bounding box. Do not update xScale or yScale. | |
void | updateScaling () |
Geometric scaling. More... | |
Protected Attributes | |
int | frameWidth |
int | frameHeight |
drain::Rectangle< double > | bBoxR |
Geographical scope in Radians. | |
drain::Rectangle< double > | bBoxD |
Geographical scope in Degrees. | |
drain::Rectangle< double > | bBoxNative |
Geographical scope in meters, or degrees in case of long/lat. | |
drain::Rectangle< double > | dataBBoxNat |
For deriving extent (~union) of input data. | |
drain::Rectangle< double > | dataOverlapBBoxNat |
For deriving common extent (~intersection) of input data. | |
double | xScale = 0.0 |
Utility for deriving extent (degrees) required by input data. More... | |
double | yScale = 0.0 |
Array with georeferencing support.
|
inline |
Returns true, if the bounding box (geographical extent) has been set.
Problem: sometimes bbox will be initisalized to negative "direction" to make it adapt to a (set of) new bounding box(es).
void cropWithM | ( | double | xLL, |
double | yLL, | ||
double | xUR, | ||
double | yUR | ||
) |
Crops the initial bounding box with a given bounding box.
Reset area and rescale
|
inline |
Returns true, if the projection, array area and geographical extent bounding box has been set.
This function is used in creating single-radar products where the bounding box will be matched to that of the radar scope, by default.
|
inlinevirtual |
Scales geographic map coordinates to image coordinates.
|
inlinevirtual |
Scales image coordinates (i,j) to geographic map coordinates (x,y) of the lower left corner pixel.
|
inlinevirtual |
Scales image coordinates (i,j) to geographic map coordinates (x,y) in the pixel centres.
void setBoundingBox | ( | double | lonLL, |
double | latLL, | ||
double | lonUR, | ||
double | latUR | ||
) |
Sets bounding box in degrees OR in metres in the target coordinate system.
Checks if a coordinate looks like degrees, that is, longitude is within [-90,+90] and latitude within [-180,+180]. Assumes that small absolute values suggest degrees, larger are metres. Projection has to be set prior to setting metric bbox.
void setBoundingBoxM | ( | double | xLL, |
double | yLL, | ||
double | xUR, | ||
double | yUR | ||
) |
Sets bounding box in meters in the target coordinate system.
Set exact metric bbox
|
protected |
Given BBox in geo coords [rad], adjust geo coords [deg].
Return vertical resolution of a pixel in meters (if metric) or degrees (if unprojected, "latlon").
Return vertical resolution of a pixel in meters (if metric) or degrees (if unprojected, "latlon"). Assuming up-to-date bbox [rad], adjust bbox [deg]
|
protected |
Proj 6 NEW: Given BBox in geo coords [deg], adjust geo coords [rad].
Assuming up-to-date bbox [rad], adjust bbox [deg].
void updateDataExtentDeg | ( | const drain::Rectangle< double > & | inputBBoxDeg | ) |
Extend to include this input.
Book keeping of input bbox.
void updateDataExtentNat | ( | const drain::Rectangle< double > & | inputBBoxNat | ) |
Native means that rectangular shapes will not be distorted.
|
protected |
Geometric scaling.
Notice: changed! For LatLon, consider approx? See composite.
|
protected |
Utility for deriving extent (degrees) required by input data.
Utility for deriving extent (degrees) required by input data