Jump to content
Server Maintenance This Week. ×

Nautical Charts


Jammer Six

This topic is 3639 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?
  2. If I check just two of them, will I catch errors if I happen to reverse the input order?
  3. How do I check for input errors in the boundaries of a chart that spans the 180 degree longitude line?

 

 

Link to comment
Share on other sites

I haven't really given this much thought, but it seems to me that if you want to make sure that a given point X is within the given N,E,S,W boundaries, then you must check that:

S ≤ Lat_X ≤ N

AND

(
W < E and W ≤ Lon_X ≤ E
or
E < W and ( E ≤ Lon_X ≤ 180 or -180 ≤ Lon_X ≤ W )
)

This refers to decimal degrees where latitude ranges from -90 to 90 and longitude from 0 to ±180.

 

Untested.

Link to comment
Share on other sites

For latitude, you really should be validating both the north and south boundaries. It will seem like you're duplicating the effort, since the two validations will resolve to the same truth, that northBoundary ≥ southBoundary. But you should still validate both fields because of how the validations get triggered. Suppose you have a validation on northBoundary but not on southBoundary; they start out with values 10 and -10, respectively; then you change southBoundary to 20. This is invalid according to the validation on the northBoundary field, but because you didn't edit that field, the validation doesn't get checked. (Comment's comment below is correct. Leave "Validate only if field has been modified" off. But there should still probably be two validations, one for latitude and one for longitude.)

 

Since you have some charts that straddle the antimeridian, you can't do the same thing for longitude. Do your charts have a maximum arc angle that they cover? If so, you could validate that your longitude boundaries don't exceed that.

Edited by jbante
Link to comment
Share on other sites

Oh, is this what it's really about - validating just the corners among themselves? Then yes, you will need to validate that the arc does not exceed some reasonable value (which could be pretty high).

 

Validating one field out of a pair (or if you prefer, just one out of all four) should be quite sufficient - provided you deselect the "Validate only if field has been modified" option.

  • Like 1
Link to comment
Share on other sites

This topic is 3639 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.