⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdapi.c

📁 GIS系统支持库Geospatial Data Abstraction Library代码.GDAL is a translator library for raster geospatial dat
💻 C
📖 第 1 页 / 共 5 页
字号:
|  Return Value    Type     Units     Description                             ||  ============   ======  =========   =====================================   ||  status         intn                return status (0) SUCCEED, (-1) FAIL    ||                                                                             ||  INPUTS:                                                                    ||  gridID         int32               grid structure ID                       ||  tilecode       int32               tile code                               ||  tilerank       int32               number of tiling dimensions             ||  tiledims       int32               tiling dimensions                       ||                                                                             ||  OUTPUTS:                                                                   ||             None                                                            ||                                                                             ||  NOTES:                                                                     ||                                                                             ||                                                                             ||   Date     Programmer   Description                                         ||  ======   ============  =================================================   ||  Jan 97   Joel Gales    Original Programmer                                 ||                                                                             ||  END_PROLOG                                                                 |-----------------------------------------------------------------------------*/intnGDdeftile(int32 gridID, int32 tilecode, int32 tilerank, int32 tiledims[]){    intn            i;		/* Loop index */    intn            status = 0;	/* routine return status variable */    int32           fid;	/* HDF-EOS file id */    int32           sdInterfaceID;	/* HDF SDS interface ID */    int32           gdVgrpID;	/* Grid root Vgroup ID */    int32           idOffset = GDIDOFFSET;	/* Grid ID offset */    int32           gID;	/* gridID - offset */    /* Check for valid grid id */    /* ----------------------- */    status = GDchkgdid(gridID, "GDdeftile", &fid, &sdInterfaceID, &gdVgrpID);    if (status == 0)    {	gID = gridID % idOffset;	for (i = 0; i < 8; i++)	{	    GDXGrid[gID].tiledims[i] = 0;	}	GDXGrid[gID].tilecode = tilecode;	switch (tilecode)	{	case HDFE_NOTILE:	    GDXGrid[gID].tilerank = 0;	    break;	case HDFE_TILE:	    GDXGrid[gID].tilerank = tilerank;	    for (i = 0; i < tilerank; i++)	    {		GDXGrid[gID].tiledims[i] = tiledims[i];		if (GDXGrid[gID].tiledims[i] == 0)		{		    GDXGrid[gID].tiledims[i] = 1;		}	    }	    break;	}    }    return (status);}/*----------------------------------------------------------------------------||  BEGIN_PROLOG                                                               ||                                                                             ||  FUNCTION: GDdeftle                                                         ||                                                                             ||  DESCRIPTION: FORTRAN wrapper around GDdetfile                              ||                                                                             ||                                                                             ||  Return Value    Type     Units     Description                             ||  ============   ======  =========   =====================================   ||  status         intn                return status (0) SUCCEED, (-1) FAIL    ||                                                                             ||  INPUTS:                                                                    ||  gridID         int32               grid structure ID                       ||  tilecode       int32               tile code                               ||  tilerank       int32               number of tiling dimensions             ||  forttiledims   int32               tiling dimensions (FORTRAN order)       ||                                                                             ||  OUTPUTS:                                                                   ||             None                                                            ||                                                                             ||  NOTES:                                                                     ||                                                                             ||                                                                             ||   Date     Programmer   Description                                         ||  ======   ============  =================================================   ||  Mar 97   Joel Gales    Original Programmer                                 ||                                                                             ||  END_PROLOG                                                                 |-----------------------------------------------------------------------------*/intnGDdeftle(int32 gridID, int32 tilecode, int32 tilerank, int32 forttiledims[]){    intn            j, status;    int32           dims[8];    /* Reverse order of dimensions (FORTRAN -> C) */    /* ------------------------------------------ */    for (j = 0; j < tilerank; j++)    {	dims[j] = forttiledims[tilerank - 1 - j];;    }    /* Call GDdeftile routine to define tile */    /* ------------------------------------- */    status = GDdeftile(gridID, tilecode, tilerank, dims);    return (status);}/*----------------------------------------------------------------------------||  BEGIN_PROLOG                                                               ||                                                                             ||  FUNCTION: GDdeforigin                                                      ||                                                                             ||  DESCRIPTION: Defines the origin of the grid data.                          ||                                                                             ||                                                                             ||  Return Value    Type     Units     Description                             ||  ============   ======  =========   =====================================   ||  status         intn                return status (0) SUCCEED, (-1) FAIL    ||                                                                             ||  INPUTS:                                                                    ||  gridID         int32               grid structure ID                       ||  origincode     int32               origin code                             ||                                     HDFE_GD_UL (0)                          ||                                     HDFE_GD_UR (1)                          ||			              HDFE_GD_LL (2)                          ||                                     HDFE_GD_LR (3)                          ||                                                                             ||                                                                             ||  OUTPUTS:                                                                   ||             None                                                            ||                                                                             ||  NOTES:                                                                     ||                                                                             ||                                                                             ||   Date     Programmer   Description                                         ||  ======   ============  =================================================   ||  Jun 96   Joel Gales    Original Programmer                                 ||                                                                             ||  END_PROLOG                                                                 |-----------------------------------------------------------------------------*/intnGDdeforigin(int32 gridID, int32 origincode){    /*     * intn            status = 0;     *      * int32           fid, gdkey; int32           sdInterfaceID, idOffset =     * GDIDOFFSET;     *      * char            utlbuf[64]; char            gridname[80];     */    intn            status = 0;	/* routine return status variable */    int32           fid;	/* HDF-EOS file ID */    int32           gdVgrpID;	/* Grid root Vgroup ID */    int32           sdInterfaceID;	/* HDF SDS interface ID */    int32           idOffset = GDIDOFFSET;	/* Grid ID offset */    char            utlbuf[64];	/* Utility buffer */    char            gridname[80];	/* Grid name */    char           *originNames[] = {"HDFE_GD_UL", "HDFE_GD_UR",    "HDFE_GD_LL", "HDFE_GD_LR"};    /* Origin Codes */    /* Check for valid grid id */    status = GDchkgdid(gridID, "GDdeforigin",		       &fid, &sdInterfaceID, &gdVgrpID);    if (status == 0)    {	/* If proper origin code then write to structural metadata */	/* ------------------------------------------------------- */	if (origincode >= 0 && origincode <= 3)	{	    sprintf(utlbuf, "%s%s%s",		    "\t\tGridOrigin=", originNames[origincode], "\n");	    Vgetname(GDXGrid[gridID % idOffset].IDTable, gridname);	    status = EHinsertmeta(sdInterfaceID, gridname, "g", 101L,				  utlbuf, NULL);	}	else	{	    status = -1;	    HEpush(DFE_GENAPP, "GDdeforigin", __FILE__, __LINE__);	    HEreport("Improper Grid Origin code: %d\n", origincode);	}    }    return (status);}/*----------------------------------------------------------------------------||  BEGIN_PROLOG                                                               ||                                                                             ||  FUNCTION: GDdefpixreg                                                      ||                                                                             ||  DESCRIPTION: Defines pixel registration within grid cell.                  ||                                                                             ||                                                                             ||  Return Value    Type     Units     Description                             ||  ============   ======  =========   =====================================   ||  status         intn                return status (0) SUCCEED, (-1) FAIL    ||                                                                             ||  INPUTS:                                                                    ||  gridID         int32               grid structure ID                       ||  pixregcode     int32               Pixel registration code                 ||                                     HDFE_CENTER (0)                         ||                                     HDFE_CORNER (1)                         ||                                                                             ||                                                                             ||  OUTPUTS:                                                                   ||             None                                                            ||                                                                             ||  NOTES:                                                                     ||                                                                             ||                                                                             ||   Date     Programmer   Description                                         ||  ======   ============  =================================================   ||  Jun 96   Joel Gales    Original Programmer                                 ||                                                                             ||  END_PROLOG                                                                 |-----------------------------------------------------------------------------*/intnGDdefpixreg(int32 gridID, int32 pixregcode){    intn            status = 0;	/* routine return status variable */    int32           fid;	/* HDF-EOS file ID */    int32           gdVgrpID;	/* Grid root Vgroup ID */    int32           sdInterfaceID;	/* HDF SDS interface ID */    int32           idOffset = GDIDOFFSET;	/* Grid ID offset */    char            utlbuf[64];	/* Utility buffer */    char            gridname[80];	/* Grid name */    char           *pixregNames[] = {"HDFE_CENTER", "HDFE_CORNER"};    /* Pixel Registration Codes */    /* Check for valid grid id */    status = GDchkgdid(gridID, "GDdefpixreg",		       &fid, &sdInterfaceID, &gdVgrpID);    if (status == 0)    {	/* If proper pix reg code then write to structural metadata */	/* -------------------------------------------------------- */	if (pixregcode >= 0 && pixregcode <= 1)	{	    sprintf(utlbuf, "%s%s%s",		    "\t\tPixelRegistration=", pixregNames[pixregcode], "\n");	    Vgetname(GDXGrid[gridID % idOffset].IDTable, gridname);	    status = EHinsertmeta(sdInterfaceID, gridname, "g", 101L,				  utlbuf, NULL);	}	else	{	    status = -1;	    HEpush(DFE_GENAPP, "GDdefpixreg", __FILE__, __LINE__);	    HEreport("Improper Pixel Registration code: %d\n", pixregcode);	}    }    return (status);}/*----------------------------------------------------------------------------||  BEGIN_PROLOG                                                               ||                                                                             ||  FUNCTION: GDdiminfo                                                        ||                                                                             ||  DESCRIPTION: Retrieve size of specified dimension.                         ||                                                                             ||                                                                             ||  Return Value    Type     Units     Description                             ||  ============   ======  =========   =====================================   ||  size           int32               Size of dimension                       ||                                                                             ||  INPUTS:                                                                    ||  gridID         int32        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -