operation_from_geogtran¶
- geodetic_engine.persistablereference.operation_from_geogtran(wkt)[source]¶
Build the coordinate operation an ESRI
GEOGTRANstates.ESRI’s
GEOGTRANis not standard WKT and PROJ will not read one, so its parameters are translated here exactly as they are inside a persistableReference, which is this same definition in a JSON envelope. Use it when a register hands over the transformation on its own.- Parameters:
wkt (
str) – TheGEOGTRAN, without an envelope around it.- Return type:
- Returns:
The operation, ready to be applied or bound to a CRS.
- Raises:
MalformedReferenceError – If the WKT cannot be read, or states something other than a
GEOGTRAN.UnsupportedReferenceError – If it states a vertical transformation.
UnsupportedMethodError – If it states a method or parameter this package will not translate.
UnresolvableGridError – If a grid-based step names a dataset that resolves to no single grid in PROJ’s database.
Example
>>> ed50 = ( ... 'GEOGCS["GCS_European_1950",DATUM["D_European_1950",' ... 'SPHEROID["International_1924",6378388.0,297.0]],' ... 'PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]' ... ) >>> wgs84 = ( ... 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",' ... 'SPHEROID["WGS_1984",6378137.0,298.257223563]],' ... 'PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]' ... ) >>> operation = operation_from_geogtran( ... f'GEOGTRAN["ED_1950_To_WGS_1984_1",{ed50},{wgs84},' ... 'METHOD["Geocentric_Translation"],' ... 'PARAMETER["X_Axis_Translation",-87.0],' ... 'PARAMETER["Y_Axis_Translation",-98.0],' ... 'PARAMETER["Z_Axis_Translation",-121.0]]' ... ) >>> operation.method_name 'Geocentric translations (geog2D domain)' >>> [p.value for p in operation.params] [-87.0, -98.0, -121.0]