Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Cresson Remi
NDVITimeSeries
Commits
1d4e1dcf
Commit
1d4e1dcf
authored
Sep 11, 2017
by
remi cresson
Browse files
ENH: Input dates are ASCII file with dates in the YYYYMMDD format
parent
76116a67
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/otbTimeSeriesIndexTrend.cxx
View file @
1d4e1dcf
...
...
@@ -166,13 +166,13 @@ private:
AddParameter
(
ParameterType_InputImageList
,
"ndvits"
,
"Input NDVI time series images"
);
// Input NDVI time series dates
AddParameter
(
ParameterType_
StringList
,
"ndvidates"
,
"Input NDVI time series dates
(Must be dd/mm/yyyy
format)"
);
AddParameter
(
ParameterType_
InputFilename
,
"ndvidates"
,
"Input NDVI time series dates
ASCII file (Must be YYYYMMDD
format)"
);
// Input rainfall time series images
AddParameter
(
ParameterType_InputImageList
,
"rainfts"
,
"Input rainfall time series images"
);
// Input rainfall time series dates
AddParameter
(
ParameterType_StringList
,
"rainfdates"
,
"Input rainfall time series dates (Must be
dd/mm/yyyy
format)"
);
AddParameter
(
ParameterType_StringList
,
"rainfdates"
,
"Input rainfall time series dates (Must be
YYYYMMDD
format)"
);
// Parameter group for NDVI time series
AddParameter
(
ParameterType_Group
,
"ndvi"
,
"NDVI Time series"
);
...
...
@@ -256,14 +256,16 @@ private:
}
/*
* Retrieve the dates (numeric) from the input dates (string) dd/mm/yyyy
* Retrieve the dates (numeric) from the input dates (string)
* Input dates (string) must be formated using the following pattern: YYYYMMDD
*/
std
::
vector
<
DateType
>
GetTimeSeriesDates
(
std
::
string
key
){
std
::
vector
<
std
::
string
>
list
=
this
->
GetParameterStringList
(
key
);
std
::
vector
<
DateType
>
dates
=
otb
::
dates
::
GetDatesFromStringVector
(
list
);
otbAppLogINFO
(
"Using "
<<
dates
.
size
()
<<
" input dates from "
<<
list
[
0
]
<<
" to "
<<
list
[
list
.
size
()
-
1
]
);
std
::
vector
<
DateType
>
dates
=
otb
::
dates
::
GetDatesFromFile
(
key
);
unsigned
int
n
=
dates
.
size
()
-
1
;
otbAppLogINFO
(
"Using "
<<
dates
.
size
()
<<
" input dates from "
<<
dates
[
0
].
year
<<
"/"
<<
dates
[
0
].
month
<<
"/"
<<
dates
[
0
].
day
<<
" to "
<<
dates
[
n
].
year
<<
"/"
<<
dates
[
n
].
month
<<
"/"
<<
dates
[
n
].
day
);
return
dates
;
}
...
...
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