initial commit

This commit is contained in:
2023-03-27 20:54:56 +02:00
commit 77c8576254
40 changed files with 7460 additions and 0 deletions

27
tiles/tiles.go Normal file
View 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)
}