Skip to content

Commit

Permalink
Merge pull request #23 from PDOK/PDOK-13230-int-test
Browse files Browse the repository at this point in the history
Pdok 13230 int test
  • Loading branch information
arbakker authored Aug 20, 2021
2 parents 7c70b02 + 766085a commit 99c0784
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 32 deletions.
14 changes: 7 additions & 7 deletions pkg/wcs201/getcapabilities_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ type ServiceProvider struct {
Country string `xml:"ows:Country" yaml:"country"`
ElectronicMailAddress string `xml:"ows:ElectronicMailAddress" yaml:"electronicmailaddress"`
} `xml:"ows:Address" yaml:"address"`
OnlineResource struct {
Type string `xml:"xlink:type,attr" yaml:"type"`
Href string `xml:"xlink:href,attr" yaml:"href"`
} `xml:"ows:OnlineResource" yaml:"onlineresource"`
HoursOfService string `xml:"ows:HoursOfService" yaml:"hoursofservice"`
ContactInstructions string `xml:"ows:ContactInstructions" yaml:"contactinstructions"`
OnlineResource *struct {
Type string `xml:"xlink:type,attr,omitempty" yaml:"type"`
Href string `xml:"xlink:href,attr,omitempty" yaml:"href"`
} `xml:"ows:OnlineResource,omitempty" yaml:"onlineresource"`
HoursOfService string `xml:"ows:HoursOfService,omitempty" yaml:"hoursofservice"`
ContactInstructions string `xml:"ows:ContactInstructions,omitempty" yaml:"contactinstructions"`
} `xml:"ows:ContactInfo" yaml:"contactinfo"`
Role string `xml:"ows:Role" yaml:"role"`
Role string `xml:"ows:Role,omitempty" yaml:"role"`
} `xml:"ows:ServiceContact" yaml:"servicecontact"`
}
11 changes: 7 additions & 4 deletions pkg/wfs200/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ type OperationsMetadata struct {
XMLName xml.Name `xml:"ows:OperationsMetadata"`
Operation []Operation `xml:"ows:Operation"`
Parameter struct {
Name string `xml:"name,attr" yaml:"name"`
AllowedValues struct {
Value []string `xml:"ows:Value" yaml:"value"`
} `xml:"ows:AllowedValues" yaml:"allowedvalues"`
Name string `xml:"name,attr" yaml:"name"`
AllowedValues *AllowedValues `xml:"ows:AllowedValues" yaml:"allowedvalues"`
} `xml:"ows:Parameter" yaml:"parameter"`
Constraint []Constraint `xml:"ows:Constraint" yaml:"constraint"`
ExtendedCapabilities *ExtendedCapabilities `xml:"ows:ExtendedCapabilities" yaml:"extendedcapabilities"`
Expand Down Expand Up @@ -67,6 +65,11 @@ type Operation struct {
Value []string `xml:"ows:Value"`
} `xml:"ows:AllowedValues"`
} `xml:"ows:Parameter"`
Constraints []struct {
Name string `xml:"name,attr" yaml:"name"`
NoValues string `xml:"ows:NoValues" yaml:"novalues"`
DefaultValue string `xml:"ows:DefaultValue" yaml:"defaultvalue"`
} `xml:"ows:Constraint" yaml:"constraint"`
}

// AllowedValues struct so it can be used as a pointer
Expand Down
36 changes: 35 additions & 1 deletion pkg/wms130/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@ type Layer struct {
//Cascaded *string `xml:"cascaded,attr" yaml:"cascaded"`
Name *string `xml:"Name" yaml:"name"`
Title string `xml:"Title" yaml:"title"`
Abstract string `xml:"Abstract" yaml:"abstract"`
Abstract string `xml:"Abstract,omitempty" yaml:"abstract,omitempty"`
KeywordList *Keywords `xml:"KeywordList" yaml:"keywordlist"`
CRS []CRS `xml:"CRS" yaml:"crs"`
EXGeographicBoundingBox *EXGeographicBoundingBox `xml:"EX_GeographicBoundingBox" yaml:"exgeographicboundingbox"`
Dimension []*Dimension `xml:"Dimension" yaml:"dimension"`
BoundingBox []*LayerBoundingBox `xml:"BoundingBox" yaml:"boundingbox"`
AuthorityURL *AuthorityURL `xml:"AuthorityURL" yaml:"authorityurl"`
Attribution *Attribution `xml:"Attribution,omitempty" yaml:"attribution"`
Identifier *Identifier `xml:"Identifier" yaml:"identifier"`
FeatureListURL *FeatureListURL `xml:"FeatureListURL,omitempty" yaml:"featurelisturl"`
MetadataURL []*MetadataURL `xml:"MetadataURL" yaml:"metadataurl"`
Style []*Style `xml:"Style" yaml:"style"`
Layer []*Layer `xml:"Layer" yaml:"layer"`
Expand Down Expand Up @@ -217,6 +220,22 @@ type Identifier struct {
Value string `xml:",chardata" yaml:"value"`
}

// Attribution in struct for repeatability
type Attribution struct {
Title string `xml:"Title" yaml:"title"`
OnlineResource OnlineResource `xml:"OnlineResource" yaml:"onlineresource"`
LogoURL struct {
Format *string `xml:"Format" yaml:"format"`
OnlineResource OnlineResource `xml:"OnlineResource" yaml:"onlineresource"`
} `xml:"LogoURL" yaml:"logourl"`
}

// Identifier in struct for repeatability
type FeatureListURL struct {
Format string `xml:"Format" yaml:"format"`
OnlineResource OnlineResource `xml:"OnlineResource" yaml:"onlineresource"`
}

// MetadataURL in struct for repeatability
type MetadataURL struct {
Type *string `xml:"type,attr" yaml:"type"`
Expand Down Expand Up @@ -262,18 +281,25 @@ type LayerBoundingBox struct {
Miny float64 `xml:"miny,attr" yaml:"miny"`
Maxx float64 `xml:"maxx,attr" yaml:"maxx"`
Maxy float64 `xml:"maxy,attr" yaml:"maxy"`
Resx float64 `xml:"resx,attr,omitempty" yaml:"resx,omitempty"`
Resy float64 `xml:"resy,attr,omitempty" yaml:"resy,omitempty"`
}

// Style in struct for repeatability
type Style struct {
Name string `xml:"Name" yaml:"name"`
Title string `xml:"Title" yaml:"title"`
Abstract string `xml:"Abstract,omitempty" yaml:"abstract"`
LegendURL struct {
Width int `xml:"width,attr" yaml:"width"`
Height int `xml:"height,attr" yaml:"height"`
Format string `xml:"Format" yaml:"format"`
OnlineResource OnlineResource `xml:"OnlineResource" yaml:"onlineresource"`
} `xml:"LegendURL" yaml:"legendurl"`
StyleSheetURL *struct {
Format string `xml:"Format" yaml:"format"`
OnlineResource OnlineResource `xml:"OnlineResource" yaml:"onlineresource"`
} `xml:"StyleSheetURL,omitempty" yaml:"stylesheeturl"`
}

// DCPType in struct for repeatability
Expand All @@ -295,3 +321,11 @@ type OnlineResource struct {
Type *string `xml:"xlink:type,attr" yaml:"type"`
Href *string `xml:"xlink:href,attr" yaml:"href"`
}

type Dimension struct {
Name *string `xml:"name,attr" yaml:"name"`
Units *string `xml:"units,attr" yaml:"units"`
Default *string `xml:"default,attr,omitempty" yaml:"default"`
NearestValue *string `xml:"nearestValue,attr,omitempty" yaml:"nearestvalue"`
Value *string `xml:",chardata" yaml:"value"`
}
16 changes: 9 additions & 7 deletions pkg/wmts100/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ type Layer struct {
Identifier string `xml:"ows:Identifier" yaml:"identifier"`
Metadata *Metadata `xml:"ows:Metadata,omitempty" yaml:"metadata"`
Style []Style `xml:"Style" yaml:"style"`
Format string `xml:"Format" yaml:"format"`
Format []string `xml:"Format" yaml:"format"`
TileMatrixSetLink []TileMatrixSetLink `xml:"TileMatrixSetLink" yaml:"tilematrixsetlink"`
ResourceURL struct {
Format string `xml:"format,attr" yaml:"format"`
ResourceType string `xml:"resourceType,attr" yaml:"resourcetype"`
Template string `xml:"template,attr" yaml:"template"`
} `xml:"ResourceURL" yaml:"resourceurl"`
ResourceURL *ResourceURL `xml:"ResourceURL,omitempty" yaml:"resourceurl"`
}

type ResourceURL struct {
Format string `xml:"format,attr" yaml:"format"`
ResourceType string `xml:"resourceType,attr" yaml:"resourcetype"`
Template string `xml:"template,attr" yaml:"template"`
}

// Metadata in struct for repeatability
Expand All @@ -55,10 +57,10 @@ type Metadata struct {

// Style in struct for repeatability
type Style struct {
Identifier string `xml:"ows:Identifier" yaml:"identifier"`
Title *string `xml:"ows:Title,omitempty" yaml:"title"`
Abstract *string `xml:"ows:Abstract,omitempty" yaml:"abstract"`
Keywords *wsc110.Keywords `xml:"Keywords,omitempty" yaml:"keywords"`
Identifier string `xml:"ows:Identifier" yaml:"identifier"`
LegendURL []*LegendURL `xml:"LegendURL,omitempty" yaml:"legendurl"`
IsDefault *bool `xml:"isDefault,attr,omitempty" yaml:"isdefault"`
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/wmts100/capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var contentsWithLegend = Contents{
IsDefault: bp(true),
},
},
Format: "image/png",
Format: []string{"image/png"},
TileMatrixSetLink: []TileMatrixSetLink{
{
TileMatrixSet: "WholeWorld_CRS_84",
Expand Down Expand Up @@ -79,7 +79,7 @@ var contentsWithoutLegend = Contents{
IsDefault: bp(true),
},
},
Format: "image/png",
Format: []string{"image/png"},
TileMatrixSetLink: []TileMatrixSetLink{
{
TileMatrixSet: "WholeWorld_CRS_84",
Expand Down
60 changes: 51 additions & 9 deletions pkg/wmts100/getcapabilities_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ func (gc GetCapabilitiesResponse) ToXML() []byte {
type GetCapabilitiesResponse struct {
XMLName xml.Name `xml:"Capabilities"`
Namespaces `yaml:"namespaces"`
ServiceIdentification ServiceIdentification `xml:"ows:ServiceIdentification" yaml:"serviceidentification"`
Contents Contents `xml:"Contents" yaml:"contents"`
ServiceMetadataURL ServiceMetadataURL `xml:"ServiceMetadataURL" yaml:"servicemetadataurl"`
ServiceIdentification ServiceIdentification `xml:"ows:ServiceIdentification" yaml:"serviceidentification"`
ServiceProvider wsc110.ServiceProvider `xml:"ows:ServiceProvider,omitempty" yaml:"serviceprovider"`
OperationsMetadata *OperationsMetadata `xml:"ows:OperationsMetadata,omitempty" yaml:"operationsmetadata"`
Contents Contents `xml:"Contents" yaml:"contents"`
ServiceMetadataURL *ServiceMetadataURL `xml:"ServiceMetadataURL,omitempty" yaml:"servicemetadataurl"`
}

// Namespaces struct containing the namespaces needed for the XML document
Expand All @@ -54,14 +56,54 @@ type Namespaces struct {
SchemaLocation string `xml:"xsi:schemaLocation,attr" yaml:"schemalocation"`
}

type OperationsMetadata struct {
XMLName xml.Name `xml:"ows:OperationsMetadata"`
Operation []Operation `xml:"ows:Operation"`
}

// Operation struct for the WFS 2.0.0
type Operation struct {
Name string `xml:"name,attr"`
DCP struct {
HTTP struct {
Get *Method `xml:"ows:Get,omitempty" yaml:"get,omitempty"`
Post *Method `xml:"ows:Post,omitempty" yaml:"post,omitempty"`
} `xml:"ows:HTTP" yaml:"http"`
} `xml:"ows:DCP" yaml:"dcp"`
Parameter []struct {
Name string `xml:"name,attr"`
AllowedValues struct {
Value []string `xml:"ows:Value"`
} `xml:"ows:AllowedValues"`
} `xml:"ows:Parameter"`
Constraints []struct {
Name string `xml:"name,attr" yaml:"name"`
NoValues string `xml:"ows:NoValues" yaml:"novalues"`
DefaultValue string `xml:"ows:DefaultValue" yaml:"defaultvalue"`
} `xml:"ows:Constraint" yaml:"constraint"`
}

// Method in separated struct so to use it as a Pointer
type Method struct {
Type string `xml:"xlink:type,attr" yaml:"type"`
Href string `xml:"xlink:href,attr" yaml:"href"`
Constraint []struct {
Name string `xml:"name,attr" yaml:"name"`
AllowedValues struct {
Value []string `xml:"ows:Value" yaml:"value"`
} `xml:"ows:AllowedValues" yaml:"allowedvalues"`
} `xml:"ows:Constraint" yaml:"constraint"`
}

// ServiceIdentification struct should only be fill by the "template" configuration wmts100.yaml
type ServiceIdentification struct {
Title string `xml:"ows:Title" yaml:"title"`
Abstract string `xml:"ows:Abstract" yaml:"abstract"`
ServiceType string `xml:"ows:ServiceType" yaml:"servicetype"`
ServiceTypeVersion string `xml:"ows:ServiceTypeVersion" yaml:"servicetypeversion"`
Fees string `xml:"ows:Fees" yaml:"fees"`
AccessConstraints string `xml:"ows:AccessConstraints" yaml:"accessconstraints"`
Title string `xml:"ows:Title" yaml:"title"`
Abstract string `xml:"ows:Abstract" yaml:"abstract"`
Keywords wsc110.Keywords `xml:"ows:Keywords,omitempty" yaml:"keywords"`
ServiceType string `xml:"ows:ServiceType" yaml:"servicetype"`
ServiceTypeVersion string `xml:"ows:ServiceTypeVersion" yaml:"servicetypeversion"`
Fees string `xml:"ows:Fees" yaml:"fees"`
AccessConstraints string `xml:"ows:AccessConstraints" yaml:"accessconstraints"`
}

// ServiceMetadataURL in struct for repeatability
Expand Down
3 changes: 2 additions & 1 deletion pkg/wsc110/keywords.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ package wsc110

// Keywords in struct for repeatability
type Keywords struct {
Keyword []string `xml:"Keyword" yaml:"keyword"`
Keyword []string `xml:"ows:Keyword" yaml:"keyword"`
Type string `xml:"ows:Type,omitempty" yaml:"type"`
}
34 changes: 34 additions & 0 deletions pkg/wsc110/service_provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package wsc110

type ServiceProvider struct {
ProviderName string `xml:"ows:ProviderName" yaml:"providername"`
ProviderSite struct {
Type string `xml:"xlink:type,attr" yaml:"type"`
Href string `xml:"xlink:href,attr" yaml:"href"`
} `xml:"ows:ProviderSite" yaml:"providersite"`
ServiceContact struct {
IndividualName string `xml:"ows:IndividualName,omitempty" yaml:"individualname"`
PositionName string `xml:"ows:PositionName,omitempty" yaml:"positionname"`
ContactInfo struct {
Phone struct {
Voice string `xml:"ows:Voice" yaml:"voice"`
Facsimile string `xml:"ows:Facsimile" yaml:"facsimile"`
} `xml:"ows:Phone" yaml:"phone"`
Address struct {
DeliveryPoint string `xml:"ows:DeliveryPoint" yaml:"deliverypoint"`
City string `xml:"ows:City" yaml:"city"`
AdministrativeArea string `xml:"ows:AdministrativeArea" yaml:"administrativearea"`
PostalCode string `xml:"ows:PostalCode" yaml:"postalcode"`
Country string `xml:"ows:Country" yaml:"country"`
ElectronicMailAddress string `xml:"ows:ElectronicMailAddress" yaml:"electronicmailaddress"`
} `xml:"ows:Address" yaml:"address"`
OnlineResource *struct {
Type string `xml:"xlink:type,attr,omitempty" yaml:"type"`
Href string `xml:"xlink:href,attr,omitempty" yaml:"href"`
} `xml:"ows:OnlineResource,omitempty" yaml:"onlineresource"`
HoursOfService string `xml:"ows:HoursOfService,omitempty" yaml:"hoursofservice"`
ContactInstructions string `xml:"ows:ContactInstructions,omitempty" yaml:"contactinstructions"`
} `xml:"ows:ContactInfo" yaml:"contactinfo"`
Role string `xml:"ows:Role,omitempty" yaml:"role"`
} `xml:"ows:ServiceContact" yaml:"servicecontact"`
}
2 changes: 1 addition & 1 deletion pkg/wsc200/keywords.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package wsc200

// Keywords in struct for repeatability
type Keywords struct {
Keyword []string `xml:"Keyword" yaml:"keyword"`
Keyword []string `xml:"ows:Keyword" yaml:"keyword"`
}

0 comments on commit 99c0784

Please sign in to comment.