preparegspatialjp

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: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(conf *Config) (err error)

func GenerateIndex

func GenerateIndex(ctx context.Context, seed *IndexSeed) (string, error)

func GetUpdateCount

func GetUpdateCount(u string) int

func PrepareCityGML

func PrepareCityGML(ctx context.Context, c *CMSWrapper, m MergeContext) (res string, err error)

func PrepareIndex

func PrepareIndex(ctx context.Context, cw *CMSWrapper, seed *IndexSeed) (err error)

func PrepareMaxLOD

func PrepareMaxLOD(ctx context.Context, cw *CMSWrapper, mc MergeContext) (err error)

func PreparePlateau

func PreparePlateau(ctx context.Context, c *CMSWrapper, m MergeContext) (res string, err error)

func PrepareRelated

func PrepareRelated(ctx context.Context, cw *CMSWrapper, mc MergeContext) (res string, err error)

func SpecVersion

func SpecVersion(version string) string

func YearInt

func YearInt(y string) (year int)

Types

type CMSWrapper

type CMSWrapper struct {
	CMS         cms.Interface
	ProjectID   string
	DataItemID  string
	CityItemID  string
	SkipCityGML bool
	SkipPlateau bool
	SkipMaxLOD  bool
	SkipIndex   bool
	SkipRelated bool
	WetRun      bool
}

func (*CMSWrapper) Comment

func (c *CMSWrapper) Comment(ctx context.Context, comment string)

func (*CMSWrapper) GetItem

func (c *CMSWrapper) GetItem(ctx context.Context, id string, asset bool) (*cms.Item, error)

func (*CMSWrapper) NotifyError

func (c *CMSWrapper) NotifyError(ctx context.Context, err error, citygml, plateau, maxlod bool)

func (*CMSWrapper) NotifyErrorMessage

func (c *CMSWrapper) NotifyErrorMessage(ctx context.Context, msg string, citygml, plateau, maxlod bool)

func (*CMSWrapper) NotifyRunning

func (c *CMSWrapper) NotifyRunning(ctx context.Context)

func (*CMSWrapper) UpdateDataItem

func (c *CMSWrapper) UpdateDataItem(ctx context.Context, item *GspatialjpDataItem) error

func (*CMSWrapper) Upload

func (c *CMSWrapper) Upload(ctx context.Context, name string, body io.Reader) (string, error)

func (*CMSWrapper) UploadFile

func (c *CMSWrapper) UploadFile(ctx context.Context, path string) (string, error)

type CityGMLZipWriter

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

func NewCityGMLZipWriter

func NewCityGMLZipWriter(w *zip.Writer, name string) *CityGMLZipWriter

func (*CityGMLZipWriter) Close

func (z *CityGMLZipWriter) Close() error

func (*CityGMLZipWriter) DownloadAndWrite

func (z *CityGMLZipWriter) DownloadAndWrite(ctx context.Context, url, tempdir, ty, prefix, dir string) error

func (*CityGMLZipWriter) Write

func (z *CityGMLZipWriter) Write(ctx context.Context, src *zip.Reader, ty, prefix, dir string) error

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"`
	CodeLists         string            `json:"codelists,omitempty" cms:"codelists,asset"`
	Schemas           string            `json:"schemas,omitempty" cms:"schemas,asset"`
	Metadata          string            `json:"metadata,omitempty" cms:"metadata,asset"`
	Specification     string            `json:"specification,omitempty" cms:"specification,asset"`
	Spec              string            `json:"spec,omitempty" cms:"spec,select"`
	Misc              string            `json:"misc,omitempty" cms:"misc,asset"`
	Year              string            `json:"year,omitempty" cms:"year,select"`
	RelatedDataset    string            `json:"related,omitempty" cms:"related,reference"`
	References        map[string]string `json:"references,omitempty" cms:"-"`
	GeospatialjpIndex string            `json:"geospatialjp-index,omitempty" cms:"geospatialjp-index,reference"`
	GeospatialjpData  string            `json:"geospatialjp-data,omitempty" cms:"geospatialjp-data,reference"`
}

func CityItemFrom

func CityItemFrom(item *cms.Item) (i *CityItem)

func (*CityItem) SpecVersionMajorInt

func (c *CityItem) SpecVersionMajorInt() int

func (*CityItem) YearInt

func (c *CityItem) YearInt() int

type Config

type Config struct {
	CMSURL      string
	CMSToken    string
	ProjectID   string
	CityItemID  string
	SkipCityGML bool
	SkipPlateau bool
	SkipMaxLOD  bool
	SkipIndex   bool
	SkipRelated bool
	WetRun      bool
}

type FeatureItem

type FeatureItem struct {
	ID      string   `json:"id,omitempty"`
	CityGML string   `json:"citygml,omitempty"`
	Data    []string `json:"data,omitempty"`
	MaxLOD  string   `json:"maxlod,omitempty"`
	Dic     string   `json:"dic,omitempty"`
}

func FeatureItemFrom

func FeatureItemFrom(item *cms.Item) (res FeatureItem, ok bool)

type GspatialjpDataItem

type GspatialjpDataItem struct {
	ID                 string   `json:"id,omitempty" cms:"id"`
	CityGML            string   `json:"citygml,omitempty" cms:"citygml,asset"`
	Plateau            string   `json:"plateau,omitempty" cms:"plateau,asset"`
	Related            string   `json:"related,omitempty" cms:"related,asset"`
	Generic            []string `json:"generic,omitempty" cms:"generic,asset"`
	MaxLOD             string   `json:"maxlod,omitempty" cms:"maxlod,asset"`
	Index              string   `json:"desc_index,omitempty" cms:"desc_index,markdown"`
	MergeCityGMLStatus *cms.Tag `json:"merge_citygml_status" cms:"merge_citygml_status,tag,metadata"`
	MergePlateauStatus *cms.Tag `json:"merge_plateau_status" cms:"merge_plateau_status,tag,metadata"`
	MergeRelatedStatus *cms.Tag `json:"merge_related_status" cms:"merge_related_status,tag,metadata"`
	MergeMaxLODStatus  *cms.Tag `json:"merge_maxlod_status" cms:"merge_maxlod_status,tag,metadata"`
}

func GspatialjpDataItemFrom

func GspatialjpDataItemFrom(item *cms.Item) (i *GspatialjpDataItem)

func (*GspatialjpDataItem) ShouldMergeCityGML

func (g *GspatialjpDataItem) ShouldMergeCityGML() bool

func (*GspatialjpDataItem) ShouldMergeMaxLOD

func (g *GspatialjpDataItem) ShouldMergeMaxLOD() bool

func (*GspatialjpDataItem) ShouldMergePlateau

func (g *GspatialjpDataItem) ShouldMergePlateau() bool

func (*GspatialjpDataItem) ShouldMergeRelated

func (g *GspatialjpDataItem) ShouldMergeRelated() bool

type GspatialjpIndexItem

type GspatialjpIndexItem struct {
	ID      string                     `json:"id,omitempty" cms:"id"`
	Generic []GspatialjpIndexItemGroup `json:"generic,omitempty" cms:"generic,group"`
}

func GspatialjpIndexItemFrom

func GspatialjpIndexItemFrom(item *cms.Item) (i *GspatialjpIndexItem)

func (*GspatialjpIndexItem) GenericMap

func (g *GspatialjpIndexItem) GenericMap() map[string]string

type GspatialjpIndexItemGroup

type GspatialjpIndexItemGroup struct {
	Name  string         `cms:"name,text"`
	Type  string         `cms:"type,select"`
	Asset map[string]any `cms:"asset,asset"`
}

func (*GspatialjpIndexItemGroup) AssetURL

func (g *GspatialjpIndexItemGroup) AssetURL() string

type IndexItem

type IndexItem struct {
	Name     string
	Children []*IndexItem
}

type IndexSeed

type IndexSeed struct {
	CityName       string
	CityCode       string
	Year           int
	V              int
	CityGMLZipPath string
	PlateuaZipPath string
	RelatedZipPath string
	Generic        []GspatialjpIndexItemGroup
	Dic            map[string]string
}

type MergeContext

type MergeContext struct {
	TmpDir          string
	CityItem        *CityItem
	AllFeatureItems map[string]FeatureItem
	UC              int
	WetRun          bool
}

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 Zip2zip

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

func NewZip2zip

func NewZip2zip(w *zip.Writer) *Zip2zip

func (*Zip2zip) Close

func (z *Zip2zip) Close() error

func (*Zip2zip) Run

func (z *Zip2zip) Run(src *zip.Reader, fn Zip2zipFn) error

type Zip2zipFn

type Zip2zipFn = func(*zip.File) (string, error)

Jump to

Keyboard shortcuts

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