Opened 14 years ago

Closed 14 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 14 years ago.
sst.nc (235.0 KB ) - added by shawngong 14 years ago.

Download all attachments as: .zip

Change History (13)

by shawngong, 14 years ago

Attachment: netcdfdataset.cpp added

comment:1 by shawngong, 14 years ago

Type: defectenhancement

by shawngong, 14 years ago

Attachment: sst.nc added

comment:2 by Kyle Shannon, 14 years ago

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 by Kyle Shannon, 14 years ago

Keywords: netcdf added; netCDF removed

comment:4 by Kyle Shannon, 14 years ago

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 by shawngong, 14 years ago

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 by shawngong, 14 years ago

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 by Kyle Shannon, 14 years ago

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 by shawngong, 14 years ago

Thanks Kyle. no problem.

comment:9 by warmerdam, 14 years ago

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 by Kyle Shannon, 14 years ago

Status: newassigned

comment:11 by Kyle Shannon, 14 years ago

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.