SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
CVImageGeoTiff.h
Go to the documentation of this file.
1 /**
2  * \file cv/CVImageGeoTiff.h
3  * \date Spring 2017
4  * \authors Marcus Hudritsch
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef CVIMAGEGEOTIFF_H
11 #define CVIMAGEGEOTIFF_H
12 
13 #include <CVImage.h>
14 
15 //-----------------------------------------------------------------------------
16 //! Encapsulates a GEOTiff images with geo referenced meta information
17 /*! A GEOTiff image can hold per pixel the height information of a "rectangular"
18  area on earth that is defined with upper-left and lower-left corner in longitude
19  and latitude coordinates. With the loadGeoTiff function only GeoTiffs with
20  WGS84 (EPSG 4326) coordinates can be loaded.
21  GeoTiff with other coordinate reference systems e.g. the Swiss LV95 can be
22  converted first in tools such as QGIS. Because we can not load the meta
23  information with OpenCV we have to store them in a separate json file with
24  the same name. They are generated with a tool that comes with QGIS as follows:
25  gdalinfo -json DTM-Aventicum-WGS84.tif > DTM-Aventicum-WGS84.json
26  */
27 class CVImageGeoTiff : public CVImage
28 {
29 public:
32 
33  void loadGeoTiff(const string& filename);
36  float getAltitudeAtLatLon(double lat, double lon) const;
37 
38 private:
39  CVVec3d _upperleftLatLonAlt; //! Upper-left corner of DEM in WGS84 coords
40  CVVec3d _lowerRightLatLonAlt; //! Lower-right corner of DEM in WGS84 coords
41  double _noDataValue; //! double pixel value that stands for no data
42 };
43 //-----------------------------------------------------------------------------
44 #endif
cv::Vec3d CVVec3d
Definition: CVTypedefs.h:53
Encapsulates a GEOTiff images with geo referenced meta information.
CVVec3d _upperleftLatLonAlt
CVVec3d lowerRightLatLonAlt() const
CVVec3d _lowerRightLatLonAlt
Upper-left corner of DEM in WGS84 coords.
double _noDataValue
Lower-right corner of DEM in WGS84 coords.
void loadGeoTiff(const string &filename)
Loads a GEOTiff file into the OpenCV image matrix.
float getAltitudeAtLatLon(double lat, double lon) const
Returns the altitude in m at the given position in WGS84 latitude-longitude.
CVVec3d upperLeftLatLonAlt() const
OpenCV image class with the same interface as the former SLImage class.
Definition: CVImage.h:64