~ecs/quaternia

860949bea8a89d6bc2f097548b3badddddc34873 — Eyal Sawady 12 days ago 99803c3
Improve reverse geocoding
1 files changed, 11 insertions(+), 2 deletions(-)

M wttr.go
M wttr.go => wttr.go +11 -2
@@ 53,8 53,17 @@ func (wttr) Output(args []string, f Flags, c *girc.Client, e girc.Event, ch chan
	if err != nil || addr == nil {
		name = fmt.Sprintf("%f,%f", loc.Lat, loc.Long)
	} else {
		name = fmt.Sprintf("%s, %s, %s", addr.Suburb, addr.State,
			addr.CountryCode)
		city := ""
		state := ""
		if addr.Suburb != "" {
			city = addr.Suburb + ", "
		} else if addr.City != "" {
			city = addr.City + ", "
		}
		if addr.State != "" {
			state = addr.State + ", "
		}
		name = city + state + addr.CountryCode
	}

	coords := &owm.Coordinates{