carpool-service/tiles/tiles.go

28 lines
612 B
Go

package tiles
import (
"fmt"
"github.com/paulmach/orb"
"github.com/paulmach/orb/geojson"
)
type IndexedTilesets struct {
Tileset map[string]*Tile // Key is "date:geo" (example : "2023-01-01:fr-south-west")
ByDate map[string]Tileset // Key is the date in the form "YYYY-MM-DD"
ByGeo map[string]Tileset // Key is the Geo tiles id (could be any string as defined in the configuration)
}
type Tileset []*Tile
type Tile struct {
Date string
GeoId string
Bounds orb.Bound
Journeys []*geojson.FeatureCollection
}
func (t Tile) Id() string {
return fmt.Sprintf("%s:%s", t.Date, t.GeoId)
}