Lat Lon

My first {regular expression} pattern, and I don't know the whole schema. Your editing and advice ought to be appreciated.

LatLon represents latitude and longitude on the thin surface of this planet we call Earth. From a point on this surface (latest geoid), things could be tens of thousands of meters above and below -- e.g. seafloor and commercial jet.

To represent LatLon, I suggest using degrees, both for latitude and longitude, with fractional parts to as many digits of resolution as your precision can provide or requires. Elevation may be appended, but it must be signed, and should indicate its units and some sort of reference model (default is the sphere).

Example: equinox is when the sun LatLon is 0.000000000ne0+93e6miles

PostelsLaw suggests accepting notations with DegreesMinutes? and DegreesMinutesSeconds?. PostelsLaw also suggests accepting both as signed angles.

LatLon when output should sound like this pattern: Latitude: A number less than to or equal to +/- 90; followed by two characters (CaseInsensitive) [nNsS][eEwW] indicating quadrant; Longitude: A nunber less than or equal to +/-180.

PostelsLaw wants us to specify that output should be described thus real[ns][ew]real where both reals are usually positive and matched by this regular expression with positive numbers and this case:

Bugs: LatLon doesn't include a convenient place for time in an almost non-relativistic universe - perhaps the DateStamp (with TZ, lt, or ut) should precede the LatLon as it is here this morning: 20090915.02PDT33nw117

Parse that before firing your ICBM. I propose that it's rather simple and almost complete.

JimPostel?, you guided us well... -- ChrisGarrod


-- HansWobbe


Related:


EditText of this page (last edited August 27, 2010) or FindPage with title or text search