Geoc (geocanvas) Reference Manual | ||||
---|---|---|---|---|
GeocProjectionGeocProjection — Povides conversion services between 'geo' coordinates and 'user' coordinates. |
GeocProjectionPrivate; GeocProjectionClassPrivate; GeocProjection; gboolean geoc_projection_g2w (GeocProjection *projection, double lon, double lat, double *wx, double *wy); gboolean geoc_projection_w2g (GeocProjection *projection, double wx, double wy, double *lon, double *lat); const GList* geoc_projection_get_available_projections (void);
"cylindrical" gboolean : Read "geoproj" gpointer : Read / Write "hemisphere" gboolean : Read "projstring" gchar* : Read / Write "reference" gpointer : Read / Write "reflat" gdouble : Read / Write "reflon" gdouble : Read / Write "rotation" gpointer : Read / Write "rotdeg" gdouble : Read / Write
The GeocProjection object is a GObject wrapper around the tkgeomap geography and geoProj native code. It provides conversion services between 'geo' and 'user' coordinates. For the most part, this object should be sufficient for doing basic coordinate conversion; however, for more complex operations the tkgeomap native code should be used.
Several components of the tkgeomap project have been included in this project, but they have not been documented here because they are well documented by the tkgeomap project. Man pages for these components are available at this project's homepage.
The below example uses GeocProjection to convert cursor position to longitude and latitude:
double ux, uy, lon, lat; ux = event->motion.x; uy = event->motion.y; cairo_matrix_transform_point(inverse_matrix, &ux, &uy); geo_projection_w2g(projection, ux, uy, &lon, &lat);
gboolean geoc_projection_g2w (GeocProjection *projection, double lon, double lat, double *wx, double *wy);
This procedure converts geographic coordinates to canvas world coordinates based on the current projection, reference, and rotation.
|
|
|
Geocgraphic longitude in degrees. |
|
Geocgraphic latitude in degrees. |
|
Canvas world coordinates returned. |
|
Canvas world coordinates returned. |
Returns : |
False if the geo point cannot be displayed by this projection. |
gboolean geoc_projection_w2g (GeocProjection *projection, double wx, double wy, double *lon, double *lat);
This procedure converts canvas world coordinates coordinates to geographic coordinates based on the current projection, reference, and rotation.
|
|
|
Canvas world coordinates returned. |
|
Canvas world coordinates returned. |
|
Geocgraphic longitude in degrees. |
|
Geocgraphic latitude in degrees. |
Returns : |
True only if there is a valid geoc-point for this world point. |
const GList* geoc_projection_get_available_projections (void);
This procedure returns a reference to the head of the linked list containing all of the available projection name strings. It can be used to fill the fields of a combo box.
Returns : |
GList containing the available projection name strings. |
"cylindrical"
property"cylindrical" gboolean : Read
Is this ia cylindrical projection.
Default value: TRUE
"hemisphere"
property"hemisphere" gboolean : Read
Is this a hemisphere projection.
Default value: TRUE
"projstring"
property"projstring" gchar* : Read / Write
Use this from a combo box.
Default value: "Mercator"
"reflat"
property"reflat" gdouble : Read / Write
Latitude of reference point.
Allowed values: [-90,90]
Default value: 0
"reflon"
property"reflon" gdouble : Read / Write
Longitude of reference point.
Allowed values: [-360,360]
Default value: 0
"rotdeg"
property"rotdeg" gdouble : Read / Write
Rotation in degrees.
Allowed values: [0,360]
Default value: 0