src/datatypes/spatiotemporal.cpp
/*
 * Returns whether the other SpatialReference is contained (smaller or equal) within this.
 * Throws an exception if the crs don't match
 */
Returns whether the other SpatialReference is contained (smaller or equal) within this.
Throws an exception if the crs don't match
Returns whether the other SpatialReference is contained ( smaller or equal ) within this . Throws an exception if the crs don ' t match
bool SpatialReference::contains(const SpatialReference &other) const {
	if (crsId != other.crsId)
		throw ArgumentException("SpatialReference::contains(): crsId don't match");
	if ( x1 <= other.x1 && x2 >= other.x2 && y1 <= other.y1 && y2 >= other.y2 )
		return true;
	auto ex = SpatialReference::extent(crsId);
	double xeps = (ex.x2-ex.x1)*std::numeric_limits<double>::epsilon();
	double yeps = (ex.y2-ex.y1)*std::numeric_limits<double>::epsilon();
	return ( (x1 - other.x1) < xeps  ) &&
		   ( (other.x2 - x2) < xeps ) &&
		   ( (y1 - other.y1) < yeps ) &&
		   ( (other.y2 - y2) < yeps );
}
bool SpatialReference :: contains ( const SpatialReference & other ) const { if ( crsId != other . crsId ) throw ArgumentException ( " " ) ; if ( x1 <= other . x1 && x2 >= other . x2 && y1 <= other . y1 && y2 >= other . y2 ) return true ; auto ex = SpatialReference :: extent ( crsId ) ; double xeps = ( ex . x2 - ex . x1 ) * std :: numeric_limits < double > :: epsilon ( ) ; double yeps = ( ex . y2 - ex . y1 ) * std :: numeric_limits < double > :: epsilon ( ) ; return ( ( x1 - other . x1 ) < xeps ) && ( ( other . x2 - x2 ) < xeps ) && ( ( y1 - other . y1 ) < yeps ) && ( ( other . y2 - y2 ) < yeps ) ; }
Returns whether the other SpatialReference is contained (smaller or equal) within this.
Returns whether the other SpatialReference is contained ( smaller or equal ) within this .
//TODO: Talk about this