Use just the English name for Welsh counties
This commit is contained in:
parent
e407cf308e
commit
f38029736c
2 changed files with 10 additions and 2 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/gob"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/ray1729/gpx-utils/pkg/openname"
|
||||
"github.com/ray1729/gpx-utils/pkg/placenames"
|
||||
|
@ -31,6 +32,13 @@ func main() {
|
|||
Ymin: r.MbrYMin,
|
||||
Xmax: r.MbrXMax,
|
||||
Ymax: r.MbrYMax}
|
||||
// Welsh counties have both the Welsh and English name separated by a dash. Return
|
||||
// just the English name.
|
||||
i := strings.Index(b.County, " - ")
|
||||
if i > 0 {
|
||||
b.County = b.County[i+3:]
|
||||
}
|
||||
//fmt.Println(strings.Join([]string{b.Name, b.Type, b.County}, ","))
|
||||
return enc.Encode(b)
|
||||
},
|
||||
openname.FilterType("populatedPlace"),
|
||||
|
|
BIN
pkg/placenames/placenames.bin
(Stored with Git LFS)
BIN
pkg/placenames/placenames.bin
(Stored with Git LFS)
Binary file not shown.
Loading…
Reference in a new issue