datacatalogv3

package
v0.0.0-...-b34f296 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UrfFeatureTypeMap map[string]UrfType

UrfFeatureTypeMap is a map of URF feature type code to name.

View Source
var UrfFeatureTypes []string

UrfFeatureTypes is a list of URF feature type codes.

Functions

func AdminContext

func AdminContext(ctx context.Context, bypassAdminRemoval, includeBeta, includeAlpha bool) context.Context

Types

type Admin

type Admin struct {
	ItemID    string
	CMSURL    string
	Stage     stage
	CreatedAt time.Time
	UpdatedAt time.Time
	// common
	SubAreaCode    string
	CityGMLAssetID string
	CityGMLURLs    []string
	MaxLODURLs     []string
}

type AllData

type AllData struct {
	Name                  string
	Year                  int
	PlateauSpecs          []plateauapi.PlateauSpecSimple
	FeatureTypes          FeatureTypes
	City                  []*CityItem
	Related               []*RelatedItem
	Generic               []*GenericItem
	Sample                []*PlateauFeatureItem
	Plateau               map[string][]*PlateauFeatureItem
	GeospatialjpDataItems []*GeospatialjpDataItem
	CMSInfo               CMSInfo
}

func (*AllData) FeatureTypesOf

func (all *AllData) FeatureTypesOf(cityID string) (res []string)

func (*AllData) FindGspatialjpDataItemByCityID

func (d *AllData) FindGspatialjpDataItemByCityID(cityID string) *GeospatialjpDataItem

func (*AllData) FindPlateauFeatureItemByCityID

func (d *AllData) FindPlateauFeatureItemByCityID(ft, cityID string) *PlateauFeatureItem

func (*AllData) FindPlateauFeatureItemsByCityID

func (d *AllData) FindPlateauFeatureItemsByCityID(cityID string) (res []*PlateauFeatureItem)

func (*AllData) Into

func (all *AllData) Into() (res *plateauapi.InMemoryRepoContext, warning []string)

type AssetName

type AssetName struct {
	CityCode    string
	CityName    string
	Provider    string
	Year        int
	Format      string
	UpdateCount int
	Ex          AssetNameEx
}

func ParseAssetName

func ParseAssetName(name string) *AssetName

func ParseAssetUrls

func ParseAssetUrls(urls []string) []*AssetName

func (AssetName) String

func (n AssetName) String() string

type AssetNameEx

type AssetNameEx struct {
	Normal *AssetNameExNormal
	Fld    *AssetNameExFld
	Ex     string
}

func ParseAssetNameEx

func ParseAssetNameEx(name string) (ex AssetNameEx)

func (AssetNameEx) DatasetItemKey

func (ex AssetNameEx) DatasetItemKey() string

func (AssetNameEx) DatasetKey

func (ex AssetNameEx) DatasetKey() string

func (AssetNameEx) DicKey

func (ex AssetNameEx) DicKey() string

func (AssetNameEx) IsValid

func (ex AssetNameEx) IsValid() bool

func (AssetNameEx) String

func (ex AssetNameEx) String() string

type AssetNameExFld

type AssetNameExFld struct {
	Type      string
	Admin     string
	River     string
	Format    string
	L         int
	Suffix    string
	NoTexture bool
}

func ParseAssetNameExFld

func ParseAssetNameExFld(name string) *AssetNameExFld

func (AssetNameExFld) DatasetItemKey

func (ex AssetNameExFld) DatasetItemKey() string

func (AssetNameExFld) DatasetKey

func (ex AssetNameExFld) DatasetKey() string

func (AssetNameExFld) DicKey

func (ex AssetNameExFld) DicKey() string

type AssetNameExNormal

type AssetNameExNormal struct {
	Type      string
	Name      string
	Format    string
	WardCode  string
	WardName  string
	LOD       int
	LODEx     int
	NoTexture bool
	NoLOD     bool
	Interior  bool
}

func ParseAssetNameExNormal

func ParseAssetNameExNormal(name string) *AssetNameExNormal

func (AssetNameExNormal) DatasetItemKey

func (ex AssetNameExNormal) DatasetItemKey() string

func (AssetNameExNormal) DatasetKey

func (ex AssetNameExNormal) DatasetKey() string

func (AssetNameExNormal) DicKey

func (ex AssetNameExNormal) DicKey() string

type CMS

type CMS struct {
	// contains filtered or unexported fields
}

func NewCMS

func NewCMS(opts CMSOpts) *CMS

func (*CMS) GetAll

func (c *CMS) GetAll(ctx context.Context) (*AllData, error)

func (*CMS) GetCMSInfo

func (c *CMS) GetCMSInfo(ctx context.Context) (*CMSInfo, error)

func (*CMS) GetCityItems

func (c *CMS) GetCityItems(ctx context.Context, project string, featureTypes []FeatureType) ([]*CityItem, error)

func (*CMS) GetFeatureTypes

func (c *CMS) GetFeatureTypes(ctx context.Context) (FeatureTypes, error)

func (*CMS) GetGenericItems

func (c *CMS) GetGenericItems(ctx context.Context, project string) ([]*GenericItem, error)

func (*CMS) GetGeospatialjpDataItems

func (c *CMS) GetGeospatialjpDataItems(ctx context.Context, project string) ([]*GeospatialjpDataItem, error)

func (*CMS) GetModelIDs

func (c *CMS) GetModelIDs(ctx context.Context) (ModelIDMap, error)

func (*CMS) GetPlateauItems

func (c *CMS) GetPlateauItems(ctx context.Context, project, feature string) ([]*PlateauFeatureItem, error)

func (*CMS) GetPlateauSpecs

func (c *CMS) GetPlateauSpecs(ctx context.Context) ([]plateauapi.PlateauSpecSimple, error)

func (*CMS) GetRelatedItems

func (c *CMS) GetRelatedItems(ctx context.Context, project string, featureTypes []FeatureType) ([]*RelatedItem, error)

func (*CMS) GetSampleItems

func (c *CMS) GetSampleItems(ctx context.Context, project string) ([]*PlateauFeatureItem, error)

type CMSInfo

type CMSInfo struct {
	CMSURL      string
	WorkspaceID string
	ProjectID   string
	ModelIDMap  ModelIDMap
}

func (CMSInfo) ItemBaseURL

func (c CMSInfo) ItemBaseURL(modelKey string) string

type CMSOpts

type CMSOpts struct {
	CMS     cms.Interface
	PCMS    *plateaucms.CMS
	Year    int
	Plateau bool
	Project string
	Cache   bool
}

type CityItem

type CityItem struct {
	ID             string                    `json:"id,omitempty" cms:"id"`
	Prefecture     string                    `json:"prefecture,omitempty" cms:"prefecture,select"`
	CityName       string                    `json:"city_name,omitempty" cms:"city_name,text"`
	CityNameEn     string                    `json:"city_name_en,omitempty" cms:"city_name_en,text"`
	CityCode       string                    `json:"city_code,omitempty" cms:"city_code,text"`
	Spec           string                    `json:"spec,omitempty" cms:"spec,select"`
	References     map[string]string         `json:"references,omitempty" cms:"-"`
	RelatedDataset string                    `json:"related_dataset,omitempty" cms:"related_dataset,reference"`
	Year           string                    `json:"year,omitempty" cms:"year,select"`
	PRCS           cmsintegrationcommon.PRCS `json:"prcs,omitempty" cms:"prcs,select"`
	OpenDataURL    string                    `json:"open_data_url,omitempty" cms:"open_data_url,text"`
	SubCityCode    string                    `json:"city_code_sub,omitempty" cms:"city_code_sub,text"`
	CodeLists      *cms.PublicAsset          `json:"codelists,omitempty" cms:"codelists,asset"`
	Schemas        *cms.PublicAsset          `json:"schemas,omitempty" cms:"schemas,asset"`
	Metadata       *cms.PublicAsset          `json:"metadata,omitempty" cms:"metadata,asset"`
	Specification  *cms.PublicAsset          `json:"specification,omitempty" cms:"specification,asset"`
	Misc           *cms.PublicAsset          `json:"misc,omitempty" cms:"misc,asset"`
	// meatadata
	PlateauDataStatus   *cms.Tag        `json:"plateau_data_status,omitempty" cms:"plateau_data_status,select,metadata"`
	RelatedDataStatus   *cms.Tag        `json:"related_data_status,omitempty" cms:"related_data_status,select,metadata"`
	CityPublic          bool            `json:"city_public,omitempty" cms:"city_public,bool,metadata"`
	SDKPublic           bool            `json:"sdk_public,omitempty" cms:"sdk_public,bool,metadata"`
	RelatedPublic       bool            `json:"related_public,omitempty" cms:"related_public,bool,metadata"`
	Public              map[string]bool `json:"public,omitempty" cms:"-"`
	GeospatialjpPublish bool            `json:"geospatialjp_publish,omitempty" cms:"geospatialjp_publish,bool,metadata"`
	Sample              bool            `json:"sample,omitempty" cms:"sample,bool,metadata"`
}

