static readonly Regex pattern = new Regex(
"(?<d>[0-9]+)\xB0(?<m>[0-9]+)'(?<s>[0-9]+)\"(?<p>[N|S])");
public static Latitude Parse(SqlString s)
{
   if(s.IsNull || (s.Value.ToLower() == "null"))
   {
      return Null;
   }
   if(!pattern.IsMatch(s.Value))
   {
      throw new ApplicationException(
      "'" + s.Value + "' is not valid angle", null);
   }
   Match m = pattern.Match(s.Value);
   ushort degrees = ushort.Parse(m.Result("${d}"));
   byte minutes = byte.Parse(m.Result("${m}"));
   byte seconds = byte.Parse(m.Result("${s}"));
   if(degrees > 90)
   {
      throw new ApplicationException(
          "max degrees is 90", null);
   }
   if(minutes > 59)
   {
      throw new ApplicationException(
          "max minutes is 59", null);
   }
   if(seconds > 59)
   {
      throw new ApplicationException(
            "max seconds is 59", null);
   }
   char direction = m.Result("${p}")[0];
   return new Latitude(degrees, minutes,
                      seconds, direction);
}