Opened 18 years ago
Closed 16 years ago
#1147 closed defect (fixed)
[PATCH] Writing NITF files using UTM Mode and Southern Zones
Reported by: | Owned by: | Even Rouault | |
---|---|---|---|
Priority: | normal | Milestone: | 1.5.0 |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | normal | Keywords: | nitf utm |
Cc: | warmerdam |
Description (last modified by )
When writing NITF files using GDAL's UTM mode, if the input data is georeferenced in a Southern zone, the written file seems to have invalid vertical spacing and extents information. More accurately, both the vertical spacing and the vertical extents of the new image seem to be ten times smaller than those of the input file. The horizontal information appears not to be affected in this way.
Attachments (1)
Change History (6)
comment:1 by , 17 years ago
by , 17 years ago
Attachment: | gdal_svn_trunk_utm_nitf_bug1147.patch added |
---|
Patch to check that UTM northings and eastings are within NITF valid range
comment:3 by , 17 years ago
Milestone: | → 1.5.0 |
---|---|
Priority: | high → normal |
Summary: | Writing NITF files using UTM Mode and Southern Zones → [PATCH] Writing NITF files using UTM Mode and Southern Zones |
comment:4 by , 16 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
Owner: | changed from | to
Even,
Please go ahead and apply your patch. I don't forsee having time to do a good review myself.
comment:5 by , 16 years ago
Keywords: | nitf utm added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Commited in r13212
Note:
See TracTickets
for help on using tickets.
I've been able to reproduce it. I've forged a geotiff whose BBOX is ulx=0° uly=-40° lrx=1° lry=-41° (EPSG:4326) via :
Then I warped into EPSG:32730 (UTM 30 South) :
gdalinfo gives :
Everything is right.
But... if I use EPSG:32630 (UTM 30 North) instead, I get:
This is obviously wrong (indeed, my first try was to chose 32630 before realizing that it was 32730 for southern hemispere...)
Now, let's dig into the code and the spec. We notice that for the IGEOLO record in UTM coordinates we have 2 characters for the UTM zone, 6 for the easting and 7 for the northing. Obviously southern latitudes in northern UTM projection need an extra character for the minus sign. Hence the bug.
There's nothing we can do, expect check that we try to write 8 characters and that there's only room for 7 and in that case warn the user. This should also be done for eastings : if you have a source file which is going "outside" of its UTM band, you may have negative eastings or big positive eastings like -123,456 or 1,234,567 which overflow the 6 characters for eastings.
I also think that there's probably a flow in the NITF specification because I don't see how you can handle a UTM image located in the neighbourhood of the equator and whose upper part is in the northern hemisphere and the lower part in the sounthern. If you choose EPSG:326XX, the southern part will need negative values (as long as your above -1,000,000 / around 9° south, it's OK). If you choose EPSG:327XX, 0° latitude is 10,000,000, so you can't choose it at all.