func CityItemFrom

func CityItemFrom(item *cms.Item, featureTypes []FeatureType) (i *CityItem)

func (*CityItem) GetOpenDataURL

func (c *CityItem) GetOpenDataURL() string

func (*CityItem) IsPublicOrBeta

func (i *CityItem) IsPublicOrBeta() bool

func (*CityItem) MetadataZipURLs

func (i *CityItem) MetadataZipURLs() []string

func (*CityItem) PlanarCrsEpsgCode

func (c *CityItem) PlanarCrsEpsgCode() string

func (*CityItem) PlateauStage

func (i *CityItem) PlateauStage(ft string) stage

func (*CityItem) SDKStage

func (i *CityItem) SDKStage() stage

func (*CityItem) ToCity

func (city *CityItem) ToCity() *plateauapi.City

func (*CityItem) ToPrefecture

func (city *CityItem) ToPrefecture() *plateauapi.Prefecture

func (*CityItem) YearInt

func (i *CityItem) YearInt() int

type Dic

type Dic map[string][]DicEntry // admin, fld. htd, tnm, urf, gen

func (Dic) FindEntry

func (d Dic) FindEntry(key, name string) *DicEntry

func (Dic) FindEntryOrDefault

func (d Dic) FindEntryOrDefault(key, name string) (*DicEntry, bool)

type DicEntry

type DicEntry struct {
	Name              *StringOrNumber `json:"name,omitempty"`
	Description       string          `json:"description,omitempty"`
	Code              *StringOrNumber `json:"code,omitempty"`               // bldg only
	Admin             string          `json:"admin,omitempty"`              // fld only
	Scale             string          `json:"scale,omitempty"`              // fld only
	Suffix            string          `json:"suffix,omitempty"`             // fld only (optional)
	SuffixDescription string          `json:"suffix_description,omitempty"` // fld only (optional)
	Order             *int            `json:"order"`
}

type FeatureType

type FeatureType struct {
	Code      string `json:"code,omitempty" cms:"code,text"`
	Name      string `json:"name,omitempty" cms:"name,text"`
	Order     int    `json:"order,omitempty" cms:"order,integer"`
	GroupName string `json:"group_name,omitempty" cms:"group_name,text"`
	// for plateau
	MinSpecMajor          int              `json:"spec_major,omitempty" cms:"spec_major,integer"`
	MinYear               int              `json:"min_year,omitempty" cms:"min_year,integer"`
	Flood                 bool             `json:"flood,omitempty" cms:"flood,bool"`
	MVTLayerName          []string         `json:"layer_name,omitempty" cms:"layer_name,text"`
	MVTLayerNamesForLOD   map[int][]string `json:"layer_names_for_lod,omitempty" cms:"-"`
	MVTLayerNamePrefix    string           `json:"layer_name_prefix,omitempty" cms:"layer_name_prefix,text"`
	UseCategoryAsMVTLayer bool             `json:"use_category_as_mvt_layer" cms:"use_category_as_mvt_layer,bool"`
	HideTexture           bool             `json:"hide_texture,omitempty" cms:"hide_texture,bool"`
	HideLOD               bool             `json:"hide_lod,omitempty" cms:"hide_lod,bool"`
}

func (*FeatureType) ToGenericDatasetType

func (f *FeatureType) ToGenericDatasetType() *plateauapi.GenericDatasetType

func (*FeatureType) ToPlateauDatasetType

func (f *FeatureType) ToPlateauDatasetType(spec plateauapi.PlateauSpec) *plateauapi.PlateauDatasetType

func (*FeatureType) ToRelatedDatasetType

func (f *FeatureType) ToRelatedDatasetType() *plateauapi.RelatedDatasetType

type FeatureTypes

type FeatureTypes struct {
	Plateau []FeatureType
	Related []FeatureType
	Generic []FeatureType
}

func (FeatureTypes) FindPlateauByCode

