Opened 10 years ago

Closed 10 years ago

#3563 closed enhancement (invalid)

netCDF for western hemisphere

Reported by: shawngong Owned by: Kyle Shannon
Priority: normal Milestone: 1.8.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: netcdf
Cc: warmerdam

Description

I have sea surface temperature (SST) in netCDF. They display longitudes as >180deg instead of negative values for western hemisphere. I have revised the netCDF driver to correct this problem.

Attachments (2)

netcdfdataset.cpp (85.2 KB) - added by shawngong 10 years ago.
sst.nc (235.0 KB) - added by shawngong 10 years ago.

Download all attachments as: .zip

Change History (13)

Changed 10 years ago by shawngong

Attachment: netcdfdataset.cpp added

comment:1 Changed 10 years ago by shawngong

Type: defectenhancement

Changed 10 years ago by shawngong

Attachment: sst.nc added

comment:2 Changed 10 years ago by Kyle Shannon

Cc: Kyle Shannon added
Component: defaultGDAL_Raster
Milestone: 1.8.0

Shawn, could you submit the changes as patches? It is easier for people to see what has been changed and easier to test. Just by searching, I assume the changes are on lines 1048-1059. Are there any other changes? Thanks.

comment:3 Changed 10 years ago by Kyle Shannon

Keywords: netcdf added; netCDF removed

comment:4 Changed 10 years ago by Kyle Shannon

Shawn, can you tell me what version of gdal you are working with? I took a look at the file you attached, and I think there will be an issue with projected coordinate systems. I will drop it in and test it when you confirm what changes you made. Thanks.

comment:5 Changed 10 years ago by shawngong

Hi Kyle,

Thank you for taking look at this. You are right that changes are on lines 1048-1059.

There used to be another revision that takes care of the y-flip issue (your email mentioned that). But I don't see the problem any more and assume it had been taken care of.

Sorry I don't know how to submit patches instead of the whole file.

Shawn

comment:6 Changed 10 years ago by shawngong

Hi Kyle,

I can confirm that the y-flip issue has been fixed in the release 1.7.1. I last saw in svn-stable-2009.05.14.

So only the above mentioned longitude to be done here.

Shawn

comment:7 Changed 10 years ago by Kyle Shannon

Shawn, I am a little hesitant on applying this patch. Your patch does not distinguish between projected and geographic coordinate systems, meaning projected systems would be altered even though they shouldn't. I suspect I can try to handle this with some tests on the file's header. When I implement more writing functionality, I will try my best to comply with CF-1.x convention when writing the file with gdal. It appears that CF uses +/- 180 deg for the most part. I am fairly busy right now, but I will try to apply it with the proper checking soon. Thanks for your patience.

kss

comment:8 Changed 10 years ago by shawngong

Thanks Kyle. no problem.

comment:9 Changed 10 years ago by warmerdam

Cc: warmerdam added; Kyle Shannon removed
Owner: changed from warmerdam to Kyle Shannon

I would note that it is acceptable for geographic datasets to represent themselves as being in the range 0 to 360 instead of -180 to 180. I'm a bit nervous about arbitrarily changing this in some drivers. Formally turning the ticket over to Kyle.

comment:10 Changed 10 years ago by Kyle Shannon

Status: newassigned

comment:11 Changed 10 years ago by Kyle Shannon

Resolution: invalid
Status: assignedclosed

I agree with Frank's comment above. I think this should be left up to the creator, and not changed arbitrarily by the driver. Closing.

Note: See TracTickets for help on using tickets.