code: func (fc FeatureCollection) MarshalJSON() ([]byte, error) {
  	type featureCollection FeatureCollection
  
  	fcol := &featureCollection{
  		Type: "FeatureCollection",
  	}
  
  	if fc.BoundingBox != nil && len(fc.BoundingBox) != 0 {
  		fcol.BoundingBox = fc.BoundingBox
  	}
  
  	fcol.Features = fc.Features
  	if fcol.Features == nil {
  		fcol.Features = make([]*Feature, 0) // GeoJSON requires the feature attribute to be at least []
  	}
  
  	if fc.CRS != nil && len(fc.CRS) != 0 {
  		fcol.CRS = fc.CRS
  	}
  
  	return json.Marshal(fcol)
  }
docs: // MarshalJSON converts the feature collection object into the proper JSON.
  // It will handle the encoding of all the child features and geometries.
  // Alternately one can call json.Marshal(fc) directly for the same result.