package transformers import ( "git.coopgo.io/coopgo-platform/solidarity-transport/servers/grpc/proto/gen" "github.com/paulmach/orb/geojson" ) func GeoJsonToProto(feature *geojson.Feature) (*gen.GeoJsonFeature, error) { serialized, err := feature.MarshalJSON() if err != nil { return nil, err } return &gen.GeoJsonFeature{ Serialized: string(serialized), }, nil } func ProtoToGeoJson(feature *gen.GeoJsonFeature) (*geojson.Feature, error) { gj, err := geojson.UnmarshalFeature([]byte(feature.Serialized)) if err != nil { return nil, err } return gj, err }