[QGIS-Developer] Sunrise, Sunset, Lunar Calculations

Nyall Dawson nyall.dawson at gmail.com
Sun Jun 30 18:09:57 PDT 2019


On Fri, 28 Jun 2019 at 23:13, C Hamilton <adenaculture at gmail.com> wrote:
>
> Thank you for all the comments. To summarize.
>
> 1. Having this capability would be useful.
> 2. Take a look at pvlib.
> 3. Add it to expression functions and possibly add it as a core C++ function.
> 4. Take a look at GRASS r.sun and related commands.
> 5. Take a look at the astral library.
> 6. Take a look at GEarthView
>
> 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.
>
> 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.
>

I think (given Martin's desire to add this capability to the 3d
engine) that yes, there's a valid use case for this. And I'd MUCH
prefer to have this out of the box vs a 3rd party plugin. I'd suggest
doing a review of the available libraries, in order to determine which
are possible candidates wrt to features and license, and also
determine how actively maintained upstream is, and then we can make an
informed decision from there...

Nyall


More information about the QGIS-Developer mailing list