2019-12-20 23:05:44 +01:00
|
|
|
package osm
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
2019-12-31 07:16:11 +01:00
|
|
|
func (l Location) Category() (result string) {
|
|
|
|
key := fmt.Sprintf("%s=%s", l.LocCategory, l.LocType)
|
|
|
|
catKey := fmt.Sprintf("%s=*", l.LocCategory)
|
|
|
|
typeKey := fmt.Sprintf("*=%s", l.LocType)
|
2019-12-20 23:05:44 +01:00
|
|
|
|
|
|
|
if result, ok := osmCategories[key]; ok {
|
|
|
|
return result
|
|
|
|
} else if result, ok := osmCategories[catKey]; ok {
|
|
|
|
return result
|
|
|
|
} else if result, ok := osmCategories[typeKey]; ok {
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
// log.Debugf("osm: no label found for %s", key)
|
|
|
|
|
|
|
|
return ""
|
|
|
|
}
|