GeoEco.Datasets.NumpyGrid.GetSpatialReference

NumpyGrid.GetSpatialReference(srType)

Returns the spatial reference of this dataset.

Parameters:

srType (str) –

Type of spatial reference that should be returned:

  • WKT - a WKT string in standard OGC format.

  • ArcGIS - a WKT string in ESRI format, typically obtained from a dataset produced by ArcGIS. (The ESRI format differs from the OGC standard; various projections and parameters are named differently and certain nodes are not recognized. See the OSR documentation for more information.)

  • Proj4 - a string in the format recognized by the Proj4 library.

  • Obj - an instance of the osgeo.osr.SpatialReference class.

An osgeo.osr.SpatialReference instance is stored internally. If 'Obj' is requested, a reference to this instance is returned, not a copy of it, allowing you to make changes to the internal instance. This behavior is by design. Take care not to make changes unintentionally. Use ConvertSpatialReference() to obtain a deep copy of the instance, if needed.

If something other than 'Obj' is requested, a string of the specified type is exported from the internal osgeo.osr.SpatialReference instance and returned.

Allowed values꞉ 'WKT', 'ArcGIS', 'Proj4', 'Obj'.

Returns:

Spatial reference of the requested type, either a string, an osgeo.osr.SpatialReference instance, or None.

If the dataset does not support a spatial reference (e.g. it is a plain table), or it does support a spatial reference but it has never been set, None will be returned, except if srType is 'ArcGIS', in which case the '{B286C06B-0879-11D2-AACA-00C04FA33C20}' will be returned. ArcGIS uses this string to represent the “Unknown” spatial reference.

Return type:

object