Mercurial > gemma
comparison pkg/wfs/capabilities.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 |
---|---|
18 "io" | 18 "io" |
19 | 19 |
20 "golang.org/x/net/html/charset" | 20 "golang.org/x/net/html/charset" |
21 ) | 21 ) |
22 | 22 |
23 type Keyword struct { | |
24 XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 Keyword"` | |
25 Value string `xml:",cdata"` | |
26 } | |
27 type Keywords struct { | |
28 XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 Keywords"` | |
29 Keywords []Keyword `xml:"Keyword"` | |
30 } | |
31 | |
23 type ServiceIdentification struct { | 32 type ServiceIdentification struct { |
24 XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 ServiceIdentification"` | 33 XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 ServiceIdentification"` |
25 | |
26 Title string | 34 Title string |
35 Abstract string | |
36 Keywords Keywords `xml:"Keywords"` | |
27 ServiceType string | 37 ServiceType string |
28 ServiceTypeVersion string | 38 ServiceTypeVersion string |
29 } | 39 } |
30 | 40 |
31 type Get struct { | 41 type Get struct { |
89 XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 OperationsMetadata"` | 99 XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 OperationsMetadata"` |
90 Operations []*Operation `xml:"Operation"` | 100 Operations []*Operation `xml:"Operation"` |
91 Constraints []*Constraint `xml:"Constraint"` | 101 Constraints []*Constraint `xml:"Constraint"` |
92 } | 102 } |
93 | 103 |
104 type WGS84BoundingBox struct { | |
105 XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 WGS84BoundingBox"` | |
106 LowerCorner string `xml:"LowerCorner"` | |
107 UpperCorner string `xml:"UpperCorner"` | |
108 } | |
109 | |
110 type FeatureType struct { | |
111 XMLName xml.Name `xml:"http://www.opengis.net/wfs/2.0 FeatureType"` | |
112 Name string `xml:"Name"` | |
113 Title string `xml:"Title"` | |
114 Keywords Keywords `xml:"Keywords"` | |
115 DefaultCRS string `xml:"DefaultCRS"` | |
116 OtherCRSs []string `xml:"OtherCRS"` | |
117 WGS84BoundingBox *WGS84BoundingBox `xml:"WGS84BoundingBox"` | |
118 } | |
119 | |
120 type FeatureTypeList struct { | |
121 XMLName xml.Name `xml:"http://www.opengis.net/wfs/2.0 FeatureTypeList"` | |
122 FeatureTypes []*FeatureType `xml:"FeatureType"` | |
123 } | |
124 | |
94 type Capabilities struct { | 125 type Capabilities struct { |
95 XMLName xml.Name `xml:"http://www.opengis.net/wfs/2.0 WFS_Capabilities"` | 126 XMLName xml.Name `xml:"http://www.opengis.net/wfs/2.0 WFS_Capabilities"` |
96 | 127 |
97 ServiceIdentification ServiceIdentification | 128 ServiceIdentification ServiceIdentification |
98 OperationsMetadata OperationsMetadata | 129 OperationsMetadata OperationsMetadata |
130 FeatureTypeList FeatureTypeList | |
99 } | 131 } |
100 | 132 |
101 func ParseCapabilities(r io.Reader) (*Capabilities, error) { | 133 func ParseCapabilities(r io.Reader) (*Capabilities, error) { |
102 | 134 |
103 decoder := xml.NewDecoder(r) | 135 decoder := xml.NewDecoder(r) |