Skip to content

Commit c22c05e

Browse files
committed
Merge commit '628e1f27b1b965db1c6fcf074fd292753b867a6c'
2 parents 7412ab0 + 628e1f2 commit c22c05e

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

agrolib/gis/gis.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,4 +2194,19 @@ namespace gis
21942194
}
21952195

21962196

2197+
bool computeWaterRunoffPath(const Crit3DRasterGrid& inputRaster, Crit3DRasterGrid& outputRaster, double xStart, double yStart)
2198+
{
2199+
outputRaster.initializeGrid(inputRaster);
2200+
2201+
// set first value
2202+
int row, col;
2203+
inputRaster.getRowCol(xStart, yStart, row, col);
2204+
if (! inputRaster.isOutOfGrid(row, col))
2205+
outputRaster.value[row][col] = 0.;
2206+
2207+
// todo
2208+
2209+
return true;
2210+
}
2211+
21972212
}

agrolib/gis/gis.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@
309309
bool extractBasin(const Crit3DRasterGrid& inputRaster, Crit3DRasterGrid& outputRaster, double xClosure, double yClosure);
310310
void cleanRasterEmptyFrame(const Crit3DRasterGrid& inputRaster, Crit3DRasterGrid& outputRaster);
311311

312+
bool computeWaterRunoffPath(const Crit3DRasterGrid& inputRaster, Crit3DRasterGrid& outputRaster, double xStart, double yStart);
313+
312314
bool writeEsriGridHeader(const std::string &fileName, gis::Crit3DRasterHeader *header, std::string &errorStr);
313315
bool writeEsriGridFlt(const std::string &fileName, Crit3DRasterGrid* myGrid, std::string &errorStr);
314316
}

agrolib/mathFunctions/commonConstants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@
252252
#define EPSILON 0.00001
253253
#endif
254254
#define EULER 2.718281828459
255-
#define DEG_TO_RAD 0.0174532925
256-
#define RAD_TO_DEG 57.2957795
255+
#define DEG_TO_RAD 0.01745329252
256+
#define RAD_TO_DEG 57.295779513
257257
#define SQRT_2 1.41421356237
258258
#define GOLDEN_SECTION 1.6180339887499
259259

0 commit comments

Comments
 (0)