[thredds] GeotiffWriter writeGrid method

Hi,

When testing GeoTIFF GetCoverage on THREDDS WCS, the result geotiff file 
corners and origin differs by a very small fraction in comparison to the 
original netCDF file (it is on EPSG:4326 so LatLon projection).

Thus, I am wondering what is the real intention of geoShiftDataAtLon and 
geoShiftGetXstart in writeGrid method in GeotiffWriter.java class.

public void writeGrid(String fileName, String gridName, int time, int level, 
boolean greyScale, LatLonRect pt) throws IOException {
...
        if (gcs.isLatLon()) {
            Array lon = xaxis.read();
            data   = geoShiftDataAtLon(data, lon);
            xStart = geoShiftGetXstart(lon, xInc);
            //xStart = -180.0;
        }
...
}

Regards,

Hendy

ORIGINAL NETCDF FILE
====================
Driver: netCDF/Network Common Data Format
Files: melb4326.nc
Size is 8990, 6284
Coordinate System is:
GEOGCS["unknown",
    DATUM["unknown",
        SPHEROID["Spheroid",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (144.496170150548124,-36.486543928430414)
Pixel Size = (0.000310407241244,-0.000310407241244)
Metadata:
  NC_GLOBAL#Conventions=CF-1.0
  NC_GLOBAL#AREA_OR_POINT=Area
  Band1#grid_mapping=crs
  Band1#long_name=GDAL Band Number 1
  lon#standard_name=longitude
  lon#long_name=longitude
  lon#units=degrees_east
  lat#standard_name=latitude
  lat#long_name=latitude
  lat#units=degrees_north
  crs#grid_mapping_name=latitude_longitude
  crs#longitude_of_prime_meridian=0
  crs#semi_major_axis=6378137
  crs#inverse_flattening=298.257223563
Corner Coordinates:
Upper Left  ( 144.4961702, -36.4865439) (144d29'46.21"E, 36d29'11.56"S)
Lower Left  ( 144.4961702, -38.4371430) (144d29'46.21"E, 38d26'13.71"S)
Upper Right ( 147.2867312, -36.4865439) (147d17'12.23"E, 36d29'11.56"S)
Lower Right ( 147.2867312, -38.4371430) (147d17'12.23"E, 38d26'13.71"S)
Center      ( 145.8914507, -37.4618435) (145d53'29.22"E, 37d27'42.64"S)
Band 1 Block=8990x1 Type=Byte, ColorInterp=Undefined
  NoData Value=0
  Metadata:
    NETCDF_VARNAME=Band1

GeoTIFF_Float GetCoverage result file
=====================================
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" does not end in 
null byte
Warning 1: TIFFFetchNormalTag:Incompatible type for "GDALNoDataValue"; tag 
ignored
Driver: GTiff/GeoTIFF
Files: melb4326Band1WcsBboxNotSetGeoTIFF_Float.tiff
Size is 8990, 6284
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (144.496322631835938,-36.486699132051037)
Pixel Size = (0.000310407241244,-0.000310407241244)
Metadata:
  TIFFTAG_SOFTWARE=nc2geotiff
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 144.4963226, -36.4866991) (144d29'46.76"E, 36d29'12.12"S)
Lower Left  ( 144.4963226, -38.4372982) (144d29'46.76"E, 38d26'14.27"S)
Upper Right ( 147.2868837, -36.4866991) (147d17'12.78"E, 36d29'12.12"S)
Lower Right ( 147.2868837, -38.4372982) (147d17'12.78"E, 38d26'14.27"S)
Center      ( 145.8916032, -37.4619987) (145d53'29.77"E, 37d27'43.20"S)
Band 1 Block=8990x1 Type=Float32, ColorInterp=Gray



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the thredds archives: