Documentation ¶
Index ¶
- Variables
- type AssetName
- func (a AssetName) CityOrWardCode() string
- func (an AssetName) FldAdminAndName() string
- func (an AssetName) FldFullName() string
- func (an AssetName) FldNameAndScale() string
- func (a AssetName) IsWard() bool
- func (an AssetName) LODInt() int
- func (a AssetName) String() string
- func (an AssetName) WardCodeInt() int
- type CMSItem
- func (i CMSItem) AllDataCatalogItems(c PlateauIntermediateItem) []DataCatalogItem
- func (i CMSItem) DataCatalogItems(c PlateauIntermediateItem, ty string) []*DataCatalogItem
- func (i CMSItem) Feature(ty string) []*cms.PublicAsset
- func (i CMSItem) FeatureDescription(ty string) []string
- func (i CMSItem) FeatureTypes() []string
- func (i CMSItem) IntermediateItem() PlateauIntermediateItem
- func (i CMSItem) IsSDKPublic() bool
- type DataCatalogItem
- type DataCatalogItemBuilder
- type DataCatalogItemBuilderOption
- type DatasetItem
- type Description
- type Dic
- type DicEntry
- type ItemContext
- type ItemOverride
- type Override
- type PlateauIntermediateItem
Constants ¶
This section is empty.
Variables ¶
View Source
var FeatureOptions = map[string]DataCatalogItemBuilderOption{ "bldg": { Type: "建築物モデル", TypeEn: "bldg", LOD: true, SortByLOD: true, UseMaxLODAsDefault: true, ItemID: true, GroupBy: func(an AssetName, assets []AssetName) string { return an.WardEn }, SortGroupBy: func(a, b AssetName) bool { return a.WardCodeInt() < b.WardCodeInt() }, OmitGroupNameFromID: true, SearchIndex: true, }, "tran": { Type: "道路モデル", TypeEn: "tran", LOD: true, SortByLOD: true, UseMaxLODAsDefault: true, Group: func(ctx ItemContext) Override { return Override{ Layers: tranLayersForLOD[ctx.AssetName.LOD], } }, Item: func(ctx ItemContext) ItemOverride { return ItemOverride{ Layers: tranLayersForLOD[ctx.AssetName.LOD], } }, }, "frn": { Type: "都市設備モデル", TypeEn: "frn", LOD: true, SortByLOD: true, }, "veg": { Type: "植生モデル", TypeEn: "veg", LOD: true, SortByLOD: true, }, "luse": { Type: "土地利用モデル", TypeEn: "luse", Layers: []string{"luse"}, }, "lsld": { Type: "土砂災害警戒区域モデル", TypeEn: "lsld", Layers: []string{"lsld"}, }, "urf": { Type: "都市計画決定情報モデル", TypeEn: "urf", RootType: true, Group: func(ctx ItemContext) Override { var name, t2 string ft := normalizeUrfFeatureType(ctx.AssetName.UrfFeatureType) if urfName := datacatalogcommon.UrfFeatureTypeMap[ft]; urfName != "" { name = fmt.Sprintf("%sモデル", urfName) t2 = urfName } else { name = ft t2 = ft } return Override{ Name: name, Type2: t2, Type2En: ft, Layers: []string{ctx.GroupName}, } }, MultipleDesc: true, GroupBy: func(an AssetName, assets []AssetName) string { return normalizeUrfFeatureType(an.UrfFeatureType) }, SortGroupBy: func(c, d AssetName) bool { i1 := slices.Index(datacatalogcommon.UrfFeatureTypes, normalizeUrfFeatureType(c.UrfFeatureType)) if i1 < 0 { i1 = len(datacatalogcommon.UrfFeatureTypes) } i2 := slices.Index(datacatalogcommon.UrfFeatureTypes, normalizeUrfFeatureType(d.UrfFeatureType)) if i2 < 0 { i2 = len(datacatalogcommon.UrfFeatureTypes) } return i1 < i2 }, }, "fld": { Type: "洪水浸水想定区域モデル", TypeEn: "fld", RootType: true, Group: func(ctx ItemContext) Override { subname := "" if ctx.DicEntry != nil { subname = fmt.Sprintf("%s(%s管理区間)", ctx.DicEntry.Description, ctx.DicEntry.Admin) } else { subname = ctx.AssetName.FldAdminAndName() } return Override{ SubName: subname, } }, Item: func(ctx ItemContext) ItemOverride { name := ctx.AssetName.FldScale if ctx.DicEntry != nil { name = ctx.DicEntry.Scale } return ItemOverride{ Name: name, } }, MultipleDesc: true, GroupBy: func(an AssetName, assets []AssetName) string { l := "l1" a := lo.Filter(assets, func(a AssetName, _ int) bool { return a.FldName == an.FldName && a.FldAdmin == an.FldAdmin }) sort.SliceStable(a, func(i, j int) bool { return a[i].FldScale < a[j].FldScale }) if len(a) > 0 { l = a[0].FldScale } return fmt.Sprintf("%s_%s", an.FldAdminAndName(), l) }, SortGroupBy: func(a, b AssetName) bool { return a.FldAdminAndName() < b.FldAdminAndName() }, SortAssetBy: func(a, b AssetName) bool { return a.FldScale < b.FldScale }, }, "tnm": { Type: "津波浸水想定区域モデル", TypeEn: "tnm", RootType: true, Group: func(ctx ItemContext) Override { subname := ctx.AssetName.FldName if ctx.DicEntry != nil { subname = ctx.DicEntry.Description } return Override{ SubName: subname, } }, MultipleDesc: true, GroupBy: func(an AssetName, assets []AssetName) string { return an.FldName }, }, "htd": { Type: "高潮浸水想定区域モデル", TypeEn: "htd", RootType: true, Group: func(ctx ItemContext) Override { subname := ctx.AssetName.FldName if ctx.DicEntry != nil { subname = ctx.DicEntry.Description } return Override{ SubName: subname, } }, MultipleDesc: true, GroupBy: func(an AssetName, assets []AssetName) string { return an.FldName }, }, "ifld": { Type: "内水浸水想定区域モデル", TypeEn: "ifld", RootType: true, Group: func(ctx ItemContext) Override { subname := ctx.AssetName.FldName if ctx.DicEntry != nil { subname = ctx.DicEntry.Description } return Override{ SubName: subname, } }, MultipleDesc: true, GroupBy: func(an AssetName, assets []AssetName) string { return an.FldName }, }, "brid": { Type: "橋梁モデル", TypeEn: "brid", Layers: []string{"brid"}, LOD: true, SortByLOD: true, }, "rail": { Type: "鉄道モデル", TypeEn: "rail", Layers: []string{"rail"}, LOD: true, SortByLOD: true, }, "gen": { Type: "汎用都市オブジェクトモデル", TypeEn: "gen", RootType: true, MultipleDesc: true, LOD: true, SortByLOD: true, Group: func(ctx ItemContext) Override { return Override{ Name: ctx.GroupName, Layers: []string{ctx.GroupName}, } }, Item: func(ctx ItemContext) ItemOverride { name := ctx.Description.Override.Name if name == "" { name = ctx.GroupName } return ItemOverride{ Name: name, Layers: []string{ctx.GroupName}, } }, GroupBy: func(n AssetName, assets []AssetName) string { return n.GenName }, }, "extra": { Type: "その他のデータセット", TypeEn: "ex", MultipleDesc: true, LOD: true, SortByLOD: false, GroupBy: func(n AssetName, assets []AssetName) string { return strings.Join(n.FeatureEx, "-") }, }, }
View Source
var FeatureTypes = []string{
"bldg",
"tran",
"frn",
"veg",
"luse",
"lsld",
"urf",
"fld",
"tnm",
"htd",
"ifld",
"brid",
"rail",
"gen",
"extra",
}
Functions ¶
This section is empty.
Types ¶
type AssetName ¶
type AssetName struct { CityCode string CityEn string Year string Format string Op string NoDEM bool Feature string FeatureEx []string Ex string Ext string WardCode string WardEn string LOD string LowTexture bool NoTexture bool FldAdmin string FldName string FldScale string UrfFeatureType string GenName string }
func AssetNameFrom ¶
func (AssetName) CityOrWardCode ¶
func (AssetName) FldAdminAndName ¶
func (AssetName) FldFullName ¶
func (AssetName) FldNameAndScale ¶
func (AssetName) WardCodeInt ¶
type CMSItem ¶
type CMSItem struct { ID string `json:"id"` Prefecture string `json:"prefecture"` CityName string `json:"city_name"` Specification string `json:"specification"` CityGML *cms.PublicAsset `json:"citygml"` DescriptionBldg string `json:"description_bldg"` DescriptionTran string `json:"description_tran"` DescriptionFrn string `json:"description_frn"` DescriptionVeg string `json:"description_veg"` DescriptionLuse string `json:"description_luse"` DescriptionLsld string `json:"description_lsld"` DescriptionUrf []string `json:"description_urf"` DescriptionFld []string `json:"description_fld"` DescriptionHtd []string `json:"description_htd"` DescriptionIfld []string `json:"description_ifld"` DescriptionTnm []string `json:"description_tnm"` DescriptionBrid string `json:"description_brid"` DescriptionRail string `json:"description_rail"` DescriptionGen []string `json:"description_gen"` DescriptionExtra []string `json:"description_extra"` 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"` Htd []*cms.PublicAsset `json:"htd"` Ifld []*cms.PublicAsset `json:"ifld"` Tnm []*cms.PublicAsset `json:"tnm"` Brid []*cms.PublicAsset `json:"brid"` Rail []*cms.PublicAsset `json:"rail"` Gen []*cms.PublicAsset `json:"gen"` Extra []*cms.PublicAsset `json:"extra"` Dictionary *cms.PublicAsset `json:"dictionary"` Dic string `json:"dic"` Dem string `json:"dem"` SearchIndex []*cms.PublicAsset `json:"search_index"` OpenDataURL string `json:"opendata_url"` MaxLOD *cms.PublicAsset `json:"max_lod"` SDKPublication string `json:"sdk_publication"` }
func (CMSItem) AllDataCatalogItems ¶
func (i CMSItem) AllDataCatalogItems(c PlateauIntermediateItem) []DataCatalogItem
func (CMSItem) DataCatalogItems ¶
func (i CMSItem) DataCatalogItems(c PlateauIntermediateItem, ty string) []*DataCatalogItem
func (CMSItem) FeatureDescription ¶
func (CMSItem) FeatureTypes ¶
func (CMSItem) IntermediateItem ¶
func (i CMSItem) IntermediateItem() PlateauIntermediateItem
func (CMSItem) IsSDKPublic ¶
type DataCatalogItem ¶
type DataCatalogItem struct { ID string `json:"id,omitempty"` ItemID string `json:"itemId,omitempty"` Name string `json:"name,omitempty"` Pref string `json:"pref,omitempty"` PrefCode string `json:"pref_code,omitempty"` City string `json:"city,omitempty"` CityEn string `json:"city_en,omitempty"` CityCode string `json:"city_code,omitempty"` Ward string `json:"ward,omitempty"` WardEn string `json:"ward_en,omitempty"` WardCode string `json:"ward_code,omitempty"` Type string `json:"type,omitempty"` Type2 string `json:"type2,omitempty"` TypeEn string `json:"type_en,omitempty"` Type2En string `json:"type2_en,omitempty"` Format string `json:"format,omitempty"` Layers []string `json:"layers,omitempty"` URL string `json:"url,omitempty"` Description string `json:"desc,omitempty"` SearchIndex string `json:"search_index,omitempty"` Year int `json:"year,omitempty"` PRCS cmsintegrationcommon.PRCS `json:"prcs,omitempty"` OpenDataURL string `json:"openDataUrl,omitempty"` Config *datacatalogutil.DataCatalogItemConfig `json:"config,omitempty"` Order *int `json:"order,omitempty"` OriginalURL string `json:"original_url,omitempty"` OriginalFormat string `json:"original_format,omitempty"` // force not creating a type folder Root bool `json:"root,omitempty"` // force creating a type folder on root RootType bool `json:"root_type,omitempty"` Group string `json:"group,omitempty"` Infobox bool `json:"infobox,omitempty"` // alias of type that is used as a folder name Category string `json:"category,omitempty"` // internal Spec string `json:"-"` Family string `json:"-"` Edition string `json:"-"` CityGMLURL string `json:"-"` CityGMLAssetID string `json:"-"` CityGMLFeatureTypes []string `json:"-"` MaxLODURL string `json:"-"` SDKPublic bool `json:"-"` }
type DataCatalogItemBuilder ¶
type DataCatalogItemBuilder struct { Assets []*cms.PublicAsset SearchIndex []*cms.PublicAsset Descriptions []string IntermediateItem PlateauIntermediateItem Options DataCatalogItemBuilderOption }
func (DataCatalogItemBuilder) Build ¶
func (b DataCatalogItemBuilder) Build() []*DataCatalogItem
type DataCatalogItemBuilderOption ¶
type DataCatalogItemBuilderOption struct { Type string TypeEn string RootType bool Layers []string Group func(ItemContext) Override Item func(ItemContext) ItemOverride MultipleDesc bool ItemID bool LOD bool SortByLOD bool UseMaxLODAsDefault bool GroupBy func(AssetName, []AssetName) string SortGroupBy func(AssetName, AssetName) bool SortAssetBy func(AssetName, AssetName) bool OmitGroupNameFromID bool SearchIndex bool }
type DatasetItem ¶
type DatasetItem struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Prefecture string `json:"prefecture,omitempty"` CityName string `json:"city_name,omitempty"` WardName string `json:"ward_name,omitempty"` OpenDataURL string `json:"opendata_url,omitempty"` Description string `json:"description,omitempty"` Year string `json:"year,omitempty"` Data *cms.PublicAsset `json:"data,omitempty"` DataFormat string `json:"data_format,omitempty"` DataURL string `json:"data_url,omitempty"` DataLayers string `json:"data_layer,omitempty"` Config string `json:"config,omitempty"` Order *int `json:"order,omitempty"` OriginalData []*cms.PublicAsset `json:"data_orig,omitempty"` }
func (DatasetItem) DataCatalogs ¶
func (i DatasetItem) DataCatalogs() []DataCatalogItem
func (DatasetItem) GetCityName ¶
func (i DatasetItem) GetCityName() string
type Description ¶
func DescriptionFrom ¶
func DescriptionFrom(d string) Description
type Dic ¶
func (Dic) FindByAsset ¶
type ItemContext ¶
type ItemOverride ¶
func (ItemOverride) LayersIfSupported ¶
func (o ItemOverride) LayersIfSupported(ty string) []string
func (ItemOverride) Merge ¶
func (o ItemOverride) Merge(p ItemOverride) ItemOverride
type Override ¶
type Override struct { Name string `mapstructure:"name"` SubName string `mapstructure:"subname"` Type string `mapstructure:"type"` TypeEn string `mapstructure:"type_en"` Type2 string `mapstructure:"type2"` Type2En string `mapstructure:"type2_en"` Area string `mapstructure:"area"` ItemName string `mapstructure:"item_name"` Group string `mapstructure:"group"` Layer string `mapstructure:"layer"` Layers []string `mapstructure:"-"` Root bool `mapstructure:"root"` Order *int `mapstructure:"order"` DatasetOrder *int `mapstructure:"dataset_order"` }
func OverrideFromTags ¶
func (Override) Item ¶
func (o Override) Item() ItemOverride
func (Override) LayersIfSupported ¶
Click to show internal directories.
Click to hide internal directories.