Skip to content

Commit

Permalink
Clarify units for the DEM classes
Browse files Browse the repository at this point in the history
* Avoid users asking whether the height and elevation functions are the
  same
* Match common conventions like in GDAL to refer to things in "raster"
  coordinates with "pixels" indicating each point on a DEM
* https://gdal.org/tutorials/raster_api_tut.html

Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 committed Apr 20, 2024
1 parent 5794473 commit a184fd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions geospatial/include/gz/common/geospatial/Dem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ namespace gz
public: int Load(const std::string &_filename = "");

/// \brief Get the elevation of a terrain's point in meters.
/// \param[in] _x X coordinate of the terrain.
/// \param[in] _y Y coordinate of the terrain.
/// \param[in] _x X coordinate of the terrain in raster coordinates.
/// \param[in] _y Y coordinate of the terrain in raster coordinates.
/// \return Terrain's elevation at (x,y) in meters or infinity if illegal
/// coordinates were provided.
public: double Elevation(double _x, double _y);
Expand Down
6 changes: 3 additions & 3 deletions geospatial/include/gz/common/geospatial/HeightmapData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace gz
/// Ex: A subsampling of 2 in a terrain of 129x129 means that the height
/// vector will be 257 * 257.
/// \param[in] _vertSize Number of points per row.
/// \param[in] _size Real dimmensions of the terrain.
/// \param[in] _size Real dimensions of the terrain.
/// \param[in] _scale Vector3 used to scale the height.
/// \param[in] _flipY If true, it inverts the order in which the vector
/// is filled.
Expand All @@ -48,11 +48,11 @@ namespace gz
std::vector<float> &_heights) const = 0;

/// \brief Get the terrain's height.
/// \return The terrain's height.
/// \return The terrain's height [pixels].
public: virtual unsigned int Height() const = 0;

/// \brief Get the terrain's width.
/// \return The terrain's width.
/// \return The terrain's width [pixels].
public: virtual unsigned int Width() const = 0;

/// \brief Get the maximum terrain's elevation.
Expand Down

0 comments on commit a184fd1

Please sign in to comment.