Skip to content

Commit

Permalink
Fixes merging defaults in ogc-capabilities generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
RoelvandenBerg committed Sep 8, 2021
1 parent 0f6d250 commit 662433f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pkg/wms130/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (c *Capabilities) GetLayer(layername string) (Layer, Exceptions) {
// RequestType containing the formats and DCPTypes available
type RequestType struct {
Format []string `xml:"Format" yaml:"format"`
DCPType DCPType `xml:"DCPType" yaml:"dcptype"`
DCPType *DCPType `xml:"DCPType" yaml:"dcptype"`
}

// Identifier in struct for repeatability
Expand Down
4 changes: 2 additions & 2 deletions pkg/wms130/getmap_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func BenchmarkGetMapValidate(b *testing.B) {
Request: Request{
GetMap: RequestType{
Format: []string{`image/jpeg`},
DCPType: DCPType{},
DCPType: &DCPType{},
},
},
Layer: []Layer{
Expand Down Expand Up @@ -251,7 +251,7 @@ func BenchmarkGetMapParseValidate(b *testing.B) {
Request: Request{
GetMap: RequestType{
Format: []string{`image/jpeg`},
DCPType: DCPType{},
DCPType: &DCPType{},
},
},
Layer: []Layer{
Expand Down
40 changes: 20 additions & 20 deletions pkg/wms130/getmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,18 @@ func TestGetMapParseQueryParameters(t *testing.T) {
BGCOLOR: {`0x7F7F7F`},
},
exception: InvalidParameterValue(`zzzz`, TRANSPARENT),
},
},
//REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=Rivers,Roads,Houses&STYLES=CenterLine,CenterLine,Outline&CRS=EPSG:4326&BBOX=-180.0,-90.0,180.0,90.0&WIDTH=1024&HEIGHT=512&FORMAT=image/jpeg&EXCEPTIONS=XML
4: {query: map[string][]string{REQUEST: {getmap}, SERVICE: {Service}, VERSION: {Version},
LAYERS: {`Rivers,Roads,Houses`},
STYLES: {`CenterLine,CenterLine,Outline`},
"CRS": {`EPSG:4326`},
BBOX: {`-180.0,-90.0,180.0,90.0`},
WIDTH: {`1024`},
HEIGHT: {`512`},
FORMAT: {`image/jpeg`},
EXCEPTIONS: {`XML`},
BGCOLOR: {`0x7F7F7F`},
LAYERS: {`Rivers,Roads,Houses`},
STYLES: {`CenterLine,CenterLine,Outline`},
"CRS": {`EPSG:4326`},
BBOX: {`-180.0,-90.0,180.0,90.0`},
WIDTH: {`1024`},
HEIGHT: {`512`},
FORMAT: {`image/jpeg`},
EXCEPTIONS: {`XML`},
BGCOLOR: {`0x7F7F7F`},
},
excepted: GetMapRequest{
BaseRequest: BaseRequest{
Expand All @@ -365,15 +365,15 @@ func TestGetMapParseQueryParameters(t *testing.T) {
}},
//REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=Rivers&STYLES=&CRS=EPSG:4326&BBOX=-180.0,-90.0,180.0,90.0&WIDTH=1024&HEIGHT=512&FORMAT=image/jpeg&EXCEPTIONS=XML
5: {query: map[string][]string{REQUEST: {getmap}, SERVICE: {Service}, VERSION: {Version},
LAYERS: {`Rivers`},
STYLES: {``},
"CRS": {`EPSG:4326`},
BBOX: {`-180.0,-90.0,180.0,90.0`},
WIDTH: {`1024`},
HEIGHT: {`512`},
FORMAT: {`image/jpeg`},
EXCEPTIONS: {`XML`},
BGCOLOR: {`0x7F7F7F`},
LAYERS: {`Rivers`},
STYLES: {``},
"CRS": {`EPSG:4326`},
BBOX: {`-180.0,-90.0,180.0,90.0`},
WIDTH: {`1024`},
HEIGHT: {`512`},
FORMAT: {`image/jpeg`},
EXCEPTIONS: {`XML`},
BGCOLOR: {`0x7F7F7F`},
},
excepted: GetMapRequest{
BaseRequest: BaseRequest{
Expand Down Expand Up @@ -666,7 +666,7 @@ func TestGetMapValidate(t *testing.T) {
Request: Request{
GetMap: RequestType{
Format: []string{`image/jpeg`},
DCPType: DCPType{},
DCPType: &DCPType{},
},
},
Layer: []Layer{
Expand Down

0 comments on commit 662433f

Please sign in to comment.