LoadProjectionFromWKTString

globalmapper.LoadProjectionFromWKTString(str aStr) GM_Error_t32, GM_Projection_t[source]

Initializes a GM_Projection_t structure from a WKT projection string (like would be found in a PRJ file).

Parameters:

aStr (str) – String to decode projection from

Returns:

Error Code

Return type:

GM_Error_t32

Returns:

The decoded projection

Return type:

GM_Projection_t

Example

The following is an example of LoadProjectionFromWKTString.

WKT_str = 'PROJCS["NAD83_New_Hampshire_ft",GEOGCS["GCS_North_American_1983",'
WKT_str += 'DATUM["D_NORTH_AMERICAN_1983",SPHEROID["GRS_1980",6378137,298.257222101]],'
WKT_str += 'PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],'
WKT_str += 'PROJECTION["Transverse_Mercator"],PARAMETER["scale_factor",0.999966667],'
WKT_str += 'PARAMETER["central_meridian",-71.66666666666667],PARAMETER["latitude_of_origin",42.5],'
WKT_str += 'PARAMETER["false_easting",984250],PARAMETER["false_northing",0],'
WKT_str += 'UNIT["Foot_US",0.30480060960121924]]'
err_LoadProjectionFromWKTString, proj = gm.LoadProjectionFromWKTString(WKT_str)

For more context refer to the tutorial page on setting projections.