Changeset 13470

Show
Ignore:
Timestamp:
01/01/08 12:47:27 (7 months ago)
Author:
warmerdam
Message:

Remove spaces from numeric field values before writing to avoid unnecessary
quoting.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/ogr/ogrsf_frmts/gmt/ogrgmtlayer.cpp

    r12774 r13470  
    758758        for( iField = 0; iField < poFeatureDefn->GetFieldCount(); iField++ ) 
    759759        { 
     760            OGRFieldType eFType=poFeatureDefn->GetFieldDefn(iField)->GetType(); 
    760761            const char *pszRawValue = poFeature->GetFieldAsString(iField); 
    761762            char *pszEscapedVal; 
     
    763764            if( iField > 0 ) 
    764765                osFieldData += "|"; 
     766 
     767            // We don't want prefix spaces for numeric values. 
     768            if( eFType == OFTInteger || eFType == OFTReal ) 
     769                while( *pszRawValue == ' ' ) 
     770                    pszRawValue++; 
    765771 
    766772            if( strchr(pszRawValue,' ') || strchr(pszRawValue,'|')