From 66723a4bb75c5aa1afd309420bc563e1a48b074b Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Wed, 2 Oct 2013 11:56:04 +0200 Subject: [PATCH 1/3] introduce OGRLayer::FindFieldIndex() / OGR_L_FindFieldIndex() to lookup potentially laundered field names --- gdal/apps/ogr2ogr.cpp | 4 +- gdal/ogr/ogr_api.h | 1 + gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp | 20 ++++++++++ gdal/ogr/ogrsf_frmts/nas/ogrnasdatasource.cpp | 2 + gdal/ogr/ogrsf_frmts/oci/ogr_oci.h | 2 + .../ogrsf_frmts/oci/ogrociwritablelayer.cpp | 20 ++++++++++ gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox | 38 +++++++++++++++++++ gdal/ogr/ogrsf_frmts/ogrsf_frmts.h | 1 + gdal/swig/include/ogr.i | 4 ++ 9 files changed, 90 insertions(+), 2 deletions(-) diff --git a/gdal/apps/ogr2ogr.cpp b/gdal/apps/ogr2ogr.cpp index a06bb7aaacd1..7bcb8f00fbf2 100644 --- a/gdal/apps/ogr2ogr.cpp +++ b/gdal/apps/ogr2ogr.cpp @@ -1409,7 +1409,7 @@ int main( int nArgc, char ** papszArgv ) } if (pszFieldMap && bAddMissingFields) -{ + { Usage("if -addfields is specified, -fieldmap cannot be used."); } @@ -3019,7 +3019,7 @@ static TargetLayerInfo* SetupTargetLayer( OGRDataSource *poSrcDS, for( iField = 0; iField < nSrcFieldCount; iField++ ) { OGRFieldDefn* poSrcFieldDefn = poSrcFDefn->GetFieldDefn(iField); - int iDstField = poDstFDefn->GetFieldIndex(poSrcFieldDefn->GetNameRef()); + int iDstField = poDstLayer->FindFieldIndex(poSrcFieldDefn->GetNameRef()); if (iDstField >= 0) panMap[iField] = iDstField; else diff --git a/gdal/ogr/ogr_api.h b/gdal/ogr/ogr_api.h index 824cbb61ecaf..0d896039367d 100644 --- a/gdal/ogr/ogr_api.h +++ b/gdal/ogr/ogr_api.h @@ -412,6 +412,7 @@ OGRErr CPL_DLL OGR_L_CreateFeature( OGRLayerH, OGRFeatureH ); OGRErr CPL_DLL OGR_L_DeleteFeature( OGRLayerH, long ); OGRFeatureDefnH CPL_DLL OGR_L_GetLayerDefn( OGRLayerH ); OGRSpatialReferenceH CPL_DLL OGR_L_GetSpatialRef( OGRLayerH ); +int CPL_DLL OGR_L_FindFieldIndex( OGRLayerH, const char * ); int CPL_DLL OGR_L_GetFeatureCount( OGRLayerH, int ); OGRErr CPL_DLL OGR_L_GetExtent( OGRLayerH, OGREnvelope *, int ); OGRErr CPL_DLL OGR_L_GetExtentEx( OGRLayerH, int iGeomField, diff --git a/gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp b/gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp index 69bea7ebef6d..d562043cbacc 100644 --- a/gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp +++ b/gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp @@ -842,6 +842,26 @@ OGRFeatureDefnH OGR_L_GetLayerDefn( OGRLayerH hLayer ) return (OGRFeatureDefnH) ((OGRLayer *)hLayer)->GetLayerDefn(); } +/************************************************************************/ +/* OGR_L_FindFieldIndex() */ +/************************************************************************/ + +int OGR_L_FindFieldIndex( OGRLayerH hLayer, const char *pszFieldName ) + +{ + VALIDATE_POINTER1( hLayer, "OGR_L_FindFieldIndex", NULL ); + + return ((OGRLayer *)hLayer)->FindFieldIndex( pszFieldName ); +} + +/************************************************************************/ +/* FindFieldIndex() */ +/************************************************************************/ + +int OGRLayer::FindFieldIndex( const char *pszFieldName ) +{ + return GetLayerDefn()->GetFieldIndex( pszFieldName ); +} /************************************************************************/ /* GetSpatialRef() */ diff --git a/gdal/ogr/ogrsf_frmts/nas/ogrnasdatasource.cpp b/gdal/ogr/ogrsf_frmts/nas/ogrnasdatasource.cpp index 88c41720171d..5eec362b9984 100644 --- a/gdal/ogr/ogrsf_frmts/nas/ogrnasdatasource.cpp +++ b/gdal/ogr/ogrsf_frmts/nas/ogrnasdatasource.cpp @@ -138,6 +138,8 @@ int OGRNASDataSource::Open( const char * pszNewName, int bTestOpen ) strstr(szPtr,"NAS-Operationen_optional.xsd") == NULL && strstr(szPtr,"AAA-Fachschema.xsd") == NULL ) ) { + CPLDebug( "NAS", + "Skipping. No chevrons of NAS found [%s]\n", szPtr ); VSIFClose( fp ); return FALSE; } diff --git a/gdal/ogr/ogrsf_frmts/oci/ogr_oci.h b/gdal/ogr/ogrsf_frmts/oci/ogr_oci.h index 8c6335790925..2a2037ee072c 100644 --- a/gdal/ogr/ogrsf_frmts/oci/ogr_oci.h +++ b/gdal/ogr/ogrsf_frmts/oci/ogr_oci.h @@ -252,6 +252,7 @@ class OGROCILayer : public OGRLayer public: OGROCILayer(); virtual ~OGROCILayer(); + virtual int FindFieldIndex( const char *pszFieldName ) { return OGRLayer::FindFieldIndex( pszFieldName ); } virtual void ResetReading(); virtual OGRFeature *GetNextRawFeature(); @@ -312,6 +313,7 @@ class OGROCIWritableLayer : public OGROCILayer virtual OGRSpatialReference *GetSpatialRef() { return poSRS; } virtual OGRErr CreateField( OGRFieldDefn *poField, int bApproxOK = TRUE ); + virtual int FindFieldIndex( const char *pszFieldName ); // following methods are not base class overrides void SetOptions( char ** ); diff --git a/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp b/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp index 9e8bd25af2b5..10974dedc3fc 100644 --- a/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp +++ b/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp @@ -492,3 +492,23 @@ OGRErr OGROCIWritableLayer::TranslateToSDOGeometry( OGRGeometry * poGeometry, return OGRERR_FAILURE; } +int OGROCIWritableLayer::FindFieldIndex( const char *pszFieldName ) +{ + int iField = GetLayerDefn()->GetFieldIndex( pszFieldName ); + + // try laundered version + if( iField < 0 ) + { + OGROCISession *poSession = poDS->GetSession(); + char *pszSafeName = CPLStrdup( pszFieldName ); + + poSession->CleanName( pszSafeName ); + + iField = GetLayerDefn()->GetFieldIndex( pszSafeName ); + + CPLFree( pszSafeName ); + } + + return iField; +} + diff --git a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox index 8b65a2ac8f11..cf4965198373 100644 --- a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox +++ b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox @@ -2068,6 +2068,44 @@ by the OGRSFDriverManager. */ +/** + + \fn int OGR_L_FindFieldIndex( OGRLayerH hLayer, const char * ); + + \brief Find the index of field in a layer. + + The returned number is the index of the field in the layers, or -1 if the + field doesn't exist. + + If the field doesn't exists in the given form the driver might apply + some changes to make it match, like those it might do if the layer was + created (eg. like LAUNDER in the OCI driver). + + This method is the same as the C++ method OGRLayer::FindFieldIndex(). + + @return field index, or -1 if the field doesn't exist + +*/ + +/** + + \fn int OGRLayer::FindFieldIndex( const char * ); + + \brief Find the index of field in the layer. + + The returned number is the index of the field in the layers, or -1 if the + field doesn't exist. + + If the field doesn't exists in the given form the driver might apply + some changes to make it match, like those it might do if the layer was + created (eg. like LAUNDER in the OCI driver). + + This method is the same as the C function OGR_L_FindFieldIndex(). + + @return field index, or -1 if the field doesn't exist + +*/ + /** \fn OGRSpatialReference *OGRLayer::GetSpatialRef(); diff --git a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h index 42493b3a86fb..828fe21fae8c 100644 --- a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h +++ b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h @@ -98,6 +98,7 @@ class CPL_DLL OGRLayer virtual const char *GetName(); virtual OGRwkbGeometryType GetGeomType(); virtual OGRFeatureDefn *GetLayerDefn() = 0; + virtual int FindFieldIndex( const char *pszFieldName ); virtual OGRSpatialReference *GetSpatialRef(); diff --git a/gdal/swig/include/ogr.i b/gdal/swig/include/ogr.i index b6d1b337d6ee..915124db08f3 100644 --- a/gdal/swig/include/ogr.i +++ b/gdal/swig/include/ogr.i @@ -746,6 +746,10 @@ public: OGRErr RollbackTransaction() { return OGR_L_RollbackTransaction(self); } + + int FindFieldIndex( const char *pszFieldName ) { + return OGR_L_FindFieldIndex(self, pszFieldName); + } %newobject GetSpatialRef; OSRSpatialReferenceShadow *GetSpatialRef() { From a12311e56cf09d9deb15a18e93704377d1627c12 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Wed, 2 Oct 2013 18:36:28 +0200 Subject: [PATCH 2/3] make relaxed lookup optional and add a switch -relaxedFieldNameMatch to ogr2ogr to allow it --- gdal/apps/ogr2ogr.cpp | 23 ++++++++++++++----- gdal/ogr/ogr_api.h | 2 +- gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp | 6 ++--- gdal/ogr/ogrsf_frmts/oci/ogr_oci.h | 4 ++-- .../ogrsf_frmts/oci/ogrociwritablelayer.cpp | 6 ++--- gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox | 16 ++++++------- gdal/ogr/ogrsf_frmts/ogrsf_frmts.h | 2 +- gdal/swig/include/ogr.i | 4 ++-- 8 files changed, 37 insertions(+), 26 deletions(-) diff --git a/gdal/apps/ogr2ogr.cpp b/gdal/apps/ogr2ogr.cpp index 7bcb8f00fbf2..a8fe474b2664 100644 --- a/gdal/apps/ogr2ogr.cpp +++ b/gdal/apps/ogr2ogr.cpp @@ -91,7 +91,8 @@ static TargetLayerInfo* SetupTargetLayer( OGRDataSource *poSrcDS, int bExplodeCollections, const char* pszZField, char **papszFieldMap, - const char* pszWHERE ); + const char* pszWHERE, + int bExactFieldNameMatch ); static void FreeTargetLayerInfo(TargetLayerInfo* psInfo); @@ -866,6 +867,7 @@ int main( int nArgc, char ** papszArgv ) const char *pszSourceSRSDef = NULL; OGRSpatialReference *poOutputSRS = NULL; int bNullifyOutputSRS = FALSE; + int bExactFieldNameMatch = TRUE; OGRSpatialReference *poSourceSRS = NULL; char *pszNewLayerName = NULL; const char *pszWHERE = NULL; @@ -992,6 +994,10 @@ int main( int nArgc, char ** papszArgv ) { bUpdate = TRUE; } + else if( EQUAL(papszArgv[iArg],"-relaxedFieldNameMatch") ) + { + bExactFieldNameMatch = FALSE; + } else if( EQUAL(papszArgv[iArg],"-fid") ) { CHECK_HAS_ENOUGH_ADDITIONAL_ARGS(1); @@ -1770,7 +1776,8 @@ int main( int nArgc, char ** papszArgv ) bExplodeCollections, pszZField, papszFieldMap, - pszWHERE ); + pszWHERE, + bExactFieldNameMatch ); poPassedLayer->ResetReading(); @@ -1925,7 +1932,8 @@ int main( int nArgc, char ** papszArgv ) bExplodeCollections, pszZField, papszFieldMap, - pszWHERE ); + pszWHERE, + bExactFieldNameMatch ); if( psInfo == NULL && !bSkipFailures ) exit(1); @@ -2199,7 +2207,8 @@ int main( int nArgc, char ** papszArgv ) bExplodeCollections, pszZField, papszFieldMap, - pszWHERE ); + pszWHERE, + bExactFieldNameMatch ); poPassedLayer->ResetReading(); @@ -2319,6 +2328,7 @@ static void Usage(const char* pszAdditionalMsg, int bShort) " [-wrapdateline][-datelineoffset val]\n" " [[-simplify tolerance] | [-segmentize max_dist]]\n" " [-addfields]\n" + " [-relaxedFieldNameMatch]\n" " [-fieldTypeToString All|(type1[,type2]*)] [-unsetFieldWidth]\n" " [-fieldmap identity | index1[,index2]*]\n" " [-splitlistfields] [-maxsubfields val]\n" @@ -2483,7 +2493,8 @@ static TargetLayerInfo* SetupTargetLayer( OGRDataSource *poSrcDS, int bExplodeCollections, const char* pszZField, char **papszFieldMap, - const char* pszWHERE ) + const char* pszWHERE, + int bExactFieldNameMatch ) { OGRLayer *poDstLayer; OGRFeatureDefn *poSrcFDefn; @@ -3019,7 +3030,7 @@ static TargetLayerInfo* SetupTargetLayer( OGRDataSource *poSrcDS, for( iField = 0; iField < nSrcFieldCount; iField++ ) { OGRFieldDefn* poSrcFieldDefn = poSrcFDefn->GetFieldDefn(iField); - int iDstField = poDstLayer->FindFieldIndex(poSrcFieldDefn->GetNameRef()); + int iDstField = poDstLayer->FindFieldIndex(poSrcFieldDefn->GetNameRef(), bExactFieldNameMatch); if (iDstField >= 0) panMap[iField] = iDstField; else diff --git a/gdal/ogr/ogr_api.h b/gdal/ogr/ogr_api.h index 0d896039367d..97b77cfbbbd2 100644 --- a/gdal/ogr/ogr_api.h +++ b/gdal/ogr/ogr_api.h @@ -412,7 +412,7 @@ OGRErr CPL_DLL OGR_L_CreateFeature( OGRLayerH, OGRFeatureH ); OGRErr CPL_DLL OGR_L_DeleteFeature( OGRLayerH, long ); OGRFeatureDefnH CPL_DLL OGR_L_GetLayerDefn( OGRLayerH ); OGRSpatialReferenceH CPL_DLL OGR_L_GetSpatialRef( OGRLayerH ); -int CPL_DLL OGR_L_FindFieldIndex( OGRLayerH, const char * ); +int CPL_DLL OGR_L_FindFieldIndex( OGRLayerH, const char *, int bExactMatch ); int CPL_DLL OGR_L_GetFeatureCount( OGRLayerH, int ); OGRErr CPL_DLL OGR_L_GetExtent( OGRLayerH, OGREnvelope *, int ); OGRErr CPL_DLL OGR_L_GetExtentEx( OGRLayerH, int iGeomField, diff --git a/gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp b/gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp index d562043cbacc..fe93e82d9e2d 100644 --- a/gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp +++ b/gdal/ogr/ogrsf_frmts/generic/ogrlayer.cpp @@ -846,19 +846,19 @@ OGRFeatureDefnH OGR_L_GetLayerDefn( OGRLayerH hLayer ) /* OGR_L_FindFieldIndex() */ /************************************************************************/ -int OGR_L_FindFieldIndex( OGRLayerH hLayer, const char *pszFieldName ) +int OGR_L_FindFieldIndex( OGRLayerH hLayer, const char *pszFieldName, int bExactMatch ) { VALIDATE_POINTER1( hLayer, "OGR_L_FindFieldIndex", NULL ); - return ((OGRLayer *)hLayer)->FindFieldIndex( pszFieldName ); + return ((OGRLayer *)hLayer)->FindFieldIndex( pszFieldName, bExactMatch ); } /************************************************************************/ /* FindFieldIndex() */ /************************************************************************/ -int OGRLayer::FindFieldIndex( const char *pszFieldName ) +int OGRLayer::FindFieldIndex( const char *pszFieldName, int bExactMatch ) { return GetLayerDefn()->GetFieldIndex( pszFieldName ); } diff --git a/gdal/ogr/ogrsf_frmts/oci/ogr_oci.h b/gdal/ogr/ogrsf_frmts/oci/ogr_oci.h index 2a2037ee072c..6475b9f4d167 100644 --- a/gdal/ogr/ogrsf_frmts/oci/ogr_oci.h +++ b/gdal/ogr/ogrsf_frmts/oci/ogr_oci.h @@ -252,7 +252,7 @@ class OGROCILayer : public OGRLayer public: OGROCILayer(); virtual ~OGROCILayer(); - virtual int FindFieldIndex( const char *pszFieldName ) { return OGRLayer::FindFieldIndex( pszFieldName ); } + virtual int FindFieldIndex( const char *pszFieldName, int bExactMatch ) { return OGRLayer::FindFieldIndex( pszFieldName, bExactMatch ); } virtual void ResetReading(); virtual OGRFeature *GetNextRawFeature(); @@ -313,7 +313,7 @@ class OGROCIWritableLayer : public OGROCILayer virtual OGRSpatialReference *GetSpatialRef() { return poSRS; } virtual OGRErr CreateField( OGRFieldDefn *poField, int bApproxOK = TRUE ); - virtual int FindFieldIndex( const char *pszFieldName ); + virtual int FindFieldIndex( const char *pszFieldName, int bExactMatch ); // following methods are not base class overrides void SetOptions( char ** ); diff --git a/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp b/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp index 10974dedc3fc..0c8a826ada02 100644 --- a/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp +++ b/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp @@ -492,13 +492,13 @@ OGRErr OGROCIWritableLayer::TranslateToSDOGeometry( OGRGeometry * poGeometry, return OGRERR_FAILURE; } -int OGROCIWritableLayer::FindFieldIndex( const char *pszFieldName ) +int OGROCIWritableLayer::FindFieldIndex( const char *pszFieldName, int bExactMatch ) { int iField = GetLayerDefn()->GetFieldIndex( pszFieldName ); - // try laundered version - if( iField < 0 ) + if( !bExactMatch && iField < 0 ) { + // try laundered version OGROCISession *poSession = poDS->GetSession(); char *pszSafeName = CPLStrdup( pszFieldName ); diff --git a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox index cf4965198373..48013833b69b 100644 --- a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox +++ b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox @@ -2070,16 +2070,16 @@ by the OGRSFDriverManager. /** - \fn int OGR_L_FindFieldIndex( OGRLayerH hLayer, const char * ); + \fn int OGR_L_FindFieldIndex( OGRLayerH hLayer, const char *, int bExactMatch ); \brief Find the index of field in a layer. The returned number is the index of the field in the layers, or -1 if the field doesn't exist. - If the field doesn't exists in the given form the driver might apply - some changes to make it match, like those it might do if the layer was - created (eg. like LAUNDER in the OCI driver). + If bExact match is set and the field doesn't exists in the given form the + driver might apply some changes to make it match, like those it might do if + the layer was created (eg. like LAUNDER in the OCI driver). This method is the same as the C++ method OGRLayer::FindFieldIndex(). @@ -2089,16 +2089,16 @@ by the OGRSFDriverManager. /** - \fn int OGRLayer::FindFieldIndex( const char * ); + \fn int OGRLayer::FindFieldIndex( const char *, int bExactMatch ); \brief Find the index of field in the layer. The returned number is the index of the field in the layers, or -1 if the field doesn't exist. - If the field doesn't exists in the given form the driver might apply - some changes to make it match, like those it might do if the layer was - created (eg. like LAUNDER in the OCI driver). + If bExact match is set and the field doesn't exists in the given form the + driver might apply some changes to make it match, like those it might do if + the layer was created (eg. like LAUNDER in the OCI driver). This method is the same as the C function OGR_L_FindFieldIndex(). diff --git a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h index 828fe21fae8c..8e8f28bdc3f6 100644 --- a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h +++ b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h @@ -98,7 +98,7 @@ class CPL_DLL OGRLayer virtual const char *GetName(); virtual OGRwkbGeometryType GetGeomType(); virtual OGRFeatureDefn *GetLayerDefn() = 0; - virtual int FindFieldIndex( const char *pszFieldName ); + virtual int FindFieldIndex( const char *pszFieldName, int bExactMatch ); virtual OGRSpatialReference *GetSpatialRef(); diff --git a/gdal/swig/include/ogr.i b/gdal/swig/include/ogr.i index 915124db08f3..789f8315b625 100644 --- a/gdal/swig/include/ogr.i +++ b/gdal/swig/include/ogr.i @@ -747,8 +747,8 @@ public: return OGR_L_RollbackTransaction(self); } - int FindFieldIndex( const char *pszFieldName ) { - return OGR_L_FindFieldIndex(self, pszFieldName); + int FindFieldIndex( const char *pszFieldName, int bExactMatch ) { + return OGR_L_FindFieldIndex(self, pszFieldName, bExactMatch ); } %newobject GetSpatialRef; From fdc838c6384a7f26c6388c9261c7120ad2035bd2 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Sun, 6 Oct 2013 13:26:25 +0200 Subject: [PATCH 3/3] fix documentation of bExactMatch --- gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox index 48013833b69b..4f021f6373ed 100644 --- a/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox +++ b/gdal/ogr/ogrsf_frmts/ogrsf_frmts.dox @@ -2077,9 +2077,9 @@ by the OGRSFDriverManager. The returned number is the index of the field in the layers, or -1 if the field doesn't exist. - If bExact match is set and the field doesn't exists in the given form the - driver might apply some changes to make it match, like those it might do if - the layer was created (eg. like LAUNDER in the OCI driver). + If bExactMatch is set to FALSE and the field doesn't exists in the given form + the driver might apply some changes to make it match, like those it might do + if the layer was created (eg. like LAUNDER in the OCI driver). This method is the same as the C++ method OGRLayer::FindFieldIndex(). @@ -2096,9 +2096,9 @@ by the OGRSFDriverManager. The returned number is the index of the field in the layers, or -1 if the field doesn't exist. - If bExact match is set and the field doesn't exists in the given form the - driver might apply some changes to make it match, like those it might do if - the layer was created (eg. like LAUNDER in the OCI driver). + If bExactMatch is set to FALSE and the field doesn't exists in the given form + the driver might apply some changes to make it match, like those it might do + if the layer was created (eg. like LAUNDER in the OCI driver). This method is the same as the C function OGR_L_FindFieldIndex().