DragonFly On-Line Manual Pages
geoProj(3) Geography C functions geoProj(3)
See the file man.macros.
NAME
GeoProj, GeoProjAlloc, GeoProjInit, GeoProjFree, GeoProjDestroy,
GeoProjGetInfo, GeoProjGetType, GeoProjDescriptor, ProjToLatLon,
LatLonToProj, SetCylEqDist, SetCylEqArea, SetMercator,
SetLambertConfConic, SetLambertEqArea, SetStereographic,
SetOrthographic, GeoProjSetRotation - apply cartographic projections to
geographic and map coordinates.
SYNOPSIS
#include <geoProj.h>
GeoProj GeoProjAlloc(void);
void GeoProjInit(GeoProj proj);
void GeoProjFree(GeoProj proj);
void GeoProjDestroy(GeoProj proj);
GeoProjInfo GeoProjGetInfo(GeoProj proj);
enum ProjType GeoProjGetType(GeoProj proj);
char * GeoProjDescriptor(GeoProj proj);
GeoPt ProjToLatLon(MapPt mapPt, GeoProj proj);
MapPt LatLonToProj(GeoPt geoPt, GeoProj proj);
void SetCylEqDist(GeoProj proj, Angle refLat, Angle refLon);
void SetCylEqArea(GeoProj proj, Angle refLon);
void SetMercator(GeoProj proj, Angle refLon);
void SetLambertConfConic(GeoProj proj, Angle refLat, Angle refLon);
void SetLambertEqArea(GeoProj proj, GeoPt refPt);
void SetStereographic(GeoProj proj, GeoPt refPt);
void SetOrthographic(GeoProj proj, GeoPt refPt);
void GeoProjSetRotation(GeoProj proj, Angle angle);
DESCRIPTION
These functions convert geographic points to and from projection
coordinates. Projection information is stored in objects of type
GeoProj.
GeoProjAlloc creates a new projection. It returns the projection
or NULL on failure. When no longer needed, the projection
should be destroyed with a call to GeoProjDestroy.
GeoProjInit initializes internal members of new projection proj.
It assumes the previous contents of proj are garbage.
Initializing a GeoProj object may involve memory allocations,
which should eventually be freed with a call to GeoProjFree.
GeoProjFree frees internal memory associated with proj that was
allocated during a call to GeoProjInit. proj remains allocated.
GeoProjDestroy frees all memory associated with proj, during a
call to GeoProjAlloc, and it frees proj.
GeoProjGetInfo returns a GeoProjInfo structure for proj.
GeoProjInfo structures store publicly visible members of a
GeoProj object. The GeoProjInfo structure is declared as
follows: typedef struct GeoProjInfo {
enum ProjType type;
union {
Angle rLon;
GeoPt refPt;
} prm; } GeoProjInfo; where type is the projection type, rLon
is a reference longitude in microdegrees, and refPt is a
reference point. The projection type determines which union
member applies.
The currently defined types are:
enum ProjType {
CylEqDist, CylEqArea, Mercator, LambertConfConic,
Stereographic, Orthographic };
GeoProjGetType returns the type of proj.
GeoProjDescriptor returns the descriptor from proj. The returned
value should not be modified by the user.
ProjToLatLon returns the geographic point corresponding to mapPt
in projection proj. Returns GeoPtNowhere() if mapPt cannot be
transformed by proj. See the geography (3) man page for more
information on MapPt objects.
LatLonToProj returns the map point corresponding to geoPt
in projection proj. Returns MapPtNowhere() if geoPt cannot be
transformed by proj.
SetCylEqDist sets proj to Cylindrical Equidistant projection
referenced to refLat and refLon. proj should have been already
allocated. Upon return proj will have a descriptor of form
"CylEqDist with reference point {refLat refLon} global."
SetCylEqArea sets proj to Cylindrical Equal Area projection
referenced to refLon. proj should have been already allocated.
Upon return proj will have a descriptor of form "CylEqArea with
reference longitude refLon global."
SetMercator sets proj to Mercator projection referenced to
refLon. proj should have been already allocated. Upon return
proj will have a descriptor of form "Mercator with reference
longitude refLon global."
SetLambertConfConic sets proj to Lambert Conformal Conic projection
referenced to refLat and refLon. proj should have been already
allocated. Upon return proj will have a descriptor of form
"LambertConfConic reference point {refLat refLon} global."
SetLambertEqArea sets proj to Lambert Azimuthal Equal Area
projection referenced to refPt. proj should have been already
allocated. Upon return proj will have a descriptor of form
"LambertEqArea with reference point refPt hemispheric."
SetStereographic sets proj to Stereographic projection referenced
to refPt. proj should have been already allocated. Upon return
proj will have a descriptor of form "Stereographic with
reference point refPt hemispheric."
SetOrthographic sets proj to Orthographic projection referenced
to refPt. proj should have been already allocated. Upon return
proj will have a descriptor of form "Orthographic with reference
point refPt hemispheric."
GeoProjSetRotation sets the projection rotation to angle. This
is the orientation of the map surface onto which the Earth's
surface is projected. The angle is clockwise from the unrotated
projection.
KEYWORDS
geography, projections
SEE ALSO
geography
AUTHOR
Gordon Carrie (user0@tkgeomap.org)
Geography 2 geoProj(3)