def dissolve(self, by=None, aggfunc=None):
        # type: (Optional[str], Optional[Callable]) -> FeatureCollection
        """Dissolve geometries and rasters within `groupby`.

        """
        if by:
            agg = partial(dissolve, aggfunc=aggfunc)  # type: Callable[[BaseCollection], GeoFeature]
            return self.groupby(by).agg(agg)

        else:
            return FeatureCollection([dissolve(self, aggfunc)])
Dissolve geometries and rasters within `groupby`.