[gdal-dev] use gdal_viewshed

Even Rouault even.rouault at spatialys.com
Tue Aug 30 02:25:33 PDT 2022


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 at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220830/83fc957c/attachment.htm>


More information about the gdal-dev mailing list