KJB
|
integer-valued, latitude-style and longitude-style coordinates More...
#include <nedgrid.h>
Public Member Functions | |
double | dd_latitude () const |
latitude, in "decimal" degrees More... | |
double | dd_longitude () const |
longitude, in "decimal" degrees; negative values within the USA. More... | |
Static Public Member Functions | |
static IntegralLL | from_lat_lon (double, double) |
named-ctor builds fr. floating-point decimal degrees, rounding to southeast More... | |
static IntegralLL | from_lat_lon (int, int) |
named-ctor builds from whole integer degrees, very coarse (miles away) More... | |
Public Attributes | |
int | ilat |
latitude, in one-third-arcsecond units (north=+) More... | |
int | ilon |
longitude, in 1/3rd-arcsecond units (west = neg) More... | |
integer-valued, latitude-style and longitude-style coordinates
This class defines the geographic location of grid points in the NED-13 data. The two fields, which are public integers, correspond to latitude and longitude. A single unit corresponds to one-third of an arcsecond of distance, and in the USA that corresponds to something like 8 meters east distance per unit increment in longitude (ilon), and 10 meters north distance per unit increment in latitude (ilat). You can get more exact estimates for these values using the functions delta_e_meters() and delta_n_meters().
The reason this class is available is so that the user can traverse the NED grid, by instantiating this class and manually adjusting the ilat and ilon fields. You can convert these grid values to UTM coordinates using function ned13_ill_to_utm(). You can also convert these grid values to floating-point latitude and longitude using member methods dd_latitude() and dd_longitude(). The latter two methods are less computationally burdensome (a few floating point arithmetic ops) than conversion to UTM (which requires projecting a point onto the GRS-1980 ellipsoid).
If you have a UTM coordinate, which are ideally continuous, and you want to know where it lies in a NED grid, you can get its nearest neighbor to the southeast via utm_to_se_ned13_ill(). In other words, the grid point should be quantized from your UTM coordinate with the smallest possible nonnegative* deviations to the east and south. (I believe the above definition is unambiguous, at least in the USA.) The above star next to "nonnegative" means I have to add that, for reasons unknown but probably just numerical noise, the UTM-to-LL conversion is not 100% reliably quantized to the southeast. Sometimes it goes north or west by a few centimeters. It is better to work with UTM representations as much as possible.
This class is copyable, assignable, and comparable (with operator==) with no problem, like most tiny concrete classes. It won't work with a 16-bit int, but who uses them anymore?
double kjb::Ned13_one_degree_grid::IntegralLL::dd_latitude | ( | ) | const |
latitude, in "decimal" degrees
double kjb::Ned13_one_degree_grid::IntegralLL::dd_longitude | ( | ) | const |
longitude, in "decimal" degrees; negative values within the USA.
|
static |
named-ctor builds fr. floating-point decimal degrees, rounding to southeast
|
static |
named-ctor builds from whole integer degrees, very coarse (miles away)
int kjb::Ned13_one_degree_grid::IntegralLL::ilat |
latitude, in one-third-arcsecond units (north=+)
int kjb::Ned13_one_degree_grid::IntegralLL::ilon |
longitude, in 1/3rd-arcsecond units (west = neg)