diff --git a/cmd/save-gob/main.go b/cmd/save-gob/main.go index 63fe08b..73aac6c 100644 --- a/cmd/save-gob/main.go +++ b/cmd/save-gob/main.go @@ -26,7 +26,7 @@ func main() { b := placenames.NamedBoundary{ Name: r.Name, Type: r.LocalType, - County: r.CountyUnitary, + County: coalesce(r.CountyUnitary, r.DistrictBorough), Xmin: r.MbrXMin, Ymin: r.MbrYMin, Xmax: r.MbrXMax, @@ -41,3 +41,12 @@ func main() { log.Fatal(err) } } + +func coalesce(xs ...string) string { + for _, x := range xs { + if len(x) > 0 { + return x + } + } + return "" +}