Commit 1924122
committed
Route sidecar georef tags through the sidecar's bytes (#2315)
The local eager reader and the metadata-only path both swap pixel
bytes over to the sidecar when the selected IFD lives there, but the
georef extraction call right below the swap still passed the base
file's data + header.byte_order. This worked under the usual GDAL
convention -- sidecar IFDs carry no geokeys -- but silently broke when
a sidecar declared its own GeoKeyDirectory or model tags.
extract_geo_info_with_overview_inheritance now accepts an optional
sidecar_origin mapping from id(ifd) to (data, byte_order). When the
selected IFD is in the mapping AND declares one of the georef-bearing
tags (33550, 33922, 34264, 34735), the helper resolves tag offsets
against the sidecar's bytes. Sidecars without geokeys still inherit
from the base file's level-0 IFD as before.
Both call sites (_reader.py and __init__.py:_read_geo_info) now build
and forward the mapping.
Includes a synthetic regression test covering both cases: sidecar
with its own ModelPixelScale / ModelTiepoint / GeoKeyDirectory, and
sidecar with those tags stripped (today's GDAL-convention behavior).1 parent bb12555 commit 1924122
4 files changed
Lines changed: 466 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
284 | 289 | | |
285 | 290 | | |
286 | 291 | | |
287 | 292 | | |
288 | 293 | | |
289 | 294 | | |
290 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
291 | 304 | | |
292 | 305 | | |
293 | | - | |
| 306 | + | |
| 307 | + | |
294 | 308 | | |
295 | 309 | | |
296 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1088 | 1117 | | |
1089 | 1118 | | |
1090 | 1119 | | |
1091 | 1120 | | |
1092 | 1121 | | |
1093 | 1122 | | |
1094 | 1123 | | |
| 1124 | + | |
1095 | 1125 | | |
1096 | 1126 | | |
1097 | 1127 | | |
| |||
1141 | 1171 | | |
1142 | 1172 | | |
1143 | 1173 | | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1144 | 1187 | | |
1145 | 1188 | | |
1146 | 1189 | | |
1147 | 1190 | | |
1148 | 1191 | | |
1149 | | - | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1150 | 1204 | | |
1151 | 1205 | | |
1152 | 1206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
234 | 244 | | |
235 | 245 | | |
236 | | - | |
| 246 | + | |
| 247 | + | |
237 | 248 | | |
238 | 249 | | |
239 | 250 | | |
| |||
0 commit comments