41 double lat_cellsize_dd,
42 double lon_cellsize_dd,
61 if (ulc_lat_dd > 90.0 || ulc_lat_dd < -90.0)
63 if (lrc_lat_dd > 90.0 || lrc_lat_dd < -90.0)
65 if (ulc_lat_dd < lrc_lat_dd)
69 if (ulc_lon_dd > 180.0 || ulc_lon_dd < -180.0)
71 if (lrc_lon_dd > 180.0 || lrc_lon_dd < -180.0)
75 if (lat_cellsize_dd <= 0.0)
79 if (lon_cellsize_dd <= 0.0)
83 lat_extent_dd = ulc_lat_dd - lrc_lat_dd;
84 if (ulc_lon_dd > lrc_lon_dd) {
85 lon_extent_dd = 360 + lrc_lon_dd - ulc_lon_dd;
87 lon_extent_dd = lrc_lon_dd - ulc_lon_dd;
90 nline = (int) (lat_extent_dd / lat_cellsize_dd) + 1;
91 nsample = (int) (lon_extent_dd / lon_cellsize_dd) + 1;
106 if (ulc_lon_dd > lrc_lon_dd) {
107 for (l=0; l < nline; l++) {
108 for (s=0; s < nsample; s++) {
109 lat.
data.
d[l][s] = ulc_lat_dd - lat_cellsize_dd * l;
110 lontmp = ulc_lon_dd + lon_cellsize_dd * s;
111 lon.
data.
d[l][s] = lontmp > 180 ? lontmp - 360.0 : lontmp;
115 for (l=0; l < nline; l++) {
116 for (s=0; s < nsample; s++) {
117 lat.
data.
d[l][s] = ulc_lat_dd - lat_cellsize_dd * l;
118 lon.
data.
d[l][s] = ulc_lon_dd + lon_cellsize_dd * s;
MTKt_status MtkDataBufferAllocate(int nline, int nsample, MTKt_DataType datatype, MTKt_DataBuffer *databuf)
Allocate Data Buffer.
#define MTK_ERR_CODE_JUMP(code)
2-dimensional Data Buffer
#define MTKT_DATABUFFER_INIT
MTKt_status MtkDataBufferFree(MTKt_DataBuffer *databuf)
Free data buffer.
MTKt_status MtkCreateGeoGrid(double ulc_lat_dd, double ulc_lon_dd, double lrc_lat_dd, double lrc_lon_dd, double lat_cellsize_dd, double lon_cellsize_dd, MTKt_DataBuffer *latbuf, MTKt_DataBuffer *lonbuf)
Creates a regularly spaced geographic 2-D grid consisting of a latitude buffer and a longitude buffer...
#define MTK_ERR_COND_JUMP(code)