<div dir="ltr"><div><div><div><div><div><div><div><div><div>Thank you for all the comments. To summarize.<br><br></div>1. Having this capability would be useful.<br></div>2. Take a look at pvlib.<br></div>3. Add it to expression functions and possibly add it as a core C++ function.<br></div>4. Take a look at GRASS r.sun and related commands.<br></div>5. Take a look at the astral library.<br></div>6. Take a look at GEarthView<br><br></div>My philosophy is that QGIS is a professional GIS application and as such its algorithms used need to be the most accurate that are available. The Sun and Lunar algorithms are not trivial and I would want to use an existing library. I know there are some simplified approximation algorithms that you find used on the web particularly in JavaScript mapping applications. I would prefer the more accurate algorithms, but will be limited somewhat with what I can easily include.<br><br></div>If this capability were to be added as core C functions, then I think you would need to link it to one of the astronomical libraries. I think all of the python libraries are probably in part derived from the C libraries. Is adding an astronomical library to QGIS of interest? I don't think we should use the simplified algorithms. I have not looked into C libraries, but I know that the author of Skyfield (formerly PyEphem which is now deprecated) based his code on the US Naval Observatory NOVAS library. I can see that having astronomical calculations in QGIS would be beneficial to some and could even open it up to other uses, but I don't know how much you would be interested in making these core functions, but lets start the discussion as it might affect my approach.<br><br></div>I have already been looking at possibly using one of the python libraries: astral, skyfield, astroplan, and astropy. I know some in the community disagree with including libraries with the plugin, but in my experience most of my users do not have root privileges and if the plugin requires the extra step of having system administrators pip install additional packages then it eliminates most users from being able to use the plugin. (Part of this is due to laziness.) So if I do this I will include the libraries with the plugin unless the QGIS community decides they would like to support astronomical calculations as a part of core QGIS.<br><div><div><div><div><div><br></div><div>Calvin<br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 28, 2019 at 3:52 AM Martin Dobias <<a href="mailto:wonder.sk@gmail.com">wonder.sk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Calvin<br>
<br>
On Thu, Jun 27, 2019 at 9:15 PM C Hamilton <<a href="mailto:adenaculture@gmail.com" target="_blank">adenaculture@gmail.com</a>> wrote:<br>
><br>
> How much interested would there be for a plugin to display sunrise and sunset information for a particular location on the earth's surface. Is anyone already working on this? There doesn't seem to be a capability for this, but perhaps I have missed it. Are there other astronomical calculations that would be worth while in QGIS? (Moon asimuth/position, phase)<br>
<br>
Just adding another +1 vote to have something like this in QGIS :-) At<br>
some point I would like to look into rendering of shadows of buildings<br>
in QGIS 3D - and for this it would be important to have the ability to<br>
calculate sun position.<br>
<br>
Cheers<br>
Martin<br>
</blockquote></div>