Example #1
0
void wgem_gqmprj( char *proj, float *angl1, float *angl2, float *angl3,
                  float *dlatll, float *dlonll, float *dlatur,
                  float *dlonur, int *iret )
/************************************************************************
 * wgem_gqmprj								*
 *									*
 * This function is a wrapper for gqmprj.				*
 *									*
 * void wgem_gqmprj ( proj, angl1, angl2, angl3, dlatll, dlonll, 	*
 *		      dlatur, dlonur, iret )				*
 *									*
 * Input parameters:							*
 *	*proj		char	projection string			*
 *	*angl1		float	angle 1					*
 *	*angl2		float	angle 2					*
 *	*angl3		float 	angle 3					*
 *	*dlatll		float	lat, lower left corner			*
 *	*dlonll		float	lon, lower left corner			*
 *	*dlatur		float	lat, upper right corner			*
 *	*dlonur		float	lon, upper right corner			*
 *									*
 * Output parameters:							*
 *	*iret		int	return code				*
 **									*
 * Log:									*
 * E. Safford/SAIC	11/07	initial coding                          *
 ***********************************************************************/
{
    gqmprj( proj, angl1, angl2, angl3, dlatll, dlonll, dlatur, dlonur,
            iret, sizeof( proj ) );
}
Example #2
0
void savemapping ( PixmapObjectType *po )
{

	MapProjType	*map;
	SatProjType	*sat;
	ReferencePts	*ref;

	int		i, iret;
	float		x, y;
	float		lat, lon;
	char		Dcoords [] = "D";


	if ( ! po ) return;

/*
 *	Assume that this is a map projection.
 */	
	map = &(po->mapProjection);
	
	gqmprj ( po->proj, &(map->angle1), &(map->angle2),
		 &(map->angle3), &(map->latll), &(map->lonll),
		 &(map->latur), &(map->lonur),
		 &iret, sizeof (po->proj) );
		 	
/*
 *	Check for Sat projection
 */
	if ( iret != 0 ) {
	
	    sat = &(po->satProjection);
	    
	    gqsatn ( po->proj, sat->imgnam, &iret,
	    	sizeof (po->proj), sizeof (sat->imgnam));

/*
 *	    Bail out if not a sat projection either
 */
	    if ( iret != 0 ) {
	        memset ( po->proj, 0, sizeof( po->proj ));
	        return ;
	    }

	    gqsatm ( po->proj, sat->area, sat->nav, &(sat->ilef),
	    	 &(sat->itop), &(sat->irit), &(sat->ibot),
	    	 &iret, sizeof (po->proj) );
	    for ( i = 0; i < sizeof (sat->imgnam); i++ )
		if ( sat->imgnam [i] == ' ' ) sat->imgnam [i] = '\0';
	}

/*
 *	Replace spaces in the proj string with NULL's
 */	
	for ( i = 0; i < sizeof (po->proj); i++ )
	    if ( po->proj [i] == ' ' ) po->proj [i] = '\0';

/*
 *	Get the lat/lon of 2 reference points and save them. This is
 *	used to see if the mapping has changed between pixmps. Reference
 *	point 1 is 1/2 way down and 1/3 into the window (from the left),
 *	point 2 is also 1/2 way down, and 2/3 into the display.
 */
	ref = &(po->referenceLatLons);

	x = (float) po->width / 3.;
	y = (float) po->height / 2.;

	getlatlon ( Dcoords, &x, &y, &lat, &lon );

	ref->x1 = x;
	ref->y1 = y;
	ref->lat1 = lat;
	ref->lon1 = lon;

	x *= 2;

	getlatlon ( Dcoords, &x, &y, &lat, &lon );

	ref->x2 = x;
	ref->y2 = y;
	ref->lat2 = lat;
	ref->lon2 = lon;

}