MeteoIODoc 20240502.aefd3c94
DEMAlgorithms.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2018 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
4/***********************************************************************************/
5/* This file is part of MeteoIO.
6 MeteoIO is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 MeteoIO is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef DEMALGORITHMS_H
20#define DEMALGORITHMS_H
21
24
25namespace mio {
26
33 public:
34 static Grid2DObject getHillshade(const DEMObject& dem, const double& elev, const double& azimuth);
35 static double getHorizon(const DEMObject& dem, const size_t& ix1, const size_t& iy1, const double& bearing);
36 static double getHorizon(const DEMObject& dem, Coords point, const double& bearing);
37 static std::vector< std::pair<double,double> > getHorizonScan(const DEMObject& dem, Coords point, const double& increment);
38 static std::map< std::string, std::vector< std::pair<double,double> > > readHorizonScan(const std::string& where, const std::string& filename);
39 static double getHorizon(const std::vector< std::pair<double,double> > &horizon, const double& azimuth);
40 static void writeHorizons(const std::map< std::string, std::vector< std::pair<double,double> > >& horizon, const std::string& filename);
41 static double getCellSkyViewFactor(const DEMObject& dem, const size_t& ii, const size_t& jj);
42
43 private:
44 static double getSearchDistance(const DEMObject& dem);
45 static double getTanMaxSlope(const DEMObject& dem, const double& dmax, const double& bearing, const size_t& i, const size_t& j);
46};
47} //end namespace
48
49#endif
A class to handle geographic coordinate systems. This class offers an easy way to transparently conve...
Definition: Coords.h:83
A static class to compute various DEM-related parameters (such as shading, view factors,...
Definition: DEMAlgorithms.h:32
static std::map< std::string, std::vector< std::pair< double, double > > > readHorizonScan(const std::string &where, const std::string &filename)
Read the horizons from a given set of points looking 360 degrees around provided in a file.
Definition: DEMAlgorithms.cc:211
static Grid2DObject getHillshade(const DEMObject &dem, const double &elev, const double &azimuth)
Computes the hillshade for the dem This "fake illumination" method is used to better show the relief ...
Definition: DEMAlgorithms.cc:53
static double getCellSkyViewFactor(const DEMObject &dem, const size_t &ii, const size_t &jj)
Compute the sky view factors for the terrain radiation based on the DEM. This is inspired (ie with so...
Definition: DEMAlgorithms.cc:355
static double getHorizon(const DEMObject &dem, const size_t &ix1, const size_t &iy1, const double &bearing)
Returns the tangente of the horizon from a given point looking toward a given bearing.
Definition: DEMAlgorithms.cc:101
static std::vector< std::pair< double, double > > getHorizonScan(const DEMObject &dem, Coords point, const double &increment)
Returns the horizon from a given point looking 360 degrees around by increments. If the provided poin...
Definition: DEMAlgorithms.cc:167
static void writeHorizons(const std::map< std::string, std::vector< std::pair< double, double > > > &horizon, const std::string &filename)
Write to a file the horizons from a given set of points looking 360 degrees around.
Definition: DEMAlgorithms.cc:286
A class to represent DEMs and automatically compute some properties. This class stores elevation grid...
Definition: DEMObject.h:40
A class to represent 2D Grids. Typical application as DEM or Landuse Model.
Definition: Grid2DObject.h:42
double bearing(std::string bearing_str)
Converts a string bearing to a compass bearing.
Definition: IOUtils.cc:76
Definition: Config.cc:31