900,912c900,941
<                 poDS->bGotGeoTransform = TRUE;
< 		    
<                 poDS->adfGeoTransform[0] = pdfXCoord[0];
<                 poDS->adfGeoTransform[3] = pdfYCoord[0];
<                 poDS->adfGeoTransform[2] = 0;
<                 poDS->adfGeoTransform[4] = 0;
<                 poDS->adfGeoTransform[1] = (( pdfXCoord[xdim-1] - 
<                                               pdfXCoord[0] ) / 
<                                             ( poDS->nRasterXSize - 1 ));
< 
<                 poDS->adfGeoTransform[5] = (( pdfYCoord[ydim-1] - 
<                                               pdfYCoord[0] ) / 
<                                             ( poDS->nRasterYSize - 1 ));
---
> 			/* ----------------------------------------------------------*/
> 			/*    In the following "actual_range" and "node_offset"      */
> 			/*    are attributes used by netCDF files created by GMT.    */
> 			/*    If we find them we know how to proceed. Else, use      */
> 			/*    the original algorithm.                                */
> 			/* --------------------------------------------------------- */
> 			double	dummy[2], xMinMax[2], yMinMax[2];
> 			int	node_offset = 0;
>                         poDS->bGotGeoTransform = TRUE;
> 
>                         nc_get_att_int (cdfid, NC_GLOBAL, "node_offset", &node_offset);
> 
> 			if (!nc_get_att_double (cdfid, nVarDimXID, "actual_range", dummy)) {
> 				xMinMax[0] = dummy[0];		xMinMax[1] = dummy[1];
> 			}
> 			else {
> 				xMinMax[0] = pdfXCoord[0],	xMinMax[1] = pdfXCoord[xdim-1];
> 				node_offset = 0;
> 			}
> 
> 			if (!nc_get_att_double (cdfid, nVarDimYID, "actual_range", dummy)) {
> 				yMinMax[0] = dummy[0];		yMinMax[1] = dummy[1];
> 			}
> 			else {
> 				yMinMax[0] = pdfYCoord[0];	yMinMax[1] = pdfYCoord[ydim-1];
> 				node_offset = 0;
> 			}
> 			// Check for reverse order of y-coordinate
> 			if ( yMinMax[0] > yMinMax[1] ) {
> 				dummy[0] = yMinMax[1],		dummy[1] = yMinMax[0];
> 				yMinMax[0] = dummy[0],		yMinMax[1] = dummy[1];
> 			}
> 
>                         poDS->adfGeoTransform[0] = xMinMax[0];
>                         poDS->adfGeoTransform[2] = 0;
>                         poDS->adfGeoTransform[3] = yMinMax[1];
>                         poDS->adfGeoTransform[4] = 0;
> 			poDS->adfGeoTransform[1] = ( xMinMax[1] - xMinMax[0] ) / 
> 						   ( poDS->nRasterXSize + (node_offset - 1) );
> 			poDS->adfGeoTransform[5] = ( yMinMax[0] - yMinMax[1] ) / 
> 						   ( poDS->nRasterYSize + (node_offset - 1) );
> 
916,917c945,948
<                 poDS->adfGeoTransform[0] = pdfXCoord[0]
<                     - (poDS->adfGeoTransform[1] / 2);
---
> 			if ( !node_offset ) {	// Otherwise its already the pixel center
>                         	poDS->adfGeoTransform[0] -= (poDS->adfGeoTransform[1] / 2);
>                         	poDS->adfGeoTransform[3] -= (poDS->adfGeoTransform[5] / 2);
> 			}
919,922c950,951
<                 poDS->adfGeoTransform[3] = pdfYCoord[0]
<                     - (poDS->adfGeoTransform[5] / 2);
< 
<                 oSRS.exportToWkt( &(poDS->pszProjection) );
---
> 			oSRS.exportToWkt( &(poDS->pszProjection) );
> 		    

