3 Replies Latest reply on May 12, 2014 4:05 PM by philmodjunk

    Nautical Charts



      Nautical Charts


           I'm developing a solution for my own use. I intend to use it to update paper nautical charts.

           The first problem I've run into is error checking about the boundaries of the charts.

           I'll input longitude-latitude for each edge of the chart, latitude for the northern and southern boundaries, longitude for the eastern and western boundaries. I'll enter standard longitude-latitude coordinates for the corrections. Then the fun begins.

           I've figured out how to convert degrees-minutes-seconds to decimal degrees, so I can compare one coordinate to another. So far so good.

           The first problem I have is error checking: I was happily entering charts, one chart per record, and corrections, but none of the coordinates for the corrections themselves were ever showing up on any of the charts. Then I realized that I had reversed the input on most of the charts, and had the southern boundary to the north of the northern boundary, thereby creating a rectangle with no height, that would never contain any of the coordinates of any of the corrections.

           So I need to do error checking on the four boundaries of the charts: I need to validate that the northern boundary as input is north of the southern boundary, and the eastern boundary is east of the western boundary. And, I believe, vice-versa. Which is one of my questions.

           How much error checking do I need? If I check the southern boundary against the northern boundary, north-south is good. But what happens if I then input the southern boundary first, and the northern boundary second? Will it still validate correctly?

           Do I, therefore, need validation on all four of the coordinates, at the time of input?

           Then there's Greenwich and the equator. Whoever designed latitude and longitude clearly wasn't thinking of Filemaker input.

           At the moment, all of my charts are Puget Sound, and are all, therefore, in the northern hemisphere and west of Greenwich. So checking the direction of a boundary (N,E,S,W) will always resolve to N and W, and then I'll have to move on to checking the decimal degrees for equal-to-or-greater, and so on. I can see that, and I can probably slug my way through the logic for it.

           There are, however, charts that span the equator and charts that span the Greenwich meridian. Those seem (to me) that they will resolve themselves simply by comparing the cardinal directions-- an N will always be north of an S coordinate, for example. At Greenwich, an east coordinate will always be to the east of a west coordinate. All good.

           Where I'm having trouble is at the 180 degree longitude line. At that line, and on charts that span that line, 179 degrees west longitude is to the east of 179 degrees east longitude. So comparing the cardinal directions yields a result that is exactly wrong, and comparing the coordinates themselves could yield the same number, even though the coordinates are dozens or hundreds of nautical miles apart.

           At least a southern latitude is always south of a northern latitudes, and the latitudes never meet.

           So, as specific questions:

      1.           Do I need to check each of the four boundaries, or is checking two of them sufficient?
      3.           If I check just two of them, will I catch errors if I happen to reverse the input order?
      5.           How do I check for input errors in the boundaries of a chart that spans the 180 degree longitude line?

        • 1. Re: Nautical Charts

               1) since your values describe a rectangle, you definitely need to check all four, though it would appear that you need to check them in pairs (north latitude should be less than south, west longitude should be greater than east.

               2) the checks described for 1) should catch reversed coordinate boundaries

               3) latitude and longitude are cartesian type coordinates projected on a spheres with units that measure arcs of a circle, correct? Values on one side of Long 0 and lat 0 typically would be recorded as negative values, correct?

               You may need to set a special flag that reverses the logic of your error checking when the 180 degree Longitude line is present in the chart.

          • 2. Re: Nautical Charts

                 No, they are not positive and negative, but I didn't think of that. The values range from zero, at Greenwich, to 180, and are written either "XXX-W" or "XXX-E", meaning going west or going east.

                 I'm experimenting with a rather clumsy formula of converting them all to a west-bound 360 degree format. I'm reading west degrees as is, then subtracting east degrees from 180 and adding that remainder to 180.

                 That's extremely clumsy, and adds both an extra calculation and another chance for rounding errors, but those objections may turn out to be insignificant.

                 If you use negative numbers for eastern values and positive numbers for western values, you still have the same problem.

                 You do the error checking by checking the western edge against the eastern edge, and checking that the western value is greater than the eastern value.

                 So with a chart that spans the dreaded 180 degree line, say, from 179 degrees east to 179 degrees west, you'd have a chart whose eastern edge has a value of 179, and a western edge with a value of -179, and error checking would fail.

                 It doesn't matter if you call them west and east or positive and negative, if the rectangle spans that line, (the 180 degree line) you have an eastern edge reading in western numbers and a western edge reading in eastern numbers.

            • 3. Re: Nautical Charts

                        If you use negative numbers for eastern values and positive numbers for western values, you still have the same problem.

                   Which is why I suggested:


                        You may need to set a special flag that reverses the logic of your error checking when the 180 degree Longitude line is present in the chart.