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
2ff0eee1
Commit
2ff0eee1
authored
Dec 14, 2009
by
Emmanuel Christophe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: fix TileMapIO problem
parent
bcce88e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
167 deletions
+7
-167
Utilities/otbossim/include/ossim/imaging/ossimTileMapTileSource.h
...s/otbossim/include/ossim/imaging/ossimTileMapTileSource.h
+0
-28
Utilities/otbossim/include/ossim/projection/ossimTileMapModel.h
...ies/otbossim/include/ossim/projection/ossimTileMapModel.h
+2
-2
Utilities/otbossim/src/ossim/imaging/ossimTileMapTileSource.cpp
...ies/otbossim/src/ossim/imaging/ossimTileMapTileSource.cpp
+5
-137
No files found.
Utilities/otbossim/include/ossim/imaging/ossimTileMapTileSource.h
View file @
2ff0eee1
...
...
@@ -40,18 +40,6 @@ public:
virtual
bool
open
();
virtual
double
getNullPixelValue
(
ossim_uint32
band
=
0
)
const
;
virtual
double
getMinPixelValue
(
ossim_uint32
band
=
0
)
const
;
virtual
double
getMaxPixelValue
(
ossim_uint32
band
=
0
)
const
;
virtual
ossimScalarType
getOutputScalarType
()
const
;
bool
getAcquisitionDate
(
ossimDate
&
date
)
const
;
ossimString
getSatelliteName
()
const
;
ossimFilename
getBandFilename
(
ossim_uint32
idx
)
const
;
//! Returns the image geometry object associated with this tile source or NULL if non defined.
//! The geometry contains full-to-local image transform as well as projection (image-to-world)
...
...
@@ -62,28 +50,12 @@ public:
virtual
bool
loadState
(
const
ossimKeywordlist
&
kwl
,
const
char
*
prefix
=
NULL
);
/**
* @brief Gets a property for matching name.
* @param name The name of the property to get.
* @return Returns property matching "name".
*/
virtual
ossimRefPtr
<
ossimProperty
>
getProperty
(
const
ossimString
&
name
)
const
;
/**
* @brief Gets a list of property names available.
* @param propertyNames The list to push back names to.
*/
virtual
void
getPropertyNames
(
std
::
vector
<
ossimString
>&
propertyNames
)
const
;
protected:
virtual
~
ossimTileMapTileSource
();
private:
void
openHeader
(
const
ossimFilename
&
file
);
ossimRefPtr
<
ossimFfL7
>
theFfHdr
;
TYPE_DATA
};
...
...
Utilities/otbossim/include/ossim/projection/ossimTileMapModel.h
View file @
2ff0eee1
...
...
@@ -46,8 +46,6 @@ public:
ossimTileMapModel
(
const
ossimKeywordlist
&
geom_kwl
);
ossimTileMapModel
(
const
ossimTileMapModel
&
rhs
);
virtual
~
ossimTileMapModel
();
enum
ProjectionType
{
UNKNOWN_PROJECTION
=
0
,
...
...
@@ -141,6 +139,8 @@ public:
protected:
virtual
~
ossimTileMapModel
();
/*!
* Initializes the model given a fast format header.
*/
...
...
Utilities/otbossim/src/ossim/imaging/ossimTileMapTileSource.cpp
View file @
2ff0eee1
...
...
@@ -16,8 +16,6 @@
#include <ossim/base/ossimTrace.h>
#include <ossim/base/ossimNotifyContext.h>
#include <ossim/base/ossimKeywordNames.h>
#include <ossim/support_data/ossimFfL7.h>
#include <ossim/support_data/ossimFfL5.h>
#include <ossim/projection/ossimTileMapModel.h>
RTTI_DEF1_INST
(
ossimTileMapTileSource
,
...
...
@@ -32,8 +30,7 @@ static ossimTrace traceDebug("ossimTileMapTileSource:debug");
//*******************************************************************
ossimTileMapTileSource
::
ossimTileMapTileSource
()
:
ossimGeneralRasterTileSource
(),
theFfHdr
(
NULL
)
ossimGeneralRasterTileSource
()
{
}
...
...
@@ -43,8 +40,7 @@ ossimTileMapTileSource::ossimTileMapTileSource()
ossimTileMapTileSource
::
ossimTileMapTileSource
(
const
ossimKeywordlist
&
kwl
,
const
char
*
prefix
)
:
ossimGeneralRasterTileSource
(),
theFfHdr
(
NULL
)
ossimGeneralRasterTileSource
()
{
if
(
loadState
(
kwl
,
prefix
)
==
false
)
{
...
...
@@ -57,7 +53,7 @@ ossimTileMapTileSource::ossimTileMapTileSource(const ossimKeywordlist& kwl,
//*******************************************************************
ossimTileMapTileSource
::~
ossimTileMapTileSource
()
{
theFfHdr
=
NULL
;
//
theFfHdr = NULL;
}
bool
ossimTileMapTileSource
::
open
()
...
...
@@ -76,36 +72,6 @@ bool ossimTileMapTileSource::open()
return
false
;
}
void
ossimTileMapTileSource
::
openHeader
(
const
ossimFilename
&
file
)
{
//***
// TileMap file name example: l71024031_03119990929_hpn.fst
// Three header header file type substrings:
// HPN = Pan
// HRF = VNIR/SWIR (visible near infrared/shortwave infrared)
// HTM = Thermal
//***
ossimFilename
hdr
=
file
.
file
();
hdr
.
downcase
();
if
(
hdr
.
contains
(
"hpn"
)
||
hdr
.
contains
(
"hrf"
)
||
hdr
.
contains
(
"htm"
)
)
{
theFfHdr
=
new
ossimFfL7
(
file
.
c_str
());
}
else
if
(
hdr
.
contains
(
"header.dat"
))
{
theFfHdr
=
new
ossimFfL5
(
file
.
c_str
());
}
else
{
theFfHdr
=
NULL
;
return
;
}
if
(
theFfHdr
->
getErrorStatus
()
!=
ossimErrorCodes
::
OSSIM_OK
)
{
theFfHdr
=
0
;
}
return
;
}
ossimImageGeometry
*
ossimTileMapTileSource
::
getImageGeometry
()
{
...
...
@@ -113,10 +79,10 @@ ossimImageGeometry* ossimTileMapTileSource::getImageGeometry()
if
(
result
->
getProjection
())
return
theGeometry
.
get
();
if
(
!
theFfHdr
)
return
result
;
//
if (!theFfHdr) return result;
// Make a model
ossimTileMapModel
*
model
=
new
ossimTileMapModel
(
*
theFfHdr
);
ossimTileMapModel
*
model
=
new
ossimTileMapModel
();
if
(
model
->
getErrorStatus
()
!=
ossimErrorCodes
::
OSSIM_OK
)
return
false
;
...
...
@@ -134,33 +100,6 @@ bool ossimTileMapTileSource::loadState(const ossimKeywordlist& kwl,
}
ossimRefPtr
<
ossimProperty
>
ossimTileMapTileSource
::
getProperty
(
const
ossimString
&
name
)
const
{
ossimRefPtr
<
ossimProperty
>
result
=
0
;
if
(
theFfHdr
.
valid
())
{
result
=
theFfHdr
->
getProperty
(
name
);
}
if
(
result
.
valid
()
==
false
)
{
result
=
ossimGeneralRasterTileSource
::
getProperty
(
name
);
}
return
result
;
}
void
ossimTileMapTileSource
::
getPropertyNames
(
std
::
vector
<
ossimString
>&
propertyNames
)
const
{
if
(
theFfHdr
.
valid
())
{
theFfHdr
->
getPropertyNames
(
propertyNames
);
}
ossimGeneralRasterTileSource
::
getPropertyNames
(
propertyNames
);
}
ossimString
ossimTileMapTileSource
::
getShortName
()
const
{
...
...
@@ -177,76 +116,5 @@ ossimString ossimTileMapTileSource::className() const
return
ossimString
(
"ossimTileMapTileSource"
);
}
double
ossimTileMapTileSource
::
getNullPixelValue
(
ossim_uint32
)
const
{
return
0.0
;
}
double
ossimTileMapTileSource
::
getMinPixelValue
(
ossim_uint32
)
const
{
return
1.0
;
}
double
ossimTileMapTileSource
::
getMaxPixelValue
(
ossim_uint32
)
const
{
return
255.0
;
}
ossimScalarType
ossimTileMapTileSource
::
getOutputScalarType
()
const
{
return
OSSIM_UINT8
;
}
bool
ossimTileMapTileSource
::
getAcquisitionDate
(
ossimDate
&
date
)
const
{
if
(
!
theFfHdr
)
return
false
;
theFfHdr
->
getAcquisitionDate
(
date
);
return
true
;
}
ossimString
ossimTileMapTileSource
::
getSatelliteName
()
const
{
if
(
!
theFfHdr
)
return
""
;
return
theFfHdr
->
getSatelliteName
();
}
ossimFilename
ossimTileMapTileSource
::
getBandFilename
(
ossim_uint32
idx
)
const
{
ossim_uint32
maxIdx
=
getNumberOfInputBands
();
if
(
!
theFfHdr
||
(
idx
>
maxIdx
))
{
return
""
;
}
ossimFilename
path
=
getFilename
().
path
();
ossimString
filename
=
theFfHdr
->
getBandFilename
(
idx
);
filename
=
filename
.
trim
();
ossimFilename
file
=
path
.
dirCat
(
filename
);
if
(
file
.
exists
())
{
return
file
;
}
// Try downcased name.
file
=
path
.
dirCat
(
filename
.
downcase
());
if
(
file
.
exists
())
{
return
file
;
}
// Try upcase name.
file
=
path
.
dirCat
(
filename
.
upcase
());
if
(
file
.
exists
())
{
return
file
;
}
return
ossimFilename
();
}
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