Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.
No language code for this page. You can select other language.
No language code for this page,
shown in other instead.
shown in other instead.
The DatasetSpatialReference class represents an OpenGIS Spatial Reference System (SRS). The class uses GDAL API to retrieve data from strings in WKT (Well-known text) format.
DatasetSpatialReference(const char * wkt_string = 0)Constructor. Takes a string argument which should be a WKT representation of an SRS.
- const char * wkt_string - Well known text definition to which the object should be initialized.
int isOwner()Returns the owner flag. If the pointer is the owner, on its deletion the DatasetSpatialReference also will be deleted. Use grab() and release() functions to change ownership.
Return valueOwner flag.
void grab()Grabs the DatasetSpatialReference (sets the owner flag to 1). The DatasetSpatialReference should not be handled by the engine after this function is called.
int importFromWkt(const char * wkt_string)Imports the SRS definition from WKT string, wipes the existing one and reassigns it based on the contents of the passed WKT string.
- const char * wkt_string - WKT string.
Return value0 if import succeeds; otherwise, 1.
int setWellKnownGeogCS(const char * str)Sets a GeogCS based on well known name.
- const char * str - Name of well known geographic coordinate system.
The following well known text values are supported:
- WGS84 - same as EPSG:4326 but has no dependence on EPSG data files.
- WGS72 - same as EPSG:4322 but has no dependence on EPSG data files.
- NAD27 - same as EPSG:4267 but has no dependence on EPSG data files.
- NAD83 - same as EPSG:4269 but has no dependence on EPSG data files.
- EPSG:n - n is a GCS or PCS code from the horizontal coordinate system table.
Return value0 on success; otherwise, 1.
void release()Releases the dataset (sets the owner flag to 0). The dataset should be handled by the engine after this function is called.
int isValid()Returns a value indicating if the instance contains valid reference system.
Return value1 if the instance contains valid SRS; otherwise, 0.
Last update: 2018-06-04
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)