{"version":"1.0","type":"rich","title":"Test of SunCalc in SQL","description":"This example demonstrates how the SunCalc library’s solar position and event calculations can be ported to SQL, using PostgreSQL functions to compute azimuth, altitude, declination, and right ascension for a given time and location. It defines custom types and functions such as `SunCalc_GetPosition`, `SunCalc_SunCoords`, and `SunCalc_solarTransitJ`, mirroring the original JavaScript API. The code relies on plpgsql, PostGIS geometry for coordinates, and standard trigonometric functions, showing how to bring astronomical calculations into a relational database environment.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-b2b7b7da7dff71e17b7c?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}