Changeset 11087
- Timestamp:
- 03/26/07 23:55:12 (2 years ago)
- Files:
-
- branches/1.4/gdal/ogr/ogrfeature.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.4/gdal/ogr/ogrfeature.cpp
r10646 r11087 956 956 if (iSpecialField >= 0) 957 957 { 958 // special field value accessors958 // special field value accessors 959 959 switch (iSpecialField) 960 960 { 961 case SPF_FID:961 case SPF_FID: 962 962 snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%ld", GetFID() ); 963 963 return m_pszTmpFieldValue = CPLStrdup( szTempBuffer ); 964 case SPF_OGR_GEOMETRY: 965 return poGeometry->getGeometryName(); 966 case SPF_OGR_STYLE: 967 return GetStyleString(); 968 case SPF_OGR_GEOM_WKT: 969 { 970 if (poGeometry->exportToWkt( &m_pszTmpFieldValue ) == OGRERR_NONE ) 971 return m_pszTmpFieldValue; 972 else 973 return ""; 974 } 975 default: 964 965 case SPF_OGR_GEOMETRY: 966 if( poGeometry ) 967 return poGeometry->getGeometryName(); 968 else 969 return ""; 970 971 case SPF_OGR_STYLE: 972 if( GetStyleString() == NULL ) 973 return ""; 974 else 975 return GetStyleString(); 976 977 case SPF_OGR_GEOM_WKT: 978 { 979 if( poGeometry == NULL ) 980 return ""; 981 982 if (poGeometry->exportToWkt( &m_pszTmpFieldValue ) == OGRERR_NONE ) 983 return m_pszTmpFieldValue; 984 else 985 return ""; 986 } 987 988 default: 976 989 return ""; 977 990 } … … 1007 1020 { 1008 1021 snprintf( szFormat, TEMP_BUFFER_SIZE, "%%%d.%df", 1009 poFDefn->GetWidth(), poFDefn->GetPrecision() );1022 poFDefn->GetWidth(), poFDefn->GetPrecision() ); 1010 1023 } 1011 1024 else … … 1044 1057 if( nMinutes == 0 ) 1045 1058 snprintf( szTempBuffer+strlen(szTempBuffer), 1046 TEMP_BUFFER_SIZE, "%02d", nHours );1059 TEMP_BUFFER_SIZE, "%02d", nHours ); 1047 1060 else 1048 1061 snprintf( szTempBuffer+strlen(szTempBuffer), 1049 TEMP_BUFFER_SIZE, "%02d%02d", nHours, nMinutes );1062 TEMP_BUFFER_SIZE, "%02d%02d", nHours, nMinutes ); 1050 1063 } 1051 1064 … … 1055 1068 { 1056 1069 snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%04d/%02d/%02d", 1057 pauFields[iField].Date.Year,1058 pauFields[iField].Date.Month,1059 pauFields[iField].Date.Day );1070 pauFields[iField].Date.Year, 1071 pauFields[iField].Date.Month, 1072 pauFields[iField].Date.Day ); 1060 1073 1061 1074 return m_pszTmpFieldValue = CPLStrdup( szTempBuffer ); … … 1064 1077 { 1065 1078 snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%2d:%02d:%02d", 1066 pauFields[iField].Date.Hour,1067 pauFields[iField].Date.Minute,1068 pauFields[iField].Date.Second );1079 pauFields[iField].Date.Hour, 1080 pauFields[iField].Date.Minute, 1081 pauFields[iField].Date.Second ); 1069 1082 1070 1083 return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
