<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi,</p>
<p><br>
</p>
<p>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.<br>
</p>
<p>So you should first check that there's a lunar one associated to
yours</p>
<p>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"</p>
<p>Or you can create a VRT wrapping your DEM with something like:</p>
<p>gdal_translate your_input_dem temp.vrt -a_srs "+proj=longlat
+R=1737400 +no_defs +type=crs"</p>
<p>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)</p>
<p><br>
</p>
<p>Even<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Le 30/08/2022 à 01:45, Bradner, Kevin
M. (ARC-TI) via gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CO6PR09MB87412B1DC8A771C01293345C8A769@CO6PR09MB8741.namprd09.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Hello,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
I'm interested in using <a
href="https://gdal.org/programs/gdal_viewshed.html#gdal-viewshed"
title="https://gdal.org/programs/gdal_viewshed.html#gdal-viewshed"
moz-do-not-send="true">
gdal_viewshed</a> 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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Thank you,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Kevin Bradner</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview
_EReadonly_1" style="font-family: Calibri, Arial, Helvetica,
sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>