Mercurial > gemma
diff cmd/wfs/dump.go @ 1679:2dc7768be0e4
Waterway axis import: More on reading data from WFS. TODO: Parse to concrete features.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 26 Dec 2018 21:01:29 +0100 |
parents | 92da44ba610c |
children | 2b72f5e005aa |
line wrap: on
line diff
--- a/cmd/wfs/dump.go Wed Dec 26 10:54:52 2018 +0100 +++ b/cmd/wfs/dump.go Wed Dec 26 21:01:29 2018 +0100 @@ -18,6 +18,7 @@ "errors" "fmt" "io" + "log" "os" "gemma.intevation.de/gemma/pkg/wfs" @@ -40,13 +41,19 @@ crsName = defaultCRS } fmt.Printf("CRS: %s\n", crsName) - types := map[string]struct{}{} + epsg, err := wfs.CRSToEPSG(crsName) + if err != nil { + log.Printf("error: %v\n", err) + } else { + fmt.Printf("EPSG: %d\n", epsg) + } + types := map[string]int{} for _, feature := range rfc.Features { - types[feature.Geometry.Type] = struct{}{} + types[feature.Geometry.Type]++ } fmt.Printf("found types in %d features:\n", len(rfc.Features)) - for typ := range types { - fmt.Printf("\t%s\n", typ) + for typ, cnt := range types { + fmt.Printf("\t%s: %d\n", typ, cnt) } return nil })