'Overridden from GeoQuery\'s normalize to handle the conversion of
GeoAggregate objects.'

def resolve_aggregate(self, value, aggregate, connection):

    if isinstance(aggregate, self.aggregates_module.GeoAggregate):
        if aggregate.is_extent:
            if (aggregate.is_extent == '3D'):
                return connection.ops.convert_extent3d(value)
            else:
                return connection.ops.convert_extent(value)
        else:
            return connection.ops.convert_geom(value, aggregate.source)
    else:
        return super(GeoQuery, self).resolve_aggregate(value, aggregate, connection)
