#include "grid.h"
FUNCTION c_geo2ls (ullat, ullon, pdistx, pdisty, pixlat, pixlon, pixline, pixsamp)
double *ullat; double *ullon; double *pdistx; double *pdisty; double *pixlat; double *pixlon; long *pixline; long *pixsamp;
Latitude of a known pixel within an image (degrees).
Longitude of a known pixel within an image (degrees).
Pixel distance in the X direction or pixel width (degrees).
Pixel distance in the Y direction or pixel height (degrees).
Latitude of the point of interest (degrees).
Longitude of the point of interest (degrees).
The number of lines between the known pixel and the point of interest. As an example, if the line number of the known pixel is 100, the line number of the point of interest is 100 + pixline.
The number of samples between the known pixel and the point of interest. As an example, if the sample number of the known pixel is 63, the sample number of the point of interest is 63 + pixsamp.
Given the latitude and longitude of a known pixel within an image, the size of the pixels within the image, and the latitude and longitude of a desired pixel, return the line and sample offset for the desired pixel from the known pixel.
The image can be visualized as a cylinder wrapped around the globe, centered at the equator. The top and bottom of the cylinder are at 90 degrees north and 90 degrees south. If you were to cut the cylinder through the longitude of the known pixel and unroll it, the known point would lie along the left edge of the projection. Therefore, a positive sample offset will always be returned while the line offset may be positive or negative.
The line offset is computed by subtracting the latitude of the known pixel from the latitude of the desired pixel and dividing by the height of the pixels. Likewise, the sample offset is computed by subtracting the longitude of the known pixel from the longitude of the desired pixel and dividing by the width of the pixels.
c_geo2ls() returns
E_SUCC --> Successful completion. E_FAIL --> Operation failed.