public static Area getArea ( Location ... locations ) { if ( locations . length == 2 ) { if ( locations [ 0 ] . getLongitude ( ) == 0.0 && locations [ 1 ] . getLongitude ( ) == 0.0 ) { return getPolar ( locations [ 0 ] . getLatitude ( ) , locations [ 1 ] . getLatitude ( ) ) ; } else { throw new IllegalArgumentException ( ) ; } } else { return new ConvexArea ( locations ) ; } }
Returns area limited by given coordinates . Area must be convex . If exactly 2 locations are given the longitudes must be 0 defining polar area limited by latitudes .