mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-02 01:00:46 +00:00
updated NOAAImporter to use IGRF model for pre-2024 dates
This commit is contained in:
1 parent
ce9c814b6b
commit
ad7c5e472f
1 file changed
+3
-1
+3
-1
@@ -56,8 +56,10 @@ public class NOAAImporter extends DeclinationImporter {
|
||||
Date date = timePoint.asDate();
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
final int year = calendar.get(Calendar.YEAR);
|
||||
URL url = new URL(QUERY_URL+"?key=zNEw7&lon1="+position.getLngDeg()+"&lat1="+position.getLatDeg()+"&startYear=" + calendar.get(Calendar.YEAR) + "&startMonth="
|
||||
+ (calendar.get(Calendar.MONTH) + 1) + "&startDay=" + calendar.get(Calendar.DAY_OF_MONTH)+"&resultFormat=xml");
|
||||
+ (calendar.get(Calendar.MONTH) + 1) + "&startDay=" + calendar.get(Calendar.DAY_OF_MONTH)+"&resultFormat=xml"
|
||||
+(year < 2024 ? "&model=IGRF":"")); // WMM / WMMHR start only in 2024; earlier years need to be solved by the IGRF model
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
|
||||
conn.setRequestProperty("Accept-Language", "en-US,en;q=0.8");
|
||||
|
||||
Reference in new issue
Block a user