Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
207
Issues
207
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
2c0f23cd
Commit
2c0f23cd
authored
Jan 03, 2019
by
Cédric Traizet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: remove function IsOFTInteger64(field) and replace it with a direct test on the field type
parent
1adbb63a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
9 additions
and
27 deletions
+9
-27
Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h
Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h
+0
-6
Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx
Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx
+0
-12
Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx
...tions/AppClassification/app/otbComputeConfusionMatrix.cxx
+1
-1
Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx
...tions/AppClassification/app/otbPolygonClassStatistics.cxx
+1
-1
Modules/Applications/AppClassification/app/otbSampleAugmentation.cxx
...lications/AppClassification/app/otbSampleAugmentation.cxx
+1
-1
Modules/Applications/AppClassification/app/otbSampleExtraction.cxx
...pplications/AppClassification/app/otbSampleExtraction.cxx
+1
-1
Modules/Applications/AppClassification/app/otbSampleSelection.cxx
...Applications/AppClassification/app/otbSampleSelection.cxx
+1
-1
Modules/Applications/AppClassification/app/otbVectorClassifier.cxx
...pplications/AppClassification/app/otbVectorClassifier.cxx
+1
-1
Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx
...ications/AppClassification/include/otbTrainVectorBase.hxx
+2
-2
Modules/Learning/Sampling/src/otbSampleAugmentationFilter.cxx
...les/Learning/Sampling/src/otbSampleAugmentationFilter.cxx
+1
-1
No files found.
Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h
View file @
2c0f23cd
...
...
@@ -48,12 +48,6 @@ namespace ogr
namespace
version_proxy
{
/**
* With Gdal >= 2.0, this function will test equality between type and
* OFTInteger64 enum. Otherwise, it returns false.
*/
OTBGdalAdapters_EXPORT
bool
IsOFTInteger64
(
OGRFieldType
type
);
/**
* This namespace holds proxy functions hiding interface changes in gdal 2.0
*
...
...
Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx
View file @
2c0f23cd
...
...
@@ -49,18 +49,6 @@ namespace ogr
namespace
version_proxy
{
/*-------------------------[GDAL v2 API change]-------------------------------*/
OTBGdalAdapters_EXPORT
bool
IsOFTInteger64
(
OGRFieldType
type
)
{
#if GDAL_VERSION_NUM<2000000
(
void
)
type
;
return
false
;
#else
return
type
==
OFTInteger64
;
#endif
}
GDALDatasetType
*
Open
(
const
char
*
filename
,
bool
readOnly
,
std
::
vector
<
std
::
string
>
const
&
options
)
{
#if GDAL_VERSION_NUM<2000000
...
...
Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx
View file @
2c0f23cd
...
...
@@ -204,7 +204,7 @@ private:
OGRFieldType
fieldType
=
feature
.
ogr
().
GetFieldDefnRef
(
iField
)
->
GetType
();
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
)
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
fieldType
==
OFTInteger64
)
{
std
::
string
tmpKey
=
"ref.vector.field."
+
key
.
substr
(
0
,
end
-
key
.
begin
());
AddChoice
(
tmpKey
,
item
);
...
...
Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx
View file @
2c0f23cd
...
...
@@ -148,7 +148,7 @@ private:
OGRFieldType
fieldType
=
feature
.
ogr
().
GetFieldDefnRef
(
iField
)
->
GetType
();
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
)
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
fieldType
==
OFTInteger64
)
{
std
::
string
tmpKey
=
"field."
+
key
.
substr
(
0
,
end
-
key
.
begin
());
AddChoice
(
tmpKey
,
item
);
...
...
Modules/Applications/AppClassification/app/otbSampleAugmentation.cxx
View file @
2c0f23cd
...
...
@@ -168,7 +168,7 @@ private:
OGRFieldType
fieldType
=
feature
.
ogr
().
GetFieldDefnRef
(
iField
)
->
GetType
();
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
)
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
fieldType
==
OFTInteger64
)
{
std
::
string
tmpKey
=
"field."
+
key
.
substr
(
0
,
end
-
key
.
begin
());
AddChoice
(
tmpKey
,
item
);
...
...
Modules/Applications/AppClassification/app/otbSampleExtraction.cxx
View file @
2c0f23cd
...
...
@@ -140,7 +140,7 @@ private:
OGRFieldType
fieldType
=
feature
.
ogr
().
GetFieldDefnRef
(
iField
)
->
GetType
();
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
)
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
fieldType
==
OFTInteger64
)
{
std
::
string
tmpKey
=
"field."
+
key
.
substr
(
0
,
end
-
key
.
begin
());
AddChoice
(
tmpKey
,
item
);
...
...
Modules/Applications/AppClassification/app/otbSampleSelection.cxx
View file @
2c0f23cd
...
...
@@ -248,7 +248,7 @@ private:
OGRFieldType
fieldType
=
feature
.
ogr
().
GetFieldDefnRef
(
iField
)
->
GetType
();
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
)
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
fieldType
==
OFTInteger64
)
{
std
::
string
tmpKey
=
"field."
+
key
.
substr
(
0
,
end
-
key
.
begin
());
AddChoice
(
tmpKey
,
item
);
...
...
Modules/Applications/AppClassification/app/otbVectorClassifier.cxx
View file @
2c0f23cd
...
...
@@ -183,7 +183,7 @@ private:
std
::
transform
(
key
.
begin
(),
key
.
end
(),
key
.
begin
(),
tolower
);
OGRFieldType
fieldType
=
layerDefn
.
GetFieldDefn
(
iField
)
->
GetType
();
if
(
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
||
fieldType
==
OFTReal
)
if
(
fieldType
==
OFTInteger
||
fieldType
==
OFTInteger64
||
fieldType
==
OFTReal
)
{
std
::
string
tmpKey
=
"feat."
+
key
;
AddChoice
(
tmpKey
,
item
);
...
...
Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx
View file @
2c0f23cd
...
...
@@ -131,12 +131,12 @@ void TrainVectorBase::DoUpdateParameters()
OGRFieldType
fieldType
=
feature
.
ogr
().
GetFieldDefnRef
(
iField
)
->
GetType
();
if
(
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
||
fieldType
==
OFTReal
)
if
(
fieldType
==
OFTInteger
||
fieldType
==
OFTInteger64
||
fieldType
==
OFTReal
)
{
std
::
string
tmpKey
=
"feat."
+
key
.
substr
(
0
,
static_cast
<
unsigned
long
>
(
end
-
key
.
begin
()
)
);
AddChoice
(
tmpKey
,
item
);
}
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
)
if
(
fieldType
==
OFTString
||
fieldType
==
OFTInteger
||
fieldType
==
OFTInteger64
)
{
std
::
string
tmpKey
=
"cfield."
+
key
.
substr
(
0
,
static_cast
<
unsigned
long
>
(
end
-
key
.
begin
()
)
);
AddChoice
(
tmpKey
,
item
);
...
...
Modules/Learning/Sampling/src/otbSampleAugmentationFilter.cxx
View file @
2c0f23cd
...
...
@@ -247,7 +247,7 @@ SampleAugmentationFilter
{
OGRFieldType
fieldType
=
feature
.
ogr
().
GetFieldDefnRef
(
idx
)
->
GetType
();
return
(
fieldType
==
OFTInteger
||
ogr
::
version_proxy
::
IsOFTInteger64
(
fieldType
)
||
fieldType
==
OFTInteger64
||
fieldType
==
OFTReal
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment