LoadCoverageSeriesFromGeotif.cpp
Go to the documentation of this file.
1 // TerraLib
2 #include <terralib/dataaccess.h>
3 #include <terralib/stmemory.h>
4 #include <terralib/st.h>
5 #include <terralib/datatype.h>
6 
7 // Examples
8 #include "STExamples.h"
9 
10 // STL
11 #include <iostream>
12 
13 std::unique_ptr<te::st::CoverageSeries> LoadCoverageSeriesFromGeotif()
14 {
15  try
16  {
17  //Indicates the data source
19  const std::string connInfo("file://" TERRALIB_DATA_DIR "/st/coverage/geotif");
20  dsinfo.setConnInfo(connInfo);
21  dsinfo.setType("GDAL");
22 
23  //It creates a new Data Source and put it into the manager
25 
26  //Indicates the raster file names and their associated times
28 
30  te::st::RasterCoverageDataSetInfo infoRaster1(dsinfo, "hidro_3_20091231000000.tif", "", time1);
31  cvsinfo.push_back(infoRaster1);
32 
34  te::st::RasterCoverageDataSetInfo infoRaster2(dsinfo, "hidro_3_20091231010000.tif", "", time2);
35  cvsinfo.push_back(infoRaster2);
36 
38  te::st::RasterCoverageDataSetInfo infoRaster3(dsinfo, "hidro_3_20091231020000.tif", "", time3);
39  cvsinfo.push_back(infoRaster3);
40 
41  //Use the STDataLoader to create a CoverageSeries
43  }
44  catch(const std::exception& e)
45  {
46  std::cout << std::endl << "An exception has occurred in TrajectoryExamplesFromKML: " << e.what() << std::endl;
47  }
48  catch(...)
49  {
50  std::cout << std::endl << "An unexpected exception has occurred in TrajectoryExamplesFromKML!" << std::endl;
51  }
52 
53  return std::unique_ptr<te::st::CoverageSeries>(nullptr);
54 }
55 
This file contains include headers for the Data Type module of TerraLib.
static std::unique_ptr< CoverageSeries > getCoverageSeries(const PointCoverageSeriesDataSetInfo &info, AbstractPointCoverageInterp *interp)
It returns a point coverage series.
std::vector< RasterCoverageDataSetInfo > RasterCoverageSeriesDataSetInfo
Examples on how to load/manipulate st types.
A class to represent time instant.
Definition: TimeInstant.h:55
This file contains include headers for the TerraLib ST memory module.
void setType(const std::string &dsType)
void CreateDataSourceAndUpdateManager(te::da::DataSourceInfo &dsinfo)
It creates a new DataSource and put it into the DataSource manager, using a random id...
void setConnInfo(const te::core::URI &conninfo)
A base class for date data types.
Definition: Date.h:53
A class to represent time duration with nano-second/micro-second resolution.
Definition: TimeDuration.h:51
A class that contains infos about a DataSource and DataSet that contains observations of a raster cov...
A class that represents a data source component.
This file contains include headers for the TerraLib ST module.
This file contains include headers for the Data Access module of TerraLib.
std::unique_ptr< te::st::CoverageSeries > LoadCoverageSeriesFromGeotif()
It loads a coverage series from a set of geotif files.