This page has been translated automatically.
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

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 ownership

Return 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 0

int 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 0

void 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
Build: ()