sdkapiv2

package
v0.0.0-...-e9a8072 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(conf Config, g *echo.Group) (bool, error)

Types

type CMS

type CMS struct {
	Project              string
	PublicAPI            bool
	IntegrationAPIClient cms.Interface
	PublicAPIClient      *cms.PublicAPIClient[Item]
}

func NewCMS

func NewCMS(c cms.Interface, pac *cms.PublicAPIClient[Item], project string, usePublic bool) *CMS

func (*CMS) Datasets

func (c *CMS) Datasets(ctx context.Context, model string) (*DatasetResponse, error)

func (*CMS) DatasetsWithIntegrationAPI

func (c *CMS) DatasetsWithIntegrationAPI(ctx context.Context, model string) (*DatasetResponse, error)

func (*CMS) DatasetsWithPublicAPI

func (c *CMS) DatasetsWithPublicAPI(ctx context.Context, model string) (*DatasetResponse, error)

func (*CMS) Files

func (c *CMS) Files(ctx context.Context, model, id string) (FilesResponse, error)

func (*CMS) FilesWithIntegrationAPI

func (c *CMS) FilesWithIntegrationAPI(ctx context.Context, model, id string) (FilesResponse, error)

func (*CMS) FilesWithPublicAPI

func (c *CMS) FilesWithPublicAPI(ctx context.Context, model, id string) (FilesResponse, error)

type Config

type Config struct {
	CMSBaseURL   string
	CMSToken     string
	Project      string
	Model        string
	Token        string
	DisableCache bool
	CacheTTL     int
}

func (*Config) Default

func (c *Config) Default()

type DatasetCity

type DatasetCity struct {
	ID           string   `json:"id"`
	Spec         string   `json:"spec"`
	CityCode     int      `json:"-"`
	Title        string   `json:"title"`
	Description  string   `json:"description"`
	FeatureTypes []string `json:"featureTypes"`
	Year         int      `json:"-"`
}

type DatasetPref

type DatasetPref struct {
	ID    string        `json:"id"`
	Title string        `json:"title"`
	Data  []DatasetCity `json:"data"`
}

type DatasetResponse

type DatasetResponse struct {
	Data []*DatasetPref `json:"data"`
}

type File

type File struct {
	Code   string  `json:"code"`
	URL    string  `json:"url"`
	MaxLOD float64 `json:"maxLod"`
}

type FilesResponse

type FilesResponse map[string][]File

func MaxLODFiles

func MaxLODFiles(maxLOD MaxLODColumns, assetPaths []string, assetBase *url.URL) (FilesResponse, []string)

type IItem

type IItem struct {
	ID             string `json:"id" cms:"id,text"`
	Specification  string `json:"specification" cms:"specification,select"`
	Prefecture     string `json:"prefecture" cms:"prefecture,text"`
	CityName       string `json:"city_name" cms:"city_name,text"`
	CityGML        any    `json:"citygml" cms:"citygml,asset"`
	Description    string `json:"description_bldg" cms:"description_bldg,textarea"`
	MaxLOD         any    `json:"max_lod" cms:"max_lod,asset"`
	Bldg           []any  `json:"bldg" cms:"bldg,asset"`
	Tran           []any  `json:"tran" cms:"tran,asset"`
	Frn            []any  `json:"frn" cms:"frn,asset"`
	Veg            []any  `json:"veg" cms:"veg,asset"`
	Fld            []any  `json:"fld" cms:"fld,asset"`
	Tnm            []any  `json:"tnm" cms:"tnm,asset"`
	Htd            []any  `json:"htd" cms:"htd,asset"`
	Ifld           []any  `json:"ifld" cms:"ifld,asset"`
	Luse           []any  `json:"luse" cms:"luse,asset"`
	Lsld           []any  `json:"lsld" cms:"lsld,asset"`
	Urf            []any  `json:"urf" cms:"veg,asset"`
	Dem            string `json:"dem" cms:"dem,select"`
	SDKPublication string `json:"sdk_publication" cms:"sdk_publication,select"`
}

func (IItem) Item

func (i IItem) Item() Item

type Item

type Item struct {
	ID             string            `json:"id"`
	Specification  string            `json:"specification"`
	Prefecture     string            `json:"prefecture"`
	CityName       string            `json:"city_name"`
	CityGML        *cms.PublicAsset  `json:"citygml"`
	Description    string            `json:"description_bldg"`
	MaxLOD         *cms.PublicAsset  `json:"max_lod"`
	Bldg           []cms.PublicAsset `json:"bldg"`
	Tran           []cms.PublicAsset `json:"tran"`
	Frn            []cms.PublicAsset `json:"frn"`
	Veg            []cms.PublicAsset `json:"veg"`
	Luse           []cms.PublicAsset `json:"luse"`
	Lsld           []cms.PublicAsset `json:"lsld"`
	Urf            []cms.PublicAsset `json:"urf"`
	Fld            []cms.PublicAsset `json:"fld"`
	Tnm            []cms.PublicAsset `json:"tnm"`
	Htd            []cms.PublicAsset `json:"htd"`
	Ifld           []cms.PublicAsset `json:"ifld"`
	Dem            string            `json:"dem"`
	SDKPublication string            `json:"sdk_publication"`
}

func ItemFromIntegration

func ItemFromIntegration(ci *cms.Item) Item

func (Item) CityCode

func (i Item) CityCode() int

func (Item) FeatureTypes

func (i Item) FeatureTypes() (t []string)

func (Item) IsPublic

func (i Item) IsPublic() bool

func (Item) SpecVersion

func (i Item) SpecVersion() string

func (Item) Year

func (i Item) Year() int

type Items

type Items []Item

func ItemsFromIntegration

func ItemsFromIntegration(items []cms.Item) Items

func (Items) DatasetResponse

func (i Items) DatasetResponse() (r *DatasetResponse)

type MaxLODColumn

type MaxLODColumn struct {
	Code   string  `json:"code"`
	Type   string  `json:"type"`
	MaxLOD float64 `json:"maxLod"`
	File   string  `json:"file"`
}

type MaxLODColumns

type MaxLODColumns []MaxLODColumn

func ReadMaxLODCSV

func ReadMaxLODCSV(b io.Reader) (MaxLODColumns, error)

func (MaxLODColumns) Map

func (mc MaxLODColumns) Map() MaxLODMap

type MaxLODMap

type MaxLODMap map[string]map[string]MaxLODMapItem

func (MaxLODMap) Files

func (mm MaxLODMap) Files(urls []*url.URL) (r FilesResponse, warning []string)

type MaxLODMapItem

type MaxLODMapItem struct {
	MaxLOD float64
	Files  []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL