summaryrefslogtreecommitdiffstats
path: root/nws
diff options
context:
space:
mode:
Diffstat (limited to 'nws')
-rw-r--r--nws/nws.go2
-rw-r--r--nws/nws_test.go6
2 files changed, 8 insertions, 0 deletions
diff --git a/nws/nws.go b/nws/nws.go
index 1ae7df5..243506b 100644
--- a/nws/nws.go
+++ b/nws/nws.go
@@ -13,6 +13,8 @@ import (
)
type NWSPointProperties struct {
+ GridX int
+ GridY int
ForecastLink string `json:"forecast"`
ForecastHourlyLink string `json:"forecastHourly"`
}
diff --git a/nws/nws_test.go b/nws/nws_test.go
index e53788d..db288d2 100644
--- a/nws/nws_test.go
+++ b/nws/nws_test.go
@@ -17,6 +17,12 @@ func TestPoints(t *testing.T) {
if np.Properties.ForecastHourlyLink != "https://api.weather.gov/gridpoints/CLE/33,42/forecast/hourly" {
t.Errorf("points: forcecast link: '%v'", np.Properties.ForecastHourlyLink)
}
+ if np.Properties.GridX != 33 {
+ t.Errorf("points: gridx: %v", np.Properties.GridX)
+ }
+ if np.Properties.GridY != 42 {
+ t.Errorf("points: gridy: %v", np.Properties.GridY)
+ }
// Test invalid lat,lng
np, err = Points(115.0, -83.177)