When using GeographyCollectionAggregate or GeographyUnionAggregate on set of points that exceed the hemisphere limit an Exception is raised. What would be better is if NULL is returned as this would match the behaviour of STUnion and would make the aggregate classes more usable.
For example: -
declare @x geography = 'MULTIPOINT ((0 1), (90 1), (180 1), (270 1))';
declare @y geography = 'POINT (45 1)';
select
@x.STUnion(@y)
This returns NULL because by unioning @y to @x the new geography exceeds the hemisphere limit.
However if using, say GeographyCollectionAggregate, like so: -
declare @t table (
name varchar(max),
position geography
);
insert into @t (name, position) values ('object 1', 'POINT (0 1)' );
insert into @t (name, position) values ('object 1', 'POINT (90 1)' );
insert into @t (name, position) values ('object 1', 'POINT (180 1)' );
insert into @t (name, position) values ('object 1', 'POINT (270 1)' );
/* including this point causes hemisphere limit Exception */
insert into @t (name, position) values ('object 1', 'POINT (45 1)' );
select name, dbo.GeographyCollectionAggregate(position) 'locus'
from @t
group by name
The inclusion of the POINT(45 1) forces the 'locus' value to exceed the hemisphere limit but instead of returning NULL a GLArgumentException is raised.