// UnmarshalJSON implements the encoding/json Unmarshaler interface. It expects
// to receive a valid GeoJSON Geometry of the type Polygon, and will assign
// the value of that data to p. If the incoming JSON is the 'null' keyword,
// p will have no valid value.
UnmarshalJSON implements the encoding/json Unmarshaler interface. It expects
to receive a valid GeoJSON Geometry of the type Polygon, and will assign
the value of that data to p. If the incoming JSON is the 'null' keyword,
p will have no valid value.
// UnmarshalJSON implements the encoding / json Unmarshaler interface . It expects // to receive a valid GeoJSON Geometry of the type Polygon and will assign // the value of that data to p . If the incoming JSON is the ' null ' keyword // p will have no valid value .
func (p *SFPolygon) UnmarshalJSON(data []byte) error {
	if p == nil {
		return fmt.Errorf("null.SFPolygon: UnmarshalJSON called on nil pointer")
	}
	var k interface{}
	if err := json.Unmarshal(data, &k); err != nil {
		return err
	}
	if k == nil {
		p.Polygon = types.SFPolygon{}
		p.Valid = false
		return nil
	}
	if err := p.Polygon.UnmarshalJSON(data); err != nil {
		return err
	}
	p.Valid = true
	return nil
}
func ( p * SFPolygon ) UnmarshalJSON ( data [ ] byte ) error { if p == nil { return fmt . Errorf ( " " ) } var k interface { } if err := json . Unmarshal ( data , & k ) ; err != nil { return err } if k == nil { p . Polygon = types . SFPolygon { } p . Valid = false return nil } if err := p . Polygon . UnmarshalJSON ( data ) ; err != nil { return err } p . Valid = true return nil }
UnmarshalJSON implements the encoding/json Unmarshaler interface.
UnmarshalJSON implements the encoding / json Unmarshaler interface .