You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Usually the first band should be latitude_offset and the second longitude_offset.')
129
143
eliflat_offset_idx>0orlon_offset_idx>0:
130
144
returninfos, warnings, ["One of the band is tagged with Description = latitude_offset/longitude_offset but not the other one"]
145
+
elifeasting_offset_idx>0andnorthing_offset_idx>0:
146
+
ifeasting_offset_idx!=1ornorthing_offset_idx!=2:
147
+
infos.append(
148
+
'Usually the first band should be easting_offset and the second northing_offset.')
149
+
elifeasting_offset_idx>0ornorthing_offset_idx>0:
150
+
returninfos, warnings, ["One of the band is tagged with Description = easting_offset/northing_offset but not the other one"]
131
151
else:
132
-
ifis_first_subds:
133
-
warnings.append(
134
-
'No explicit bands tagged with Description = latitude_offset and longitude_offset. Assuming first one is latitude_offset and second one longitude_offset')
135
-
lat_offset_idx=1
136
-
lon_offset_idx=2
152
+
ifsrc_crsandsrc_crs.IsProjected():
153
+
ifis_first_subds:
154
+
warnings.append(
155
+
'No explicit bands tagged with Description = easting_offset and northing_offset. Assuming first one is easting_offset and second one northing_offset')
156
+
easting_offset_idx=1
157
+
northing_offset_idx=2
158
+
else:
159
+
ifis_first_subds:
160
+
warnings.append(
161
+
'No explicit bands tagged with Description = latitude_offset and longitude_offset. Assuming first one is latitude_offset and second one longitude_offset')
"One of easting_offset/northing_offset band is missing units description.metre will be assumed")
197
+
elifunitsnotin ('metre'):
198
+
errors.append(
199
+
"One of easting_offset/northing_offset band is using a unit not supported by PROJ")
161
200
162
-
positive_value=ds.GetRasterBand(
163
-
lon_offset_idx).GetMetadataItem('positive_value')
164
-
ifnotpositive_value:
165
-
ifis_first_subds:
166
-
warnings.append(
167
-
"The latitude_offset band should include a positive_value=west/east metadata item, to avoid any ambiguity w.r.t NTv2 original convention. 'east' will be assumed")
168
-
elifpositive_valuenotin ('west', 'east'):
169
-
errors.append("positive_value=%s not supported by PROJ"%
170
-
positive_value)
201
+
iflon_offset_idx:
202
+
positive_value=ds.GetRasterBand(
203
+
lon_offset_idx).GetMetadataItem('positive_value')
204
+
ifnotpositive_value:
205
+
ifis_first_subds:
206
+
warnings.append(
207
+
"The latitude_offset band should include a positive_value=west/east metadata item, to avoid any ambiguity w.r.t NTv2 original convention. 'east' will be assumed")
208
+
elifpositive_valuenotin ('west', 'east'):
209
+
errors.append("positive_value=%s not supported by PROJ"%
0 commit comments