1 #include "csf.h"
2 #include "csfimpl.h"
3 
4 /* change projection type of map
5  * MputProjection type changes the projection type of a map.
6  * In version 2, projections are simplified. We only discern between
7  * a projection with y increasing (PT_YINCT2B=0) and decreasing (PT_YDECT2B=1)
8  * from top to bottom.
9  * All old constants that denote a projection with y decreasing are nonzero.
10  * And the old constant that denote a projection with y decreasing (PT_XY) is 0.
11  * returns the new projection (PT_YINCT2B or PT_YDECT2B) or MV_UINT2 if an
MgetProjection(const MAP * map)12  * error occurred.
13  *
14  * Merrno
15  * NOACCESS
16  */
17 CSF_PT MputProjection(
18 	MAP *map,      /* map handle */
19 	CSF_PT p)       /* projection type, all nonzero values are mapped to
20 	                * 1 (PT_YDECT2B)
21 	                */
22 {
23 	CHECKHANDLE_GOTO(map, error);
24 	if(! WRITE_ENABLE(map))
25 	{
26 		M_ERROR(NOACCESS);
27 		goto error;
28 	}
29 	map->main.projection =  (p) ? PT_YDECT2B : PT_YINCT2B;
30 	return map->main.projection;
31 error:	return(MV_UINT2);
32 }
33