Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#856 closed defect (fixed)

CDED (usgs) wrong extents north of 68°

Reported by: matt.wilkie@… Owned by: warmerdam
Priority: normal Milestone: 1.5.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: USGS CDED50K
Cc:

Description (last modified by warmerdam)

The cded export screws up north of 68° and exports the west half twice.

gdal_translate --optfile yt_cded.opt -co NTS=117d12e \
-co InternalName=117d12DEMe dem 117d12_e.dem

gdal_translate --optfile yt_cded.opt -co NTS=117d12w \
-co InternalName=117d12DEMw dem 117d12_w.dem

East:
Upper Left  (-140.0002083,  69.7501042) (140d 0'0.75"W, 69d45'0.38"N)
Lower Left  (-140.0002083,  69.4998958) (140d 0'0.75"W, 69d29'59.63"N)
Upper Right (-139.4997917,  69.7501042) (139d29'59.25"W, 69d45'0.38"N)
Lower Right (-139.4997917,  69.4998958) (139d29'59.25"W, 69d29'59.63"N)

West:
Upper Left  (-140.0002083,  69.7501042) (140d 0'0.75"W, 69d45'0.38"N)
Lower Left  (-140.0002083,  69.4998958) (140d 0'0.75"W, 69d29'59.63"N)
Upper Right (-139.4997917,  69.7501042) (139d29'59.25"W, 69d45'0.38"N)
Lower Right (-139.4997917,  69.4998958) (139d29'59.25"W, 69d29'59.63"N)

In this example east top left should be 139.5 (plus/minus the cell offset)

Attachments (3)

yt_cded.opt (240 bytes) - added by maphew 14 years ago.
option file used for the posted commandline
gdalbug856.zip (183.3 KB) - added by maphew 14 years ago.
test case showing bug: source data & script
gdal_svn_trunk_bug856.patch (1.3 KB) - added by Even Rouault 13 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 15 years ago by matt.wilkie@…

>bump<

comment:3 Changed 14 years ago by maphew

Priority: highnormal

I've forgotten the rationale for why this is "wontfix". Can you refresh my memory? thanks.

comment:4 Changed 14 years ago by warmerdam

Description: modified (diff)
Status: newassigned

Matt,

I don't think this is wontfix - it is just not followed up on. If you can provide a dataset, and control file that goes with the above commands, I'll try and look into this soon.

Changed 14 years ago by maphew

Attachment: yt_cded.opt added

option file used for the posted commandline

Changed 14 years ago by maphew

Attachment: gdalbug856.zip added

test case showing bug: source data & script

comment:5 Changed 14 years ago by maphew

Summary: CDED (usgs) wrong extents north of 68°CDED (usgs) wrong extents north of 68°

comment:6 Changed 13 years ago by Even Rouault

Keywords: USGS CDED50K added
Milestone: 1.5.0
Version: unspecifiedsvn-trunk

Although I'm totally unfamiliar with CDED, I've attached a patch that probably fixes the issue.

With it, gdalinfo reports :

gdalinfo 117d12_e.dem :
Upper Left  (-139.5002083,  69.7501042) (139d30'0.75"W, 69d45'0.38"N)
Lower Left  (-139.5002083,  69.4998958) (139d30'0.75"W, 69d29'59.63"N)
Upper Right (-138.9997917,  69.7501042) (138d59'59.25"W, 69d45'0.38"N)
Lower Right (-138.9997917,  69.4998958) (138d59'59.25"W, 69d29'59.63"N)

gdalinfo 117d12_w.dem :
Upper Left  (-140.0002083,  69.7501042) (140d 0'0.75"W, 69d45'0.38"N)
Lower Left  (-140.0002083,  69.4998958) (140d 0'0.75"W, 69d29'59.63"N)
Upper Right (-139.4997917,  69.7501042) (139d29'59.25"W, 69d45'0.38"N)
Lower Right (-139.4997917,  69.4998958) (139d29'59.25"W, 69d29'59.63"N)

Changed 13 years ago by Even Rouault

Attachment: gdal_svn_trunk_bug856.patch added

comment:7 Changed 13 years ago by warmerdam

Component: defaultGDAL_Raster

I have reviewed and applied Even's patch which *seems* reasonable. Matt, would you be able to test this out (from trunk)? If so, I would be willing to back patch it to 1.4 branch after testing.

Patch was r12320.

comment:8 Changed 13 years ago by maphew

I can't test from code right now. My linux machine at work is offline and cygwin does not compile out of the box. I'll try from home this weekend, kids and life permitting. :)

comment:9 Changed 13 years ago by maphew

Resolution: fixed
Status: assignedclosed

The patch seems to have fixed the problem, thank you!

There is a warning message I don't recall seeing before, "Warning 6: 'CDED50K' is an unexpected value for Product creation option of type string-select.". I don't have an old version to test if my memory is correct or not. It appears harmless as diff'ing the output of today's gdal_translate and the hand crafted 117d12_e.dem from a couple of years ago shows no difference.

comment:10 Changed 13 years ago by warmerdam

Matt,

Even recently introduced validation of creation parameters based on the driver metadata describing the available creation parameters. But it seems there was a small typo in this metadata for the USGS DEM driver. I have corrected this (r12593). In the meantime there is no problem, you can just ignore the warning.

Thanks

Note: See TracTickets for help on using tickets.