Checking the validity of LineStrings