Use district when county is not available.
This commit is contained in:
parent
af15ee6707
commit
88336110e0
1 changed files with 10 additions and 1 deletions
|
@ -26,7 +26,7 @@ func main() {
|
||||||
b := placenames.NamedBoundary{
|
b := placenames.NamedBoundary{
|
||||||
Name: r.Name,
|
Name: r.Name,
|
||||||
Type: r.LocalType,
|
Type: r.LocalType,
|
||||||
County: r.CountyUnitary,
|
County: coalesce(r.CountyUnitary, r.DistrictBorough),
|
||||||
Xmin: r.MbrXMin,
|
Xmin: r.MbrXMin,
|
||||||
Ymin: r.MbrYMin,
|
Ymin: r.MbrYMin,
|
||||||
Xmax: r.MbrXMax,
|
Xmax: r.MbrXMax,
|
||||||
|
@ -41,3 +41,12 @@ func main() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func coalesce(xs ...string) string {
|
||||||
|
for _, x := range xs {
|
||||||
|
if len(x) > 0 {
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue