Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
b8f5ab2b
Commit
b8f5ab2b
authored
May 29, 2019
by
Cédric Traizet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
COMP: added retro compatibility for gdal 2
parent
363a9fb3
Pipeline
#1640
passed with stage
in 10 minutes and 39 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
4 deletions
+23
-4
Modules/Adapters/GdalAdapters/include/otbSpatialReference.h
Modules/Adapters/GdalAdapters/include/otbSpatialReference.h
+6
-1
Modules/Adapters/GdalAdapters/src/otbSpatialReference.cxx
Modules/Adapters/GdalAdapters/src/otbSpatialReference.cxx
+2
-2
Modules/Core/Transform/include/otbGenericMapProjection.hxx
Modules/Core/Transform/include/otbGenericMapProjection.hxx
+2
-0
Modules/Learning/Sampling/include/otbImageSampleExtractorFilter.hxx
...arning/Sampling/include/otbImageSampleExtractorFilter.hxx
+9
-1
Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx
.../Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx
+4
-0
No files found.
Modules/Adapters/GdalAdapters/include/otbSpatialReference.h
View file @
b8f5ab2b
...
@@ -151,8 +151,13 @@ public:
...
@@ -151,8 +151,13 @@ public:
*/
*/
unsigned
int
ToEPSG
()
const
;
unsigned
int
ToEPSG
()
const
;
#if GDAL_VERSION_NUM >= 3000000
/** Set the Axis mapping strategy
* proxy to the eponym ogr spatial reference method
* \param strategy Axis mapping stategy
*/
void
SetAxisMappingStrategy
(
OSRAxisMappingStrategy
strategy
);
void
SetAxisMappingStrategy
(
OSRAxisMappingStrategy
strategy
);
#endif
/**
/**
* Find which UTM zone a given (lat,lon) point falls in.
* Find which UTM zone a given (lat,lon) point falls in.
...
...
Modules/Adapters/GdalAdapters/src/otbSpatialReference.cxx
View file @
b8f5ab2b
...
@@ -292,11 +292,11 @@ void SpatialReference::UTMFromGeoPoint(double lon, double lat, unsigned int & zo
...
@@ -292,11 +292,11 @@ void SpatialReference::UTMFromGeoPoint(double lon, double lat, unsigned int & zo
assert
(
zone
<=
60
);
assert
(
zone
<=
60
);
}
}
#if GDAL_VERSION_NUM >= 3000000
void
SpatialReference
::
SetAxisMappingStrategy
(
OSRAxisMappingStrategy
strategy
)
void
SpatialReference
::
SetAxisMappingStrategy
(
OSRAxisMappingStrategy
strategy
)
{
{
m_SR
.
get
()
->
SetAxisMappingStrategy
(
strategy
);
m_SR
.
get
()
->
SetAxisMappingStrategy
(
strategy
);
};
};
#endif
}
}
Modules/Core/Transform/include/otbGenericMapProjection.hxx
View file @
b8f5ab2b
...
@@ -70,8 +70,10 @@ GenericMapProjection<TDirectionOfMapping, TScalarType, NInputDimensions, NOutput
...
@@ -70,8 +70,10 @@ GenericMapProjection<TDirectionOfMapping, TScalarType, NInputDimensions, NOutput
SpatialReference
wgs84
=
SpatialReference
::
FromWGS84
();
SpatialReference
wgs84
=
SpatialReference
::
FromWGS84
();
SpatialReference
wktSpatialReference
=
SpatialReference
::
FromDescription
(
projectionRefWkt
);
SpatialReference
wktSpatialReference
=
SpatialReference
::
FromDescription
(
projectionRefWkt
);
#if GDAL_VERSION_NUM >= 3000000
wgs84
.
SetAxisMappingStrategy
(
OAMS_TRADITIONAL_GIS_ORDER
);
wgs84
.
SetAxisMappingStrategy
(
OAMS_TRADITIONAL_GIS_ORDER
);
wktSpatialReference
.
SetAxisMappingStrategy
(
OAMS_TRADITIONAL_GIS_ORDER
);
wktSpatialReference
.
SetAxisMappingStrategy
(
OAMS_TRADITIONAL_GIS_ORDER
);
#endif
if
(
DirectionOfMapping
==
TransformDirection
::
INVERSE
)
if
(
DirectionOfMapping
==
TransformDirection
::
INVERSE
)
{
{
...
...
Modules/Learning/Sampling/include/otbImageSampleExtractorFilter.hxx
View file @
b8f5ab2b
...
@@ -128,8 +128,16 @@ PersistentImageSampleExtractorFilter<TInputImage>
...
@@ -128,8 +128,16 @@ PersistentImageSampleExtractorFilter<TInputImage>
if
(
projectionInformationAvailable
)
if
(
projectionInformationAvailable
)
{
{
OGRSpatialReference
imgSRS
;
OGRSpatialReference
imgSRS
;
#if GDAL_VERSION_NUM >= 3000000 // importFromWkt is const-correct in GDAL 3
const
char
*
projWktCstr
=
projectionRefWkt
.
c_str
();
const
char
*
projWktCstr
=
projectionRefWkt
.
c_str
();
OGRErr
err
=
imgSRS
.
importFromWkt
(
projWktCstr
);
OGRErr
err
=
imgSRS
.
importFromWkt
(
&
projWktCstr
);
#else
const
char
*
projWktCstr
=
projectionRefWkt
.
c_str
();
char
**
projWktPointer
=
const_cast
<
char
**>
(
&
projWktCstr
);
OGRErr
err
=
imgSRS
.
importFromWkt
(
projWktPointer
);
#endif
if
(
err
==
OGRERR_NONE
)
if
(
err
==
OGRERR_NONE
)
{
{
// get input layer
// get input layer
...
...
Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx
View file @
b8f5ab2b
...
@@ -335,7 +335,11 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::GenerateOutpu
...
@@ -335,7 +335,11 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::GenerateOutpu
if
(
!
m_ProjectionRef
.
empty
())
if
(
!
m_ProjectionRef
.
empty
())
{
{
OGRSpatialReference
oSRS
;
OGRSpatialReference
oSRS
;
#if GDAL_VERSION_NUM >= 3000000 // importFromWkt is const-correct in GDAL 3
const
char
*
wkt
=
m_ProjectionRef
.
c_str
();
const
char
*
wkt
=
m_ProjectionRef
.
c_str
();
#else
char
*
wkt
=
const_cast
<
char
*>
(
m_ProjectionRef
.
c_str
());
#endif
oSRS
.
importFromWkt
(
&
wkt
);
oSRS
.
importFromWkt
(
&
wkt
);
m_IsGeographic
=
oSRS
.
IsGeographic
();
// TODO check if this test is valid for all projection systems
m_IsGeographic
=
oSRS
.
IsGeographic
();
// TODO check if this test is valid for all projection systems
}
}
...
...
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