summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nws/nws.go20
-rw-r--r--nws/nws_test.go7
2 files changed, 22 insertions, 5 deletions
diff --git a/nws/nws.go b/nws/nws.go
index aebfed8..4fc1727 100644
--- a/nws/nws.go
+++ b/nws/nws.go
@@ -12,12 +12,22 @@ import (
"ricketyspace.net/peach/client"
)
+type PointLocationProperties struct {
+ City string
+ State string
+}
+
+type PointLocation struct {
+ Properties PointLocationProperties
+}
+
type NWSPointProperties struct {
- GridId string
- GridX int
- GridY int
- Forecast string
- ForecastHourly string
+ GridId string
+ GridX int
+ GridY int
+ Forecast string
+ ForecastHourly string
+ RelativeLocation PointLocation
}
type NWSPoint struct {
diff --git a/nws/nws_test.go b/nws/nws_test.go
index 27f56e4..fde4ea4 100644
--- a/nws/nws_test.go
+++ b/nws/nws_test.go
@@ -28,6 +28,13 @@ func TestPoints(t *testing.T) {
t.Errorf("points: gridy: %v", np.Properties.GridY)
}
+ if np.Properties.RelativeLocation.Properties.City != "Tiffin" {
+ t.Errorf("points: location: city: %v", np.Properties)
+ }
+ if np.Properties.RelativeLocation.Properties.State != "OH" {
+ t.Errorf("points: location: state: %v", np.Properties)
+ }
+
// Test invalid lat,lng
np, err = Points(115.0, -83.177)
if err == nil {