rdup2.c

来自「支持各种栅格图像和矢量图像读取的库」· C语言 代码 · 共 53 行

C
53
字号
/* * rdup2.c  */#include "csf.h"#include "csfimpl.h"/* create a new map by cloning another one * Rdup creates a new empty map from the specifications of another map. * No cell values are copied. It uses a call to Rcreate to create the * map. See Rcreate for legal values of the args cellRepr and valueScale. * returns the map handle of the newly created map or NULL in case of an * error * * Merrno * NOT_RASTER plus the Merrno codes of Rcreate * * EXAMPLE * .so examples/dupbool.tr */MAP  *Rdup(	const char *toFile, /* file name of map to be created */	const MAP *from,    /* map to clone from */	CSF_CR cellRepr,     /* cell representation of new map  */	CSF_VS dataType)   /* datatype/valuescale of new map  */{	MAP *newMap = NULL; /* set NULL for goto error */	CHECKHANDLE_GOTO(from, error);	/* check if mapType is T_RASTER */	if (from->main.mapType != T_RASTER)	{		M_ERROR(NOT_RASTER);		goto error;	}	newMap = Rcreate(toFile,	            (size_t)from->raster.nrRows,			 (size_t)from->raster.nrCols,        		 cellRepr,         		 dataType,         		 from->main.projection,         		 from->raster.xUL,        		 from->raster.yUL,        		 from->raster.angle,        		 from->raster.cellSize);error:	return newMap ;}

⌨️ 快捷键说明

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