Changeset 10146

Show
Ignore:
Timestamp:
10/24/06 13:32:49 (2 years ago)
Author:
fwarmerdam
Message:

added the force_cellsize option, and a warning when dx/dy are used.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/frmts/aaigrid/aaigriddataset.cpp

    r10039 r10146  
    2929 * 
    3030 * $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 * 
    3134 * Revision 1.38  2006/09/26 18:15:47  fwarmerdam 
    3235 * Emit CELLSIZE when adfGeoTransform[5] is positive. 
     
    773776    double      adfGeoTransform[6]; 
    774777    char        szHeader[2000]; 
     778    const char *pszForceCellsize =  
     779        CSLFetchNameValue( papszOptions, "FORCE_CELLSIZE" ); 
    775780 
    776781    poSrcDS->GetGeoTransform( adfGeoTransform ); 
    777782 
    778783    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)) ) 
    780786        sprintf( szHeader,  
    781787                 "ncols        %d\n"  
     
    789795                 adfGeoTransform[1] ); 
    790796    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" ); 
    791805        sprintf( szHeader,  
    792806                 "ncols        %d\n"  
     
    801815                 adfGeoTransform[1], 
    802816                 fabs(adfGeoTransform[5]) ); 
     817    } 
    803818 
    804819/* -------------------------------------------------------------------- */ 
     
    10231038                                   "Byte UInt16 Int16 Float32" ); 
    10241039 
     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 
    10251045        poDriver->pfnOpen = AAIGDataset::Open; 
    10261046        poDriver->pfnCreateCopy = AAIGCreateCopy;