Mercurial > gemma
comparison cmd/wfs/main.go @ 1600:658c1ebc1707
WFS Capabilities parser: Parse FeatureTypeList, too.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 17 Dec 2018 12:23:18 +0100 |
parents | 5e16d1fbe91f |
children | e80e35b26f17 |
comparison
equal
deleted
inserted
replaced
1599:5e16d1fbe91f | 1600:658c1ebc1707 |
---|---|
39 caps, err := loadCapabilities(arg) | 39 caps, err := loadCapabilities(arg) |
40 if err != nil { | 40 if err != nil { |
41 log.Fatalf("error: %v\n", err) | 41 log.Fatalf("error: %v\n", err) |
42 } | 42 } |
43 | 43 |
44 fmt.Println("service identification") | |
45 fmt.Println("----------------------") | |
44 fmt.Printf("title: %s\n", caps.ServiceIdentification.Title) | 46 fmt.Printf("title: %s\n", caps.ServiceIdentification.Title) |
47 fmt.Printf("abstract: %s\n", caps.ServiceIdentification.Abstract) | |
48 if len(caps.ServiceIdentification.Keywords.Keywords) > 0 { | |
49 fmt.Println("keywords:") | |
50 for _, kw := range caps.ServiceIdentification.Keywords.Keywords { | |
51 fmt.Printf("\t%s\n", kw.Value) | |
52 } | |
53 } | |
45 fmt.Printf("type: %s\n", caps.ServiceIdentification.ServiceType) | 54 fmt.Printf("type: %s\n", caps.ServiceIdentification.ServiceType) |
46 fmt.Printf("version: %s\n", caps.ServiceIdentification.ServiceTypeVersion) | 55 fmt.Printf("version: %s\n", caps.ServiceIdentification.ServiceTypeVersion) |
56 fmt.Println() | |
57 fmt.Println("operations meta data") | |
58 fmt.Println("--------------------") | |
47 if len(caps.OperationsMetadata.Operations) > 0 { | 59 if len(caps.OperationsMetadata.Operations) > 0 { |
48 fmt.Println("operations:") | 60 fmt.Println("operations:") |
49 for _, operation := range caps.OperationsMetadata.Operations { | 61 for _, operation := range caps.OperationsMetadata.Operations { |
50 fmt.Printf("\t%s\n", operation.Name) | 62 fmt.Printf("\t%s\n", operation.Name) |
51 if operation.DCP.HTTP.Get != nil { | 63 if operation.DCP.HTTP.Get != nil { |
94 fmt.Printf("\t\t%s\n", av.Value) | 106 fmt.Printf("\t\t%s\n", av.Value) |
95 } | 107 } |
96 } | 108 } |
97 } | 109 } |
98 } | 110 } |
111 fmt.Println() | |
112 fmt.Println("feature type list") | |
113 fmt.Println("------------------") | |
114 if len(caps.FeatureTypeList.FeatureTypes) > 0 { | |
115 fmt.Println("features:") | |
116 for _, ft := range caps.FeatureTypeList.FeatureTypes { | |
117 fmt.Printf("\tname: %s\n", ft.Name) | |
118 fmt.Printf("\ttitle: %s\n", ft.Title) | |
119 fmt.Printf("\tdefault CRS: %s\n", ft.DefaultCRS) | |
120 if len(ft.OtherCRSs) > 0 { | |
121 fmt.Println("\tother CRSs:") | |
122 for _, crs := range ft.OtherCRSs { | |
123 fmt.Printf("\t\t%s\n", crs) | |
124 } | |
125 } | |
126 if ft.WGS84BoundingBox != nil { | |
127 fmt.Printf("\tWGS84 bounding box: (%s) - (%s)\n", | |
128 ft.WGS84BoundingBox.LowerCorner, ft.WGS84BoundingBox.UpperCorner) | |
129 } | |
130 if len(ft.Keywords.Keywords) > 0 { | |
131 fmt.Printf("\tkeywords:\n") | |
132 for _, kw := range ft.Keywords.Keywords { | |
133 fmt.Printf("\t\t%s\n", kw.Value) | |
134 } | |
135 } | |
136 } | |
137 } | |
99 } | 138 } |
100 } | 139 } |