c_mapedg - Calculates the minimum and maximum projection coordinates for a given geographic area

SYNTAX


#include "worgen.h"
#include "geompak.h"
FUNCTION c_mapedg (ul_long, lr_long, ul_lat, lr_lat, inunits, proj_code, zone, parout, units, pxmin, pxmax, pymin, pymax)

     double               *ul_long;
     double               *lr_long;
     double               *ul_lat;
     double               *lr_lat;
     long                 *inunits;
     long                 *proj_code;
     long                 *zone;
     double                parout[15];
     long                 *units;
     double               *pxmin;
     double               *pxmax;
     double               *pymin;
     double               *pymax;

PARAMETERS

ul_long (input, double)

The upper-left longitude coordinate in units of inunits

lr_long (input, double)

The lower-right longitude coordinate in units of inunits

ul_lat (input, double)

The upper-left latitude coordinate in units of inunits

lr_lat (input, double)

The lower-right latitude coordinate in units of inunits

inunits (input, long)

Projection transformation package unit code for value in ul_long lr_long, ul_lat, and lr_lat. Refer to c_projon() for a list of valid unit codes.

proj_code (input, long)

Defines the output projection system. Refer to c_projon() for a list of valid projection system codes.

zone (input, long)

Zone for UTM and State Plane projection systems. Refer to Table A for the coverage of UTM zones and state plane zone codes. For the Southern Hemisphere UTM, use a negative zone code.

parout (input, double, length (15))

Array of fifteen projection parameters. These parameters are required to define each map projection. See c_projon() for the definition of the fields for each projection.

units (input, long)

Unit code for the output projection system. Pxmin, pxmax, pymin, and pymax will be returned in these units. Refer to c_projon() for a list of valid unit codes.

pxmin (output, double)

Minimum projection coordinate in X.

pxmax (output, double)

Maximum projection coordinate in X.

pymin (output, double)

Minimum projection coordinate in Y.

pymax (output, double)

Maximum projection coordinate in Y.

DESCRIPTION

The c_mapedg() routine calculates the minimum and maximum projection coordinates which surround a rectangular geographic area (that is, rectangular in an input geographic space). This routine is used when an output image must contain all of a requested geographic area and the projection coordinates of the upper-left and lower-right output image area are not known. The minimum and maximum projection X and Y coordinates are returned. The calling routine may then frame an output image area using these minimums and maximums and the desired pixel size in X and in Y.

RETURN VALUE

c_mapedg() returns

     E_SUCC (0)  --> successful completion
     E_FAIL (-1) --> operation failed

SPECIAL CONSIDERATIONS:

The c_mapedg() call is for C only.

Table A: UTM Zone Codes, Locations and Central Meridians