func (ft FeatureTypes) FindPlateauByCode(code string) *FeatureType

func (FeatureTypes) LayerNames

func (ft FeatureTypes) LayerNames() map[string]LayerNames

func (FeatureTypes) PlateauMap

func (ft FeatureTypes) PlateauMap() map[string]*FeatureType

func (FeatureTypes) ToDatasetTypes

func (ft FeatureTypes) ToDatasetTypes(specs []plateauapi.PlateauSpec) plateauapi.DatasetTypes

type GenericItem

type GenericItem struct {
	ID          string               `json:"id,omitempty" cms:"id"`
	City        string               `json:"city,omitempty" cms:"city,reference"`
	Name        string               `json:"name,omitempty" cms:"name,text"`
	Desc        string               `json:"desc,omitempty" cms:"desc,textarea"`
	Type        string               `json:"type,omitempty" cms:"type,text"`
	TypeEn      string               `json:"type_en,omitempty" cms:"type_en,text"`
	Items       []GenericItemDataset `json:"items,omitempty" cms:"items,group"`
	OpenDataURL string               `json:"open_data_url,omitempty" cms:"open_data_url,url"`
	Category    string               `json:"category,omitempty" cms:"category,select"`
	Group       string               `json:"group,omitempty" cms:"group,text"`
	// metadata
	Status *cms.Tag `json:"status,omitempty" cms:"status,select,metadata"`
	Public bool     `json:"public,omitempty" cms:"public,bool,metadata"`
	AR     bool     `json:"ar,omitempty" cms:"ar,bool,metadata"`
	// common
	CreatedAt time.Time `json:"created_at,omitempty" cms:"-"`
	UpdatedAt time.Time `json:"updated_at,omitempty" cms:"-"`
}

func GenericItemFrom

func GenericItemFrom(item *cms.Item) (i *GenericItem)

func (*GenericItem) Stage

func (c *GenericItem) Stage() stage

type GenericItemDataset

type GenericItemDataset struct {
	ID         string `json:"id,omitempty" cms:"id"`
	Name       string `json:"name,omitempty" cms:"item_name,text"`
	Data       string `json:"data,omitempty" cms:"data,-"`
	Desc       string `json:"desc,omitempty" cms:"desc,textarea"`
	DataURL    string `json:"url,omitempty" cms:"url,url"`
	DataFormat string `json:"format,omitempty" cms:"format,select"`
	LayerName  string `json:"layer,omitempty" cms:"layer,text"`
}

type GeospatialjpDataItem

type GeospatialjpDataItem struct {
	ID       string `json:"id,omitempty" cms:"id"`
	City     string `json:"city,omitempty" cms:"city,reference"`
	CityGML  string `json:"citygml,omitempty" cms:"citygml,asset"`
	MaxLOD   string `json:"maxlod,omitempty" cms:"maxlod,asset"`
	HasIndex bool   `json:"has_index,omitempty" cms:"-"`
}

func GeospatialjpDataItemFrom

func GeospatialjpDataItemFrom(item *cms.Item) *GeospatialjpDataItem

type LayerNames

type LayerNames struct {
	Name        []string
	NamesForLOD map[int][]string
	Prefix      string
	PreferDef   bool
}

func (LayerNames) LayerName

func (l LayerNames) LayerName(def []string, lod int, format plateauapi.DatasetFormat) []string

type ManagementStatus

type ManagementStatus string
const (
	ManagementStatusReady ManagementStatus = "確認可能"
)

type ModelIDMap

type ModelIDMap map[string]string

func (ModelIDMap) ItemBaseURL

func (m ModelIDMap) ItemBaseURL(cmsURL, workspaceID, projectID, modelKey string) string

type OriginalAndConv

type OriginalAndConv struct {
	Original  string
	Converted string
}

func OriginalAndConvsFrom

func OriginalAndConvsFrom(original, converted []string) []OriginalAndConv

type PlateauFeatureItem

