pe_generate_horizon

Returns the horizon for a projected coordinate system.

Usage syntax

PE_HORIZON pe_generate_horizon (PE_PROJCS projcs);

Parameters
projcs An existing projected coordinate system object
Description

Returns the horizon for a projected coordinate system. Each map projection has a certain limit. Many projections can map the entire world, but a few, like Transverse Mercator, are good for a limited area only. PE_HORFUNC has this structure.

 

typedef struct pe_horizon_t {
     int nump;
     int kind;
     int inclusive;
     int replicate;
     int size;
     double *coord[2];
} *PE_HORIZON;

The nump argument is the number of parts in the horizon, while kind describes the shape type. The kind values are:

 

PE_HORIZON_RECT
PE_HORIZON_POLY
PE_HORIZON_LINE
PE_HORIZON_POINT

Inclusive can have a value of 1 or 0. If 1, the horizon is inclusive. if 0, the horizon is exclusive. Horizons are returned in the units of the geographic coordinate system of the projected coordinate system. You can return one main horizon shape and tell a developer that he needs to shift the horizon by a full circle (if the geogcs units are degrees, the shift is 360 degrees) to catch other data with the replicate argument. The replicate values are:

 

enum replicate_enum {
     PE_HORIZON_REPLICATE_NONE,
     PE_HORIZON_REPLICATE_LEFT,
     PE_HORIZON_REPLICATE_RIGHT,
     PE_HORIZON_REPLICATE_BOTH};

Size is the number of coordinates in the part while coord is a pointer to the array of coordinate values.

Returns

On success, a pointer to an array of horizons. On failure, a null pointer.

Examples
 

PE_PROJCS pcs1 = pe_factory_projcs(PE_PCS_WGS_1984_UTM_11N);
PE_HORIZON *pcs_horz = pe_generate_horizon(pcs1);