photoprism/internal/maps/osm/category.go
Michael Mayer 1e7c0c2435 Backend: Improve location hashing and categories
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2019-12-20 23:05:44 +01:00

22 lines
485 B
Go

package osm
import "fmt"
func (o Location) Category() (result string) {
key := fmt.Sprintf("%s=%s", o.LocCategory, o.LocType)
catKey := fmt.Sprintf("%s=*", o.LocCategory)
typeKey := fmt.Sprintf("*=%s", o.LocType)
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 ""
}