type PlateauFeatureItem struct {
	ID          string                    `json:"id,omitempty" cms:"id"`
	City        string                    `json:"city,omitempty" cms:"city,reference"`
	CityGML     string                    `json:"citygml,omitempty" cms:"citygml,-"`
	Data        []string                  `json:"data,omitempty" cms:"data,-"`
	Desc        string                    `json:"desc,omitempty" cms:"desc,textarea"`
	Items       []PlateauFeatureItemDatum `json:"items,omitempty" cms:"items,group"`
	Dic         string                    `json:"dic,omitempty" cms:"dic,textarea"`
	Group       string                    `json:"group,omitempty" cms:"group,text"`
	MaxLOD      string                    `json:"maxlod,omitempty" cms:"maxlod,-"`
	FeatureType string                    `json:"feature_type,omitempty" cms:"feature_type,select"`
	// metadata
	Sample bool     `json:"sample,omitempty" cms:"sample,bool,metadata"`
	Status *cms.Tag `json:"status,omitempty" cms:"status,select,metadata"`
	// common
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

func PlateauFeatureItemFrom

func PlateauFeatureItemFrom(item *cms.Item, code string) (i *PlateauFeatureItem)

func (*PlateauFeatureItem) IsBeta

func (c *PlateauFeatureItem) IsBeta() bool

func (PlateauFeatureItem) ReadDic

func (c PlateauFeatureItem) ReadDic() (d Dic, _ error)

type PlateauFeatureItemDatum

type PlateauFeatureItemDatum struct {
	ID    string   `json:"id,omitempty" cms:"id"`
	Data  []string `json:"data,omitempty" cms:"data,-"`
	Name  string   `json:"name,omitempty" cms:"name,text"`
	Desc  string   `json:"desc,omitempty" cms:"desc,textarea"`
	Key   string   `json:"key,omitempty" cms:"key,text"`
	Group string   `json:"group,omitempty" cms:"group,text"`
	// Simple indicates that this item should not use subcode and subname
	Simple bool `json:"simple,omitempty" cms:"-"`
}

type RelatedAssetName

type RelatedAssetName struct {
	Code     string
	Name     string
	Year     int
	Provider string
	WardCode string
	WardName string
	Type     string
	Format   string
}

func ParseRelatedAssetName

func ParseRelatedAssetName(name string) *RelatedAssetName

type RelatedItem

type RelatedItem struct {
	ID    string                      `json:"id,omitempty" cms:"id"`
	City  string                      `json:"city,omitempty" cms:"city,reference"`
	Items map[string]RelatedItemDatum `json:"items,omitempty" cms:"-"`
	// meadata
	Merged string   `json:"merged,omitempty" cms:"merged,asset"`
	Status *cms.Tag `json:"status,omitempty" cms:"status,select,metadata"`
	// common
	CreatedAt time.Time `json:"created_at,omitempty" cms:"-"`
	UpdatedAt time.Time `json:"updated_at,omitempty" cms:"-"`
}

func RelatedItemFrom

func RelatedItemFrom(item *cms.Item, featureTypes []FeatureType) (i *RelatedItem)

type RelatedItemDatum

type RelatedItemDatum struct {
	ID          string   `json:"id,omitempty" cms:"id"`
	Asset       []string `json:"asset,omitempty" cms:"asset,asset"`
	Converted   []string `json:"converted,omitempty" cms:"converted,asset"`
	Description string   `json:"description,omitempty" cms:"description,textarea"`
}

type Repos

type Repos struct {
	*plateauapi.Repos
	// contains filtered or unexported fields
}

func NewRepos

func NewRepos(pcms *plateaucms.CMS) *Repos

func (*Repos) EnableCache

func (r *Repos) EnableCache(cache bool)

func (*Repos) EnableDebug

func (r *Repos) EnableDebug(debug bool)

func (*Repos) Prepare

func (r *Repos) Prepare(ctx context.Context, project string, year int, plateau bool, cms cms.Interface) error

type StringOrNumber

type StringOrNumber struct {
	Value string
}

func (*StringOrNumber) String

func (s *StringOrNumber) String() string

func (*StringOrNumber) UnmarshalJSON

func (s *StringOrNumber) UnmarshalJSON(b []byte) error

type ToPlateauDatasetsOptions

type ToPlateauDatasetsOptions struct {
	ID          string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Area        *areaContext
	Spec        *plateauapi.PlateauSpecMinor
	DatasetType *plateauapi.PlateauDatasetType
	LayerNames  LayerNames
	FeatureType *FeatureType
	Year        int
	CMSInfo     CMSInfo
}

type UrfType

type UrfType struct {
	Code       string
	Name       string
	ParentCode string
	Depth      int
}

Jump to

Keyboard shortcuts

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