This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
FAQ
Программирование
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
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::Dataset Class

Header: #include <UnigineDataset.h>
Read More

Dataset Class

Members


static DatasetPtr create ( ) #

Constructor. Creates a new dataset.

const char * getCreationData ( ) #

Returns a list of space separated data types supported by the format of the dataset.

Return value

Dataset format data types.

const char * getCreationOption ( ) #

Returns options specified for the format of the dataset.

Return value

Dataset format options.

const char * getDescription ( ) #

Returns the description of the format of the dataset.

Return value

Dataset format description.

const char * getProjection ( ) #

Returns a string that defines the projection coordinate system of the image in OpenGIS WKT format.

Return value

String with the projection coordinate system.

Vector< int > getRasterBandHistogramm ( int num, double v_min, double v_max, int num_buckets ) #

Calculates histogram for the specified raster band. Note that the bucket size is: (v_max - v_min) / num_buckets.

Arguments

  • int num - Raster band number.
  • double v_min - Lower bound of the histogram.
  • double v_max - Upper bound of the histogram.
  • int num_buckets - Number of buckets in the histogram.

Return value

Vector to which the calculated histogram will be put.

const char * getRasterColorName ( int num ) #

Returns the name of color representation for the given raster band of the dataset.

Arguments

  • int num - Raster band number.

Return value

Name of color representation.

int getRasterCount ( ) #

Returns the number of raster bands in the dataset.

Return value

Number of raster bands.

int getRasterImage ( int num, const Ptr<Image> & image, int offset_x = 0, int offset_y = 0, int scale = 1 ) #

Writes the region of the raster band with the specified offsets into the given image. The size of the region corresponds to the size of the given image. If the raster band less that the image, the whole raster band will be written.
Notice
Only R8, R16, R32F types of the pixel values of the raster band are supported.

Arguments

  • int num - Raster band number.
  • const Ptr<Image> & image - Image into which the raster band should be read.
  • int offset_x - Pixel offset to the top left corner of the region of the band to be written. To start from the left, 0 should be specified.
  • int offset_y - Line offset to the top left corner of the region of the band to be written. To start from the top, 0 should be specified.
  • int scale - Scale factor.

Return value

1 if the region has been read successfully; otherwise, 0.

int getRasterImageAllBands ( const Ptr<Image> & image, int offset_x = 0, int offset_y = 0, int scale = 1 ) #

Writes the regions of all the raster band with the specified offsets into the given images. The size of the region corresponds to the size of the given image. If the raster band size less that the image size, the whole raster band will be written. The function processes only 3 or 4 raster bands (an image must be of theRGB format for 3 bands or the RGBA format for 4 bands).
Notice
Only RGB8, RGB16, RGB32F, RGBA8, RGBA16, RGBA32F types of the pixel values of the raster bands are supported. Pixels of all the raster bands must be of the same type.

Arguments

  • const Ptr<Image> & image - Image into which the raster bands should be read.
  • int offset_x - Pixel offset to the top left corner of the region of the band to be accessed. To start from the left, 0 should be specified.
  • int offset_y - Line offset to the top left corner of the region of the band to be accessed. To start from the top, 0 should be specified.
  • int scale - Scale factor.

Return value

1 if the regions have been read successfully; otherwise, 0.

double getRasterMaximumValue ( int num ) #

Returns the maximum value for the specified raster band of the dataset.

Arguments

  • int num - Raster band number.

Return value

Maximum raster value.

double getRasterMinimumValue ( int num ) #

Returns the minimum value for the specified raster band of the dataset.

Arguments

  • int num - Raster band number.

Return value

Minimum raster value.

double getRasterNoDataValue ( int num ) #

Returns the no data value for the specified raster band of the dataset. The no data value for a band is a special marker value used to mark pixels that are not valid data. Such pixels should generally not be displayed, nor contribute to analysis operations.

Arguments

  • int num - Raster band number.

Return value

No data value.

double getRasterOffset ( int num ) #

Returns the offset value for the specified raster band of the dataset.

Arguments

  • int num - Raster band number.

Return value

Raster offset value.

Ptr<DatasetRasterPosResolver> getRasterPosResolver ( ) #

Returns a current DatasetRasterPosResolver.

Return value

DatasetRasterPosResolver smart pointer.

double getRasterScale ( int num ) #

Returns the scale value for the given raster band of the dataset.

Arguments

  • int num - Raster band number.

Return value

Raster scale.

int getRasterSizeX ( ) #

Returns the width of raster bands of the dataset.

Return value

Raster width in pixels.

int getRasterSizeY ( ) #

Returns the height of raster bands of the dataset.

Return value

Raster height in pixels.

const char * getRasterTypeName ( int num ) #

Returns the name for the data type of the specified raster band of the dataset.

Arguments

  • int num - Raster band number.

Return value

Name of the data type.

const char * getRasterUnitType ( int num ) #

Returns the name of the units of the raster band values.

Arguments

  • int num - Raster band number.

Return value

Name of the units.

int setVectorAttributeFilter ( int num, const char * filter ) #

This method sets the attribute query string to be used when fetching features via the vectorFeatureReadNext() method. Only features for which the query evaluates as true will be returned.

The query string should be in the format of an SQL WHERE clause. For instance: "population > 1000000 and population < 5000000", where population is an attribute in the layer. The query format is normally a restricted form of SQL WHERE clause. In some cases (RDBMS backed drivers) the native capabilities of the database may be used to interpret the WHERE clause in which case the capabilities will be broader than those of OGR SQL.

