Sirius  0.0.0
wrapper.h
Go to the documentation of this file.
1 
22 #ifndef SIRIUS_GDAL_WRAPPER_H_
23 #define SIRIUS_GDAL_WRAPPER_H_
24 
25 #include <string>
26 
27 #include "sirius/gdal/types.h"
28 #include "sirius/image.h"
29 
30 namespace sirius {
31 namespace gdal {
32 
36 struct GeoReference {
37  GeoReference();
38  GeoReference(const std::vector<double>& geo_trans,
39  const std::string& proj_ref);
40 
41  ~GeoReference() = default;
42  GeoReference(const GeoReference&) = default;
43  GeoReference& operator=(const GeoReference&) = default;
44  GeoReference(GeoReference&&) = default;
45  GeoReference& operator=(GeoReference&&) = default;
46 
47  std::vector<double> geo_transform;
48  std::string projection_ref;
49  bool is_initialized{false};
50 };
51 
52 Image LoadImage(const std::string& filepath);
53 
54 void SaveImage(const Image& image, const std::string& output_filepath,
55  const GeoReference& geoRef = {});
56 
57 DatasetUPtr LoadDataset(const std::string& filepath);
58 
59 DatasetUPtr CreateDataset(const std::string& filepath, int w, int h,
60  int n_bands, const GeoReference& geo_ref = {});
61 
67 GeoReference ComputeResampledGeoReference(const std::string& input_path,
68  const ZoomRatio& zoom_ratio);
69 
76 std::vector<double> ComputeResampledGeoTransform(GDALDataset* dataset,
77  const ZoomRatio& zoom_ratio);
78 
79 } // namespace gdal
80 } // namespace sirius
81 
82 #endif // SIRIUS_GDAL_WRAPPER_H_
Definition: exception.h:27
std::unique_ptr<::GDALDataset, detail::DatasetDeleter > DatasetUPtr
Definition: types.h:45
std::string projection_ref
Definition: wrapper.h:48
std::vector< double > ComputeResampledGeoTransform(GDALDataset *dataset, const ZoomRatio &zoom_ratio)
Compute output image origin and pixel size.
std::vector< double > geo_transform
Definition: wrapper.h:47
void SaveImage(const Image &image, const std::string &output_filepath, const GeoReference &geoRef={})
Image LoadImage(const std::string &filepath)
GeoReference ComputeResampledGeoReference(const std::string &input_path, const ZoomRatio &zoom_ratio)
Compute resampled georeference information.
DatasetUPtr CreateDataset(const std::string &filepath, int w, int h, int n_bands, const GeoReference &geo_ref={})
Data class that represents GDAL geo reference information.
Definition: wrapper.h:36
bool is_initialized
Definition: wrapper.h:49
GeoReference & operator=(const GeoReference &)=default
Data class that represents an image (Size + Buffer)
Definition: image.h:65
DatasetUPtr LoadDataset(const std::string &filepath)