Checking the validity of input geometries