initial commit
This commit is contained in:
27
tiles/tiles.go
Normal file
27
tiles/tiles.go
Normal file
@@ -0,0 +1,27 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user