Notice
Note that installing a query string will generally result in resetting the current reading position (vectorFeatureReadReset()).

Arguments

  • int num - Layer index in the vector dataset.
  • const char * filter - Query in restricted SQL WHERE format, or NULL to clear the current query.

Return value

OGRERR_NONE if successfully installed, or an error code if the query expression is incorrect, or some other failure occurs.

int getVectorCount ( ) #

Returns the number of layers in the vector dataset.

Return value

Number of layers in the vector dataset.

int getVectorFieldCount ( int num ) #

Returns the number of field definitions in the given layer of the vector dataset.

Arguments

  • int num - Layer index in the vector dataset.

Return value

Number of layer field definitions.

int findVectorField ( int num, const char * name ) #

Finds the field definition of the current feature of the given layer by the given name and returns its index.

Arguments

  • int num - Layer index in the vector dataset.
  • const char * name

Return value

Field definition index if there is a field definition with the given name; otherwise, -1.

const char * getVectorFieldName ( int num, int field ) #

Returns the name of the given field definition of the current feature of the given layer.

Arguments

  • int num - Layer index in the vector dataset.
  • int field - Field definition index.

Return value

Field definition name.

int getVectorFieldType ( int num, int field ) #

Returns the type of the given field definition of the current feature of the given layer.

Arguments

  • int num - Layer index in the vector dataset.
  • int field - Field definition index.

Return value

Field type value.

Variable getVectorFieldValue ( int num, int field ) #

Returns the value of the given field definition of the current feature of the given layer.

Arguments

  • int num - Layer index in the vector dataset.
  • int field - Field definition index.

Return value

Field value.

const char * getVectorName ( int num ) #

Returns the name of the given layer of the vector dataset.

Arguments

  • int num - Layer index in the vector dataset.

Return value

Name of the layer.

void setVectorSpatialFilter ( int num, const Math::dvec3 & min_val, const Math::dvec3 & max_val ) #

Sets a bounding box for the data that is obtained via vectorFeatureReadNext(). The vector dataset from the data inside this bounding box only will be passed.

Arguments

  • int num - Layer index in the vector dataset.
  • const Math::dvec3 & min_val - Start coordinates of the bounding box.
  • const Math::dvec3 & max_val - End coordinates for the bounding box.

int getVectorSurfaceCount ( int num ) #

Returns the number of surfaces of the current feature in the given Layer.

Arguments

  • int num - Layer index in the vector dataset.

Return value

Number of surfaces.

Math::dvec3 getVectorSurfacePoint ( int num, int surface, int point ) #

Returns coordinates of the surface point in the current feature of the given layer.

Arguments

  • int num - Layer index in vector dataset.
  • int surface - Surface index from which to get point coordinates.
  • int point - Surface point index.

Return value

Surface point coordinates.

int getVectorSurfacePointCount ( int num, int surface ) #

Returns the number of surface points in the current feature of the given layer.

Arguments

  • int num - Layer index in vector dataset.
  • int surface - Surface index from which to get points.

Return value

Number of surface points.

Vector< Math::dvec3 > getVectorSurfacePoints ( int num, int surface ) #

Returns coordinates of all of the surface points in the current feature of the given layer.

Arguments

  • int num - Layer index in vector dataset.
  • int surface - Surface index from which to get points.

Return value

Array of surface points coordinates.

int calcVectorBounds ( Math::dvec3 & min_val, Math::dvec3 & max_val ) #

Arguments

  • Math::dvec3 & min_val
  • Math::dvec3 & max_val

void clear ( ) #

Clears the dataset.

void clearVectorSpatialFilter ( int num ) #

Clears the coordinates of the bounding box set via setVectorSpatialFilter().

Arguments

  • int num - Layer index in vector dataset.

int hasRasterRGBColorTable ( int num ) #

Returns a value indicating if there is a raster RGB table for a given band.

Arguments

  • int num - Band number.

Return value

1 if there is a raster RGB table for a given band; otherwise, 0.

int load ( const char * name ) #

Loads the given dataset.

Arguments

  • const char * name - Dataset name (a path to a file with raster or vector data).

Return value

1 if dataset has been loaded successfully; otherwise, 0.

int vectorFeatureReadNext ( int num ) #

Reads the next available feature from the given layer.
Notice
The setVectorSpatialFilter() allows to set a bounding box for the data that will be obtained. The vector dataset from the data inside this bounding box only will be passed.

Arguments

  • int num - Layer index in vector dataset.

Return value

1 if the feature exists; otherwise, 0.

void vectorFeatureReadReset ( int num ) #

Resets feature reading to start on the first feature.

Arguments

  • int num - Layer index in vector dataset.

int rasterizeIntoMask ( int num, const char * output_path, const Vector< String > & filters, int width, int height ) #

Rasterizes the specified vector dataset layer and saves it to the specified output path.

Arguments

  • int num - Layer index in vector dataset.
  • const char * output_path - Path to which the rasterized vector dataset layer is to be saved.
  • const Vector< String > & filters -

    Queries in restricted SQL WHERE clause format to be evaluated against the datasource to produce a virtual layer of features to be rasterized. For instance: "population > 1000000 and population < 5000000", where population is an attribute in the layer.

    Each filter is represented by a separate raster band.

    Notice
    The maximum supported number of filters is 4.
  • int width - Output raster mask width, in pixels.
  • int height - Output raster mask height, in pixels.

Return value

1 if the specified vector dataset layer was successfully rasterized; otherwise, 0.
Last update: 25.12.2019
Build: ()