Skip to content

Commit

Permalink
operators ids and names
Browse files Browse the repository at this point in the history
  • Loading branch information
clezag committed Jun 10, 2024
1 parent 613e73e commit 6ba3ba9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
42 changes: 22 additions & 20 deletions src/config/operators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: CC0-1.0

- origin: BIKE_SHARING_BOLZANO
- origin: [BIKE_SHARING_BOLZANO]
id: "Municipality of Bolzano bikesharing"
name: Municipality of Bolzano
email: [email protected]
phone: 0471997111
Expand All @@ -12,7 +13,8 @@
postcode: 39100
country: Italy

- origin: BIKE_SHARING_MERANO
- origin: [BIKE_SHARING_MERANO]
id: "Municipality of Merano bikesharing"
name: Municipality of Merano
email: [email protected]
phone: 0473250111
Expand All @@ -22,7 +24,8 @@
postcode: 39012
country: Italy

- origin: BIKE_SHARING_PAPIN
- origin: [BIKE_SHARING_PAPIN]
id: Papin Sport
name: Papin Sport
email: [email protected]
phone: 0474913450
Expand All @@ -32,7 +35,8 @@
postcode: 39038
country: Italy

- origin: HAL-API
- origin: [HAL-API]
id: Car Sharing Alto Adige
name: Car Sharing Alto Adige
email: [email protected]
phone: 0471061319
Expand All @@ -42,7 +46,8 @@
postcode: 39100
country: Italy

- origin: FAMAS
- origin: [FAMAS]
id: "Municipality of Bolzano parking"
name: Municipality of Bolzano
email: [email protected]
phone: 0471997111
Expand All @@ -52,7 +57,8 @@
postcode: 39100
country: Italy

- origin: Municipality Merano
- origin: [Municipality Merano]
id: "Municipality of Merano parking"
name: Municipality of Merano
email: [email protected]
phone: 0473250111
Expand All @@ -62,7 +68,8 @@
postcode: 39012
country: Italy

- origin: FBK-Trento
- origin: [FBK-Trento]
id: Municipality of Trento
name: Municipality of Trento
email: [email protected]
phone: 0461884111
Expand All @@ -72,7 +79,8 @@
postcode: 38122
country: Italy

- origin: FBK-Rovereto
- origin: [FBK-Rovereto]
id: Municipality of Rovereto
name: Municipality of Rovereto
email: [email protected]
phone: 0464452111
Expand All @@ -82,7 +90,8 @@
postcode: 38068
country: Italy

- origin: A22
- origin: [A22]
id: A22
name: A22
email: [email protected]
phone: 0461212611
Expand All @@ -92,17 +101,10 @@
postcode: 38121
country: Italy

- origin: skidata
name: STA
email: [email protected]
phone: 0471312888
url: https://www.sta.bz.it
street: Via dei Conciapelli 60
town: Bolzano
postcode: 39100
country: Italy

- origin: bicincitta
- origin:
- bicincitta
- skidata
id: STA
name: STA
email: [email protected]
phone: 0471312888
Expand Down
3 changes: 2 additions & 1 deletion src/netex/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ type datasetCfg struct {
}

type operatorCfg struct {
Origin string
Origin []string
Id string
Name string
Email string
Phone string
Expand Down
10 changes: 6 additions & 4 deletions src/netex/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import (
func mapByOrigin(p []operatorCfg) map[string]operatorCfg {
ret := make(map[string]operatorCfg)
for _, o := range p {
ret[o.Origin] = o
for _, origin := range o.Origin {
ret[origin] = o
}
}
return ret
}
Expand All @@ -26,9 +28,9 @@ func (c *Config) GetOperator(id string) Operator {
}

o := Operator{}
o.Id = CreateID("Operator", id)
o.Id = CreateID("Operator", cfg.Id)
o.Version = "1"
o.PrivateCode = id
o.PrivateCode = cfg.Id
o.Name = cfg.Name
o.ShortName = cfg.Name
o.LegalName = cfg.Name
Expand All @@ -37,7 +39,7 @@ func (c *Config) GetOperator(id string) Operator {
o.ContactDetails.Phone = cfg.Phone
o.ContactDetails.Url = cfg.Url
o.OrganisationType = "operator"
o.Address.Id = CreateID("Address", id)
o.Address.Id = CreateID("Address", cfg.Name)
o.Address.CountryName = cfg.Country
o.Address.Street = cfg.Street
o.Address.Town = cfg.Town
Expand Down

0 comments on commit 6ba3ba9

Please sign in to comment.