GeoEco.Datasets.Virtual.FastMarchingDistanceGrid.ConvertSpatialReference

classmethod FastMarchingDistanceGrid.ConvertSpatialReference(srType, sr, outputSRType)

Converts a spatial reference from one format to another, such as an OGC WKT string to a Proj4 string.

Parameters:
  • srType (str) –

    The type of spatial reference you are providing for sr:

    • 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.

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

  • sr (object) – Spatial reference of the type specified by srType, or None for an “undefined” spatial reference.

  • outputSRType (str) –

    The type of spatial reference to return. The allowed values are the same as for srType.

    If srType and outputSRType are the same, a copy of the input spatial reference will be returned. If they are 'Obj', a deep copy of the input osgeo.osr.SpatialReference instance will be created by initializing a new instance from the OGC WKT exported from the input instance.

    If sr is None, None will be returned, except if outputSRType is 'ArcGIS', in which case the string '{B286C06B-0879-11D2-AACA-00C04FA33C20}' will be returned. ArcGIS uses this string to represent the “Unknown” spatial reference.

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

Returns:

Spatial reference resulting from the conversion, either a string, an osgeo.osr.SpatialReference instance, or None.

Return type:

object