boku-ilen / landscapelab

Geodata-driven Landscape Visualization built with Godot and Geodot
https://landscapelab.boku.ac.at/
Other
37 stars 12 forks source link

DateTime sun calculation is always done in UTC #321

Open MathiasBaumgartinger opened 1 year ago

MathiasBaumgartinger commented 1 year ago

The calculations done in World/Environment/SunPosition.gd:get_solar_angles_for_datetime seem off (or are not properly applied).

E.g.: Sunset is at ~18:30 on June 21st which cannot be true image

kb173 commented 1 year ago

It's UTC, you need to add 2 hours for CEST

kb173 commented 1 year ago

Not sure how we can improve this without a large amount of overhead. there is Time.get_time_zone_from_system(), but that would not account for summer/winter time based on the configured time of day. We could add a manual check for that specifically for CET/CEST, but we may be in a different geographic area than the system. For a proper solution, we'd need to add a library like https://github.com/BertoldVdb/ZoneDetect to Geodot or a new separate GDExtension. Otherwise, maybe we can just add a small note to the UI?

kb173 commented 9 months ago

We could add time zone config into the .ll config in form of the UTC+? hours, something like this:

"Metadata": {
    "TimeZone": 2,
}