OSM: Add Village field to Address struct #166

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2019-12-21 16:22:24 +01:00
parent 768b039889
commit 245c8beb69
3 changed files with 4 additions and 1 deletions

View file

@ -164,7 +164,7 @@ func TestLocation_Assign(t *testing.T) {
assert.Equal(t, "8G757G9P+", l.ID)
assert.Equal(t, "Pink Beach", l.LocTitle)
assert.Equal(t, "Crete, Greece", l.LocDescription)
assert.Equal(t, "Chrisoskalitissa, Crete, Greece", l.LocDescription)
})
t.Run("NewJersey", func(t *testing.T) {

View file

@ -5,6 +5,7 @@ type Address struct {
Road string `json:"road"`
Suburb string `json:"suburb"`
Town string `json:"town"`
Village string `json:"village"`
City string `json:"city"`
Postcode string `json:"postcode"`
County string `json:"county"`

View file

@ -77,6 +77,8 @@ func (o Location) City() (result string) {
result = o.Address.City
} else if o.Address.Town != "" {
result = o.Address.Town
} else if o.Address.Village != "" {
result = o.Address.Village
} else if o.Address.County != "" {
result = o.Address.County
} else if o.Address.State != "" {