Hi,

The -cc parameter is only taken into account if there's a CRS associated to the DEM, as the sphere diameter isn't hardcoded to be the one of Earth.

So you should first check that there's a lunar one associated to yours

If you use PROJ >= 8.1, you can use IAU:30100 or otherwise the PROJ4 style string "+proj=longlat +R=1737400 +no_defs +type=crs"

Or you can create a VRT wrapping your DEM with something like:

gdal_translate your_input_dem temp.vrt -a_srs "+proj=longlat +R=1737400 +no_defs +type=crs"

and then use temp.vrt as input for gdal_viewshed and use -cc 1 as there's no atmosphere on Moon (just thinking that gdal_viewshed should probably default to -cc 1 for non-Earth bodies)


Even


Le 30/08/2022 à 01:45, Bradner, Kevin M. (ARC-TI) via gdal-dev a écrit :
Hello,

I'm interested in using gdal_viewshed <https://gdal.org/programs/gdal_viewshed.html#gdal-viewshed> to calculate a viewshed for a point on the surface of the Moon. My DEM stores heights relative to a reference sphere approximately the size of the Moon.

Could I calculate a valid viewshed from this data by passing in a -cc of roughly 3.6 (Earth diameter / Moon diameter)? Some comments in the algorithm's source code make this seem reasonable, but I would like to confirm that this is the only correction I would need to make.

Thank you,
Kevin Bradner


_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

--
http://www.spatialys.com
My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to