49 int pathlist_tmp[
NPATH];
56 double lat_hextent_deg;
57 double lon_hextent_deg;
62 double blocklat = 0.0;
63 double blocklon = 0.0;
64 double deg_per_meter = 360.0 / 40007821.0;
66 if (pathcnt == NULL || pathlist == NULL)
82 for (path = 1; path <=
NPATH; path++) {
96 lat_hextent_deg = (region.
hextent.
xlat * deg_per_meter);
97 lon_hextent_deg = (region.
hextent.
ylon * deg_per_meter);
98 ulclat = region.
geo.
ctr.
lat - lat_hextent_deg;
99 ulclon = region.
geo.
ctr.
lon - lon_hextent_deg;
100 lrclat = region.
geo.
ctr.
lat + lat_hextent_deg;
101 lrclon = region.
geo.
ctr.
lon + lon_hextent_deg;
115 for (b = 1; b <=
NBLOCK; b++) {
116 for (i = 0; i < 4; i++) {
118 &blocklat, &blocklon);
119 if (blocklat >= ulclat && blocklat <= lrclat && blocklon >= ulclon && blocklon <= lrclon) {
133 pathlist_tmp[cnt++] = path;
140 list = (
int *)malloc(cnt *
sizeof(
int));
144 for (path = 0; path < cnt; path++) {
145 list[path] = pathlist_tmp[path];
MTKt_status MtkBlsToLatLon(int path, int resolution_meters, int block, float line, float sample, double *lat_dd, double *lon_dd)
Convert from Block, Line, Sample, to Latitude and Longitude in decimal degrees.
MTKt_status MtkLatLonToBls(int path, int resolution_meters, double lat_dd, double lon_dd, int *block, float *line, float *sample)
Convert decimal degrees latitude and longitude to block, line, sample.
#define MTK_ERR_CODE_JUMP(code)
MTKt_status MtkRegionToPathList(MTKt_Region region, int *pathcnt, int **pathlist)
Get list of paths that cover a particular region.