Simulation von Bürgern
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233
  1. PVector v2_coordinates = new PVector(48.799337, 9.794482); //badmauer; x: latitude, y: longitude
  2. boolean b_isRaining;
  3. void initWeather(){
  4. //sunrise / sunset API: https://sunrise-sunset.org/api
  5. JSONObject sun;
  6. if(b_loadSun) sun = loadJSONObject("https://api.sunrise-sunset.org/json?lat=" + v2_coordinates.x + " &lng=" + v2_coordinates.y);
  7. else sun = loadJSONObject(dataPath("weather/today.json"));
  8. println(sun);
  9. }
  10. /* backup json today (if api has yet to encounter limits)
  11. {
  12. "results": {
  13. "sunrise": "7:13:29 AM",
  14. "solar_noon": "11:25:52 AM",
  15. "day_length": "08:24:45",
  16. "astronomical_twilight_end": "5:33:03 PM",
  17. "astronomical_twilight_begin": "5:18:41 AM",
  18. "sunset": "3:38:14 PM",
  19. "civil_twilight_end": "4:14:48 PM",
  20. "nautical_twilight_end": "4:54:50 PM",
  21. "civil_twilight_begin": "6:36:55 AM",
  22. "nautical_twilight_begin": "5:56:54 AM"
  23. },
  24. "status": "OK"
  25. }
  26. */