Exemple #1
0
/* get cell size 
 * returns the cell size or -1 in case of an error
 *
 * Merrno
 *  ILL_CELLSIZE
 *  ILLHANDLE
 */
REAL8 RgetCellSize(
	const MAP *map) /* map handle */
{
	CHECKHANDLE(map);
	if ( map->raster.cellSize != map->raster.cellSizeDupl)
	{
		M_ERROR(ILL_CELLSIZE);
		return -1;
	}

	return(map->raster.cellSize);
}
Exemple #2
0
void RputMinVal(
	MAP *map, /* map handle */
	const void *minVal)   /* New minimum value */
{
	/* use buffer that can hold largest 
	 * cell representation
	 */
	CSF_VAR_TYPE buf_1;
	void *buf = (void *)(&buf_1);

	CHECKHANDLE(map);

	/* make a copy */
	CsfGetVarType(buf, minVal, map->appCR);

	/* convert */
	map->app2file(1, buf);

	/* set */
	CsfGetVarType( (void *)&(map->raster.minVal), buf, RgetCellRepr(map));

	map->minMaxStatus = MM_DONTKEEPTRACK;
}
Exemple #3
0
int hclose(int h) {
    CHECKHANDLE(h, -1);
    /* If there are multiple duplicates of this handle just remove one
       reference. */
    if(hndl->refcount > 1) {
        --hndl->refcount;
        return 0;
    }
    /* This will guarantee that blocking functions cannot be called anywhere
       inside the context of the close. */
    int was_stopping = dill_running->stopping;
    dill_running->stopping = 1;
    /* Send stop signal to the handle. */
    dill_assert(hndl->vfptrs.close);
    hndl->vfptrs.close(h);
    dill_running->stopping = was_stopping;
    /* Better be paraniod and delete the function pointer here. */
    hndl->vfptrs.close = NULL;
    /* Return the handle to the shared pool. */
    hndl->next = dill_unused;
    dill_unused = h;
    return 0;
}
Exemple #4
0
/* y value, upper left co-ordinate of map
 * RgetYUL returns the y value of the upper left co-ordinate of map.
 * Whether this is the largest or smallest y value depends on the
 * projection (See MgetProjection()).
 * returns the y value, upper left co-ordinate of map
 */
REAL8 RgetYUL(
	const MAP *map) /* map handle */
{
	CHECKHANDLE(map);
	return(map->raster.yUL);
}
Exemple #5
0
void *hdata(int h, const void *type) {
    CHECKHANDLE(h, NULL);
    if(dill_slow(type && hndl->type != type)) {errno = ENOTSUP; return NULL;}
    return hndl->data;
}
Exemple #6
0
int hdup(int h) {
    CHECKHANDLE(h, -1);
    ++hndl->refcount;
    return h;
}
Exemple #7
0
/* get CSF version
 * returns CSF version
 */
UINT4 MgetVersion(
 const MAP *map) /* map handle */
{
	CHECKHANDLE(map);
	return (UINT4) (map->main.version);
}
Exemple #8
0
/* gis file id
 * returns
 * the "gis file id" field
 */
UINT4 MgetGisFileId(
	const MAP *map) /* map handle */
{
	CHECKHANDLE(map);
	return(map->main.gisFileId);
}