MCPcopy Index your code
hub / github.com/MapServer/MapServer / InvGeoTransform

Function InvGeoTransform

mapresample.c:48–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46/************************************************************************/
47
48int InvGeoTransform( double *gt_in, double *gt_out )
49
50{
51 double det, inv_det;
52
53 /* we assume a 3rd row that is [1 0 0] */
54
55 /* Compute determinate */
56
57 det = gt_in[1] * gt_in[5] - gt_in[2] * gt_in[4];
58
59 if( fabs(det) < 0.000000000000001 )
60 return 0;
61
62 inv_det = 1.0 / det;
63
64 /* compute adjoint, and devide by determinate */
65
66 gt_out[1] = gt_in[5] * inv_det;
67 gt_out[4] = -gt_in[4] * inv_det;
68
69 gt_out[2] = -gt_in[2] * inv_det;
70 gt_out[5] = gt_in[1] * inv_det;
71
72 gt_out[0] = ( gt_in[2] * gt_in[3] - gt_in[0] * gt_in[5]) * inv_det;
73 gt_out[3] = (-gt_in[1] * gt_in[3] + gt_in[0] * gt_in[4]) * inv_det;
74
75 return 1;
76}
77
78#if defined(USE_PROJ) && defined(USE_GDAL)
79

Callers 6

msRasterQueryByRectLowFunction · 0.85
msInitProjTransformerFunction · 0.85
msResampleGDALToMapFunction · 0.85
msMapComputeGeotransformFunction · 0.85
msMapSetFakedExtentFunction · 0.85
msDrawRasterLayerGDALFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected