Unigine::DatasetRasterPosResolver Class
Header: | #include <UnigineDataset.h> |
This class is used to perform conversion between raster(x, y) and geodetic (latitude, longitude) coordinates.
DatasetRasterPosResolver Class
Members
void getGeodeticPosition(int x, int y, double & latitude, double & longitude)
Performs conversion of raster coordinates (x, y) of a given point to geodetic coordinates (latitude, longitude) and puts them to latitude and longitude respectively.Arguments
- int x - X coordinate.
- int y - Y coordinate.
- double & latitude - Latitude coordinate.
- double & longitude - Longitude coordinate.
double getOriginX()
Returns the X coordinate of the origin.Return value
X coordinate of the origin.double getOriginY()
Returns the Y coordinate of the origin.Return value
Y coordinate of the origin.int isOwner()
Returns the owner flag. If the pointer is the owner, on its deletion the DatasetRasterPosResolver also will be deleted. Use grab() and release() functions to change ownershipReturn value
Owner flag.const char * getProjection()
Returns current projection reference string.Return value
Projection reference string.int getRasterPosition(double latitude, double longitude, int & x, int & y)
Performs conversion of geodetic coordinates (latitude, longitude) of a given point to raster coordinates (x, y) and puts them to x and y respectively.Arguments
- double latitude - Latitude coordinate.
- double longitude - Longitude coordinate.
- int & x - X coordinate.
- int & y - Y coordinate.
Return value
1 if resulting X coordinate is in the range [0, RasterSize_X] and Y coordinate is in the range [0, RasterSize_Y]; otherwise 0int getRasterPosition(double latitude, double longitude, float & x, float & y)
Performs conversion of geodetic coordinates (latitude, longitude) of a given point to raster coordinates (x, y) and puts them to x and y respectively.Arguments
- double latitude - Latitude coordinate.
- double longitude - Longitude coordinate.
- float & x - X coordinate.
- float & y - Y coordinate.
Return value
1 if resulting X and Y coordinates are in the range [0.0f, 1.0f]; otherwise 0void getRasterPositions(double * latitudes, double * longitude, int size, int * ret_x, int * ret_y, bool * ret_pixels)
Performs conversion of geodetic coordinates (latitude, longitude) of given points specified in corresponding arrays to raster coordinates (x, y) and puts them to corresponding return arrays.Arguments
- double * latitudes - Array with latitude coordinates.
- double * longitude - Array with longitude coordinates.
- int size - Number of elements in coordinate arrays.
- int * ret_x - Return array with X coordinates.
- int * ret_y - Return array with Y coordinates.
- bool * ret_pixels - Array of conversion results, where each element corresponding to a certain point is determined as follows: 1 if resulting X coordinate is in the range [0, RasterSize_X] and Y coordinate is in the range [0, RasterSize_Y]; otherwise 0
void getRasterPositions(double * latitudes, double * longitude, int size, float * ret_x, float * ret_y, bool * ret_pixels)
Performs conversion of geodetic coordinates (latitude, longitude) of given points specified in corresponding arrays to raster coordinates (x, y) and puts them to corresponding return arrays.Arguments
- double * latitudes - Array with latitude coordinates.
- double * longitude - Array with longitude coordinates.
- int size - Number of elements in coordinate arrays.
- float * ret_x - Return array with X coordinates.
- float * ret_y - Return array with Y coordinates.
- bool * ret_pixels - Array of conversion results, where each element corresponding to a certain point is determined as follows: 1 if resulting X and Y coordinates are in the range [0.0f, 1.0f]; otherwise 0
int getRasterSizeX()
Returns raster size along the X axis.Return value
Raster size along the X axis.int getRasterSizeY()
Returns raster size along the Y axis.Return value
Raster size along the Y axis.double getResolutionX()
Returns resolution along the X axis.Return value
Resolution along the X axis.double getResolutionY()
Returns resolution along the Y axis.Return value
Resolution along the Y axis.Ptr<DatasetRasterPosResolver> create(const double * geotransform, const char * projection, int size_x, int size_y)
Creates a DatasetRasterPosResolver with specified parameters.Arguments
- const double * geotransform - A GDAL geotransform array:
- geotransform[0] - top left x
- geotransform[1] - w-e pixel resolution
- geotransform[2] - rotation, 0 if image is "north up"
- geotransform[3] - top left y
- geotransform[4] - rotation, 0 if image is "north up"
- geotransform[5] - n-s pixel resolution
- const char * projection - Projection reference string.
- int size_x - Size along the X axis.
- int size_y - Size along the Y axis.
Return value
DatasetRasterPosResolver smart pointer.void grab()
Grabs the DatasetRasterPosResolver (sets the owner flag to 1). The DatasetRasterPosResolver should not be handled by the engine after this function is called.void release()
Releases the dataset (sets the owner flag to 0). The dataset should be handled by the engine after this function is called.Last update: 2017-12-21
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)