Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
979f89c2
Commit
979f89c2
authored
12 years ago
by
Luc Hermitte
Browse files
Options
Downloads
Patches
Plain Diff
BUG: OTB-134/OGR -- infinite recursion
parent
db3ef066
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
+11
-17
11 additions, 17 deletions
...UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
with
11 additions
and
17 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
+
11
−
17
View file @
979f89c2
...
...
@@ -425,6 +425,7 @@ void otb::ogr::DataSource::DeleteLayer(size_t i)
bool
otb
::
ogr
::
DataSource
::
IsLayerModifiable
(
size_t
i
)
const
{
assert
(
m_DataSource
&&
"Datasource not initialized"
);
switch
(
m_OpenMode
)
{
case
Modes
::
Read
:
...
...
@@ -438,27 +439,20 @@ bool otb::ogr::DataSource::IsLayerModifiable(size_t i) const
bool
otb
::
ogr
::
DataSource
::
IsLayerModifiable
(
std
::
string
const
&
layername
)
const
{
switch
(
m_OpenMode
)
{
case
Modes
::
Read
:
return
false
;
case
Modes
::
Update_LayerCreateOnly
:
if
(
GetLayer
(
layername
))
return
int
(
GetLayerID
(
layername
))
>=
m_FirstModifiableLayerID
;
else
return
false
;
default:
return
true
;
}
assert
(
m_DataSource
&&
"Datasource not initialized"
);
const
size_t
id
=
GetLayerID
(
layername
);
return
IsLayerModifiable
(
id
);
}
size_t
otb
::
ogr
::
DataSource
::
GetLayerID
(
std
::
string
const
&
name
)
const
{
for
(
int
i
=
0
;
i
<
GetLayersCount
();
i
++
)
assert
(
m_DataSource
&&
"Datasource not initialized"
);
for
(
int
i
=
0
,
N
=
GetLayersCount
();
i
<
N
;
i
++
)
{
if
(
GetLayer
(
i
).
GetName
()
==
name
)
OGRLayer
*
raw_layer
=
GetLayerUnchecked
(
i
);
// wrapping to give access to GetName() that doesn't exist with all version of gdal/ogr
Layer
layer
(
raw_layer
,
false
);
if
(
layer
.
GetName
()
==
name
)
{
return
i
;
}
...
...
@@ -472,6 +466,7 @@ size_t otb::ogr::DataSource::GetLayerID(std::string const& name) const
otb
::
ogr
::
Layer
otb
::
ogr
::
DataSource
::
GetLayerChecked
(
size_t
i
)
{
assert
(
m_DataSource
&&
"Datasource not initialized"
);
const
int
nb_layers
=
GetLayersCount
();
if
(
int
(
i
)
>=
nb_layers
)
{
...
...
@@ -538,7 +533,6 @@ otb::ogr::Layer otb::ogr::DataSource::ExecuteSQL(
// Cannot use the deleter made for result sets obtained from
// OGRDataSource::ExecuteSQL because it checks for non-nullity....
// *sigh*
return
otb
::
ogr
::
Layer
(
0
,
modifiable
);
#endif
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment