diff 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
line wrap: on
line diff
--- a/pkg/wfs/capabilities.go	Mon Dec 17 11:13:11 2018 +0100
+++ b/pkg/wfs/capabilities.go	Mon Dec 17 12:23:18 2018 +0100
@@ -20,10 +20,20 @@
 	"golang.org/x/net/html/charset"
 )
 
+type Keyword struct {
+	XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 Keyword"`
+	Value   string   `xml:",cdata"`
+}
+type Keywords struct {
+	XMLName  xml.Name  `xml:"http://www.opengis.net/ows/1.1 Keywords"`
+	Keywords []Keyword `xml:"Keyword"`
+}
+
 type ServiceIdentification struct {
-	XMLName xml.Name `xml:"http://www.opengis.net/ows/1.1 ServiceIdentification"`
-
+	XMLName            xml.Name `xml:"http://www.opengis.net/ows/1.1 ServiceIdentification"`
 	Title              string
+	Abstract           string
+	Keywords           Keywords `xml:"Keywords"`
 	ServiceType        string
 	ServiceTypeVersion string
 }
@@ -91,11 +101,33 @@
 	Constraints []*Constraint `xml:"Constraint"`
 }
 
+type WGS84BoundingBox struct {
+	XMLName     xml.Name `xml:"http://www.opengis.net/ows/1.1 WGS84BoundingBox"`
+	LowerCorner string   `xml:"LowerCorner"`
+	UpperCorner string   `xml:"UpperCorner"`
+}
+
+type FeatureType struct {
+	XMLName          xml.Name          `xml:"http://www.opengis.net/wfs/2.0 FeatureType"`
+	Name             string            `xml:"Name"`
+	Title            string            `xml:"Title"`
+	Keywords         Keywords          `xml:"Keywords"`
+	DefaultCRS       string            `xml:"DefaultCRS"`
+	OtherCRSs        []string          `xml:"OtherCRS"`
+	WGS84BoundingBox *WGS84BoundingBox `xml:"WGS84BoundingBox"`
+}
+
+type FeatureTypeList struct {
+	XMLName      xml.Name       `xml:"http://www.opengis.net/wfs/2.0 FeatureTypeList"`
+	FeatureTypes []*FeatureType `xml:"FeatureType"`
+}
+
 type Capabilities struct {
 	XMLName xml.Name `xml:"http://www.opengis.net/wfs/2.0 WFS_Capabilities"`
 
 	ServiceIdentification ServiceIdentification
 	OperationsMetadata    OperationsMetadata
+	FeatureTypeList       FeatureTypeList
 }
 
 func ParseCapabilities(r io.Reader) (*Capabilities, error) {