I'm rasterizing some wind data from oos.soest.hawaii.edu/erddap/griddap/NCEP_Global_Best to use as an overlay of a final image, but I'm having issues calculating the bounding box of the final image.

Can I safely assume, giving the data is continuous, that each latitude/longitude corresponds to the center of my final pixel? If not, which metadata keys should I have been looking?

In the case that the position is indeed referencing the center of the pixel, then can I say the following?

bounding_south = smallest_latitude - (latitude_resolution / 2)
bounding_north = largest_latitude + (latitude_resolution / 2)

bounding_west = smallest_longitude - (latitude_resolution / 2)
bounding_east = largest_longitude + (latitude_resolution / 2)

Unfortunately I couldn't access the data using gdal_translate to test it.


Doing an ncdump on the data from one of the soest files gives this chunk of metadata for the precipitation flux variable:

    double pratesfc(time, latitude, longitude) ;
            pratesfc:_FillValue = -999000000. ;
            pratesfc:colorBarMaximum = 0.005f ;
            pratesfc:colorBarMinimum = 0.f ;
            pratesfc:coordinates = "time_run time latitude longitude" ;
            pratesfc:ioos_category = "Meteorology" ;
            pratesfc:long_name = "rainfall rate" ;
            pratesfc:missing_value = -999000000. ;
            pratesfc:standard_name = "precipitation_flux" ;
            pratesfc:units = "kg m-2 s-1" ;

The data in netcdf files should correspond exactly to the coordinate points in the file. If you are representing pixels as little squares, (contrary to A Pixel Is Not A Little Square) then each of the data points is a 1-pixel area in the raster, then it would be center-pixel data, and the pixel edges would be +/- resolution/2. wider than the coordinates in the netcdf file.

Your Answer

