FAILURE MAP
← Case archive

FA-70286 / Map projection transforms / Open access

World file to corner geotransform and pixel centre: file line order · case 01

Rotated rasters are skewed the wrong way after import.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The world-file lines are unpacked in row-major matrix order A, B, D, E, swapping the two rotation terms.

THE FAILURE

The world-file lines are unpacked in row-major matrix order A, B, D, E, swapping the two rotation terms.

Unsuccessful approach: The rotation terms are restored but the translation lines are swapped, moving the raster across the map.

Case contract

Input [lines, col, row] where lines are the six world-file values in file order A, D, B, E, C, F: A and E are the pixel sizes, D and B the rotation terms, and (C, F) the map coordinate of the centre of the upper-left pixel. Return the corner-based geotransform [C - A/2 - B/2, A, B, F - D/2 - E/2, D, E] followed by the centre of pixel (col, row): C + A*col + B*row and F + D*col + E*row; all rounded to 6 decimals.

Why this case matters

GIS tools interchange world files and corner-origin geotransforms; the half-pixel convention and line order are classic sources of half-pixel and rotated-raster shifts.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    lines, col, row = x
    A, B, D, E, C, Fy = lines
    gt = [C - A / 2 - B / 2, A, B, Fy - D / 2 - E / 2, D, E]
    cx = C + A * col + B * row
    cy = Fy + D * col + E * row
    return [round(v, 6) for v in gt + [cx, cy]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[30.0, 0.0, 0.0, -30.0, 500015.0, 4199985.0], 48, 33], [500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 501455.0, 4198995.0]), ('control #1', [[0.25, 0.0, 0.0, -0.25, -179.875, 89.875], 50, 35], [-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -167.375, 81.125]), ('control #2', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 32, 32], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1081.25, 4947.6]), ('control #3', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 9, 49], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 241.5, 429.0]), ('control #4', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 25, 48], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5]), ('control #5', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 40, 44], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]), ('control #10', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 27, 23], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5])], [('control #1', [[0.25, 0.0, 0.0, -0.25, -179.875, 89.875], 50, 35], [-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -167.375, 81.125]), ('control #3', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 9, 49], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 241.5, 429.0]), ('control #5', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 40, 44], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]), ('control #6', [[30.0, 0.0, 0.0, -30.0, 500015.0, 4199985.0], 30, 3], [500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 500915.0, 4199895.0]), ('control #7', [[0.25, 0.0, 0.0, -0.25, -179.875, 89.875], 39, 7], [-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -170.125, 88.125]), ('control #10', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 27, 23], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]), ('control #22', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 43, 39], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 43.5, 39.5])], [('control #2', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 32, 32], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1081.25, 4947.6]), ('control #5', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 40, 44], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]), ('control #8', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 3, 25], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1019.75, 4950.0]), ('control #9', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 30, 23], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 529.5, 731.0]), ('control #10', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 27, 23], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5]), ('control #11', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 3, 46], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 184.0, -33.0]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]), ('control #22', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 43, 39], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 43.5, 39.5])], [('control #3', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 9, 49], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 241.5, 429.0]), ('control #4', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 25, 48], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5]), ('control #8', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 3, 25], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1019.75, 4950.0]), ('control #11', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 3, 46], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 184.0, -33.0]), ('control #12', [[30.0, 0.0, 0.0, -30.0, 500015.0, 4199985.0], 5, 40], [500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 500165.0, 4198785.0]), ('control #13', [[0.25, 0.0, 0.0, -0.25, -179.875, 89.875], 14, 18], [-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -176.375, 85.375]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]), ('control #22', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 43, 39], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 43.5, 39.5])], [('control #4', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 25, 48], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5]), ('control #5', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 40, 44], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]), ('control #9', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 30, 23], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 529.5, 731.0]), ('control #14', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 1, 32], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1019.25, 4935.2]), ('control #15', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 35, 23], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 579.5, 741.0]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]), ('control #17', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 17, 23], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 219.5, 68.0]), ('control #22', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 43, 39], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 43.5, 39.5])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
control #0[500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 501455.0, 4198995.0][500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 501455.0, 4198995.0]Passed
control #1[-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -167.375, 81.125][-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -167.375, 81.125]Passed
control #2[1000.05, 2.0, 0.4, 4999.55, 0.5, -2.0, 1078.05, 4950.8][1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1081.25, 4947.6]Failed
control #3[292.5, 10.0, 2.0, 907.5, -3.0, -10.0, 486.5, 384.0][295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 241.5, 429.0]Failed
control #4[0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5][0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5]Passed
control #5[98.0, 5.0, -1.0, 201.75, 1.5, -5.0, 256.0, 40.0][96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]Failed
control #10[0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5][0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5]Passed
control #16[0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5][0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]Passed

SHA-256 / 108d31a2226216db915c70a4a7df70c779c12349e5a4483bd76200cdc3948d2c

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    lines, col, row = x
    A, D, B, E, Fy, C = lines
    gt = [C - A / 2 - B / 2, A, B, Fy - D / 2 - E / 2, D, E]
    cx = C + A * col + B * row
    cy = Fy + D * col + E * row
    return [round(v, 6) for v in gt + [cx, cy]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[30.0, 0.0, 0.0, -30.0, 500015.0, 4199985.0], 48, 33], [500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 501455.0, 4198995.0]), ('control #1', [[0.25, 0.0, 0.0, -0.25, -179.875, 89.875], 50, 35], [-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -167.375, 81.125]), ('control #2', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 32, 32], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1081.25, 4947.6]), ('control #3', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 9, 49], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 241.5, 429.0]), ('control #4', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 25, 48], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5]), ('control #5', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 40, 44], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]), ('control #10', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 27, 23], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5])], [('control #1', [[0.25, 0.0, 0.0, -0.25, -179.875, 89.875], 50, 35], [-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -167.375, 81.125]), ('control #3', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 9, 49], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 241.5, 429.0]), ('control #5', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 40, 44], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]), ('control #6', [[30.0, 0.0, 0.0, -30.0, 500015.0, 4199985.0], 30, 3], [500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 500915.0, 4199895.0]), ('control #7', [[0.25, 0.0, 0.0, -0.25, -179.875, 89.875], 39, 7], [-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -170.125, 88.125]), ('control #10', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 27, 23], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]), ('control #22', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 43, 39], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 43.5, 39.5])], [('control #2', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 32, 32], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1081.25, 4947.6]), ('control #5', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 40, 44], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]), ('control #8', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 3, 25], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1019.75, 4950.0]), ('control #9', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 30, 23], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 529.5, 731.0]), ('control #10', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 27, 23], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5]), ('control #11', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 3, 46], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 184.0, -33.0]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]), ('control #22', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 43, 39], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 43.5, 39.5])], [('control #3', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 9, 49], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 241.5, 429.0]), ('control #4', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 25, 48], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5]), ('control #8', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 3, 25], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1019.75, 4950.0]), ('control #11', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 3, 46], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 184.0, -33.0]), ('control #12', [[30.0, 0.0, 0.0, -30.0, 500015.0, 4199985.0], 5, 40], [500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 500165.0, 4198785.0]), ('control #13', [[0.25, 0.0, 0.0, -0.25, -179.875, 89.875], 14, 18], [-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -176.375, 85.375]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]), ('control #22', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 43, 39], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 43.5, 39.5])], [('control #4', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 25, 48], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5]), ('control #5', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 40, 44], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]), ('control #9', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 30, 23], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 529.5, 731.0]), ('control #14', [[2.0, 0.4, 0.5, -2.0, 1001.25, 4998.8], 1, 32], [1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1019.25, 4935.2]), ('control #15', [[10.0, 2.0, -3.0, -10.0, 298.5, 901.0], 35, 23], [295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 579.5, 741.0]), ('control #16', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 0, 18], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]), ('control #17', [[5.0, -1.0, 1.5, -5.0, 100.0, 200.0], 17, 23], [96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 219.5, 68.0]), ('control #22', [[1.0, 0.0, 0.0, 1.0, 0.5, 0.5], 43, 39], [0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 43.5, 39.5])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
control #0[4199970.0, 30.0, 0.0, 500030.0, 0.0, -30.0, 4201425.0, 499025.0][500000.0, 30.0, 0.0, 4200000.0, 0.0, -30.0, 501455.0, 4198995.0]Failed
control #1[89.75, 0.25, 0.0, -179.75, 0.0, -0.25, 102.375, -188.625][-180.0, 0.25, 0.0, 90.0, 0.0, -0.25, -167.375, 81.125]Failed
control #2[4997.55, 2.0, 0.5, 1002.05, 0.4, -2.0, 5078.8, 950.05][1000.0, 2.0, 0.5, 4999.6, 0.4, -2.0, 1081.25, 4947.6]Failed
control #3[897.5, 10.0, -3.0, 302.5, 2.0, -10.0, 844.0, -173.5][295.0, 10.0, -3.0, 905.0, 2.0, -10.0, 241.5, 429.0]Failed
control #4[0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5][0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 25.5, 48.5]Passed
control #5[196.75, 5.0, 1.5, 103.0, -1.0, -5.0, 466.0, -160.0][96.75, 5.0, 1.5, 203.0, -1.0, -5.0, 366.0, -60.0]Failed
control #10[0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5][0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 27.5, 23.5]Passed
control #16[0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5][0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 18.5]Passed

SHA-256 / d0e971fdc77c7b3df93e9035e9946f3e4a68bccfdbf3bba83ee8121687cb85bb

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Stipulated deterministic toy contract on a bounded input domain; results are rounded as stated and no conformance with any published standard or library is claimed. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:48:19.345621+00:00.

Case digest / e5ff911c0f2fdfc65bcfc97f79d4a9946e485b7a41402f57141631355288c3e7