Changeset 10146
- Timestamp:
- 10/24/06 13:32:49 (2 years ago)
- Files:
-
- trunk/frmts/aaigrid/aaigriddataset.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/frmts/aaigrid/aaigriddataset.cpp
r10039 r10146 29 29 * 30 30 * $Log$ 31 * Revision 1.39 2006/10/24 17:32:49 fwarmerdam 32 * added the force_cellsize option, and a warning when dx/dy are used. 33 * 31 34 * Revision 1.38 2006/09/26 18:15:47 fwarmerdam 32 35 * Emit CELLSIZE when adfGeoTransform[5] is positive. … … 773 776 double adfGeoTransform[6]; 774 777 char szHeader[2000]; 778 const char *pszForceCellsize = 779 CSLFetchNameValue( papszOptions, "FORCE_CELLSIZE" ); 775 780 776 781 poSrcDS->GetGeoTransform( adfGeoTransform ); 777 782 778 783 if( ABS(adfGeoTransform[1]+adfGeoTransform[5]) < 0.0000001 779 || ABS(adfGeoTransform[1]-adfGeoTransform[5]) < 0.0000001 ) 784 || ABS(adfGeoTransform[1]-adfGeoTransform[5]) < 0.0000001 785 || (pszForceCellsize && CSLTestBoolean(pszForceCellsize)) ) 780 786 sprintf( szHeader, 781 787 "ncols %d\n" … … 789 795 adfGeoTransform[1] ); 790 796 else 797 { 798 if( pszForceCellsize == NULL ) 799 CPLError( CE_Warning, CPLE_AppDefined, 800 "Producing a Golden Surfer style file with DX and DY instead\n" 801 "of CELLSIZE since the input pixels are non-square. Use the\n" 802 "FORCE_CELLSIZE=TRUE creation option to force use of DX for\n" 803 "even though this will be distorted. Most ASCII Grid readers\n" 804 "(ArcGIS included) do not support the DX and DY parameters.\n" ); 791 805 sprintf( szHeader, 792 806 "ncols %d\n" … … 801 815 adfGeoTransform[1], 802 816 fabs(adfGeoTransform[5]) ); 817 } 803 818 804 819 /* -------------------------------------------------------------------- */ … … 1023 1038 "Byte UInt16 Int16 Float32" ); 1024 1039 1040 poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST, 1041 "<CreationOptionList>\n" 1042 " <Option name='FORCE_CELLSIZE' type='boolean' description='Force use of CELLSIZE, default is FALSE.'/>\n" 1043 "</CreationOptionList>\n" ); 1044 1025 1045 poDriver->pfnOpen = AAIGDataset::Open; 1026 1046 poDriver->pfnCreateCopy = AAIGCreateCopy;
