Skip to content

Commit

Permalink
fix: weather URL, closes #257
Browse files Browse the repository at this point in the history
  • Loading branch information
TwinFan committed Oct 20, 2023
1 parent 29ac176 commit 3bd869e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else()
endif()

project(LiveTraffic
VERSION 3.4.1
VERSION 3.4.2
DESCRIPTION "LiveTraffic X-Plane plugin")

# Provide compile macros from the above project version definition
Expand Down
4 changes: 2 additions & 2 deletions Include/LTWeather.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// @file LTWeather.h
/// @brief Fetch real weather information from AWC
/// @see https://www.aviationweather.gov/dataserver/example?datatype=metar
/// @see https://aviationweather.gov/data/api/#/Dataserver/dataserverMetars
/// @author Birger Hoppe
/// @copyright (c) 2018-2020 Birger Hoppe
/// @copyright (c) 2018-2023 Birger Hoppe
/// @copyright Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
Expand Down
6 changes: 3 additions & 3 deletions LiveTraffic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
KnownAssetTags = (
New,
);
LastUpgradeCheck = 1410;
LastUpgradeCheck = 1420;
};
buildConfigurationList = D607B16209A5563100699BC3 /* Build configuration list for PBXProject "LiveTraffic" */;
compatibilityVersion = "Xcode 12.0";
Expand Down Expand Up @@ -790,7 +790,7 @@
LIVETRAFFIC_VERSION_BETA = 0;
LIVETRAFFIC_VER_MAJOR = 3;
LIVETRAFFIC_VER_MINOR = 4;
LIVETRAFFIC_VER_PATCH = 1;
LIVETRAFFIC_VER_PATCH = 2;
LLVM_LTO = NO;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.15;
Expand Down Expand Up @@ -896,7 +896,7 @@
LIVETRAFFIC_VERSION_BETA = 0;
LIVETRAFFIC_VER_MAJOR = 3;
LIVETRAFFIC_VER_MINOR = 4;
LIVETRAFFIC_VER_PATCH = 1;
LIVETRAFFIC_VER_PATCH = 2;
LLVM_LTO = YES;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.15;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
LastUpgradeVersion = "1420"
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
10 changes: 5 additions & 5 deletions Src/LTWeather.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// @file LTWeather.cpp
/// @brief Fetch real weather information from AWC
/// @see https://www.aviationweather.gov/dataserver/example?datatype=metar
/// @see Example request: Latest weather 25 statute miles around EDLE, limited to the fields we are interested in:
/// https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&radialDistance=100;-118.9385,33.4036&hoursBeforeNow=2&mostRecent=true&fields=raw_text,station_id,latitude,longitude,altim_in_hg
/// @see https://aviationweather.gov/data/api/#/Dataserver/dataserverMetars
/// @see Example request: Latest weather somewhere around EDDL, limited to the fields we are interested in:
/// https://aviationweather.gov//cgi-bin/data/dataserver.php?requestType=retrieve&dataSource=metars&format=xml&boundingBox=45.5,0.5,54.5,9,5&hoursBeforeNow=2&mostRecent=true&fields=raw_text,station_id,latitude,longitude,altim_in_hg
/// @details Example response:
/// @code{.xml}
/// <response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XML-Schema-instance" version="1.2" xsi:noNamespaceSchemaLocation="http://aviationweather.gov/adds/schema/metar1_2.xsd">
Expand Down Expand Up @@ -52,7 +52,7 @@
/// @endcode
///
/// @author Birger Hoppe
/// @copyright (c) 2018-2020 Birger Hoppe
/// @copyright (c) 2018-2023 Birger Hoppe
/// @copyright Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
Expand All @@ -76,7 +76,7 @@
//

/// The request URL, parameters are in this order: radius, longitude, latitude
const char* WEATHER_URL="https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&minLat=%.2f&minLon=%.2f&maxLat=%.2f&maxLon=%.2f&hoursBeforeNow=2&mostRecent=true&fields=raw_text,station_id,latitude,longitude,altim_in_hg";
const char* WEATHER_URL="https://aviationweather.gov/cgi-bin/data/dataserver.php?requestType=retrieve&dataSource=metars&format=xml&hoursBeforeNow=2&mostRecent=true&boundingBox=%.2f,%.2f,%.2f,%.2f&fields=raw_text,station_id,latitude,longitude,altim_in_hg";

/// Weather search radius (increment) to use if the initial weather request came back empty
constexpr float ADD_WEATHER_RADIUS_NM = 100.0f;
Expand Down

0 comments on commit 3bd869e

Please sign in to comment.