Mercurial > gemma
comparison pkg/wfs/rawfeaturecollection.go @ 1689:6caf5cd6249e
WFS: Made golint happy.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 30 Dec 2018 14:39:46 +0100 |
parents | 92da44ba610c |
children |
comparison
equal
deleted
inserted
replaced
1688:774174d09d30 | 1689:6caf5cd6249e |
---|---|
16 import ( | 16 import ( |
17 "encoding/json" | 17 "encoding/json" |
18 "io" | 18 "io" |
19 ) | 19 ) |
20 | 20 |
21 // RawFeatureCollection is a template for a feature collection | |
22 // returned by a WFS server. | |
21 type RawFeatureCollection struct { | 23 type RawFeatureCollection struct { |
22 CRS *struct { | 24 CRS *struct { |
23 Properties struct { | 25 Properties struct { |
24 Name string `json:"name"` | 26 Name string `json:"name"` |
25 } `json:"properties"` | 27 } `json:"properties"` |
31 } `json:"geometry"` | 33 } `json:"geometry"` |
32 Properties *json.RawMessage `json:"properties"` | 34 Properties *json.RawMessage `json:"properties"` |
33 } `json:"features"` | 35 } `json:"features"` |
34 } | 36 } |
35 | 37 |
38 // ParseRawFeatureCollection turns a io.Reader into raw feature collection. | |
36 func ParseRawFeatureCollection(r io.Reader) (*RawFeatureCollection, error) { | 39 func ParseRawFeatureCollection(r io.Reader) (*RawFeatureCollection, error) { |
37 rfc := new(RawFeatureCollection) | 40 rfc := new(RawFeatureCollection) |
38 if err := json.NewDecoder(r).Decode(rfc); err != nil { | 41 if err := json.NewDecoder(r).Decode(rfc); err != nil { |
39 return nil, err | 42 return nil, err |
40 } | 43 } |