Mercurial > gemma
diff 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 |
line wrap: on
line diff
--- a/cmd/wfs/main.go Mon Dec 17 11:13:11 2018 +0100 +++ b/cmd/wfs/main.go Mon Dec 17 12:23:18 2018 +0100 @@ -41,9 +41,21 @@ log.Fatalf("error: %v\n", err) } + fmt.Println("service identification") + fmt.Println("----------------------") fmt.Printf("title: %s\n", caps.ServiceIdentification.Title) + fmt.Printf("abstract: %s\n", caps.ServiceIdentification.Abstract) + if len(caps.ServiceIdentification.Keywords.Keywords) > 0 { + fmt.Println("keywords:") + for _, kw := range caps.ServiceIdentification.Keywords.Keywords { + fmt.Printf("\t%s\n", kw.Value) + } + } fmt.Printf("type: %s\n", caps.ServiceIdentification.ServiceType) fmt.Printf("version: %s\n", caps.ServiceIdentification.ServiceTypeVersion) + fmt.Println() + fmt.Println("operations meta data") + fmt.Println("--------------------") if len(caps.OperationsMetadata.Operations) > 0 { fmt.Println("operations:") for _, operation := range caps.OperationsMetadata.Operations { @@ -96,5 +108,32 @@ } } } + fmt.Println() + fmt.Println("feature type list") + fmt.Println("------------------") + if len(caps.FeatureTypeList.FeatureTypes) > 0 { + fmt.Println("features:") + for _, ft := range caps.FeatureTypeList.FeatureTypes { + fmt.Printf("\tname: %s\n", ft.Name) + fmt.Printf("\ttitle: %s\n", ft.Title) + fmt.Printf("\tdefault CRS: %s\n", ft.DefaultCRS) + if len(ft.OtherCRSs) > 0 { + fmt.Println("\tother CRSs:") + for _, crs := range ft.OtherCRSs { + fmt.Printf("\t\t%s\n", crs) + } + } + if ft.WGS84BoundingBox != nil { + fmt.Printf("\tWGS84 bounding box: (%s) - (%s)\n", + ft.WGS84BoundingBox.LowerCorner, ft.WGS84BoundingBox.UpperCorner) + } + if len(ft.Keywords.Keywords) > 0 { + fmt.Printf("\tkeywords:\n") + for _, kw := range ft.Keywords.Keywords { + fmt.Printf("\t\t%s\n", kw.Value) + } + } + } + } } }