|
GLG Toolkit, C / C++ API Library
Version 4.6
|
This group contains functions that may be used for handling coordinate conversions and GIS queries when a GLG GIS Object is used to display a map inside the GLG drawing. More...
This group contains functions that may be used for handling coordinate conversions and GIS queries when a GLG GIS Object is used to display a map inside the GLG drawing.
Functions | |
| GlgBoolean | GlgGISConvert (GlgObject object, char *resource_name, GlgCoordType coord_type, GlgBoolean coord_to_lat_lon, GlgPoint *in_point, GlgPoint *out_point) |
| Performs coordinate conversion from the GIS coordinates of the GIS Object to the GLG coordinates of the drawing and visa versa. More... | |
| GlgObject | GlgGISCreateSelection (GlgObject object, char *resource_name, char *layers, GlgLong x, GlgLong y, GlgLong select_labels) |
| Returns a message object containing information about GIS features located at a specified position on the map. More... | |
| GlgObject | GlgGISGetDataset (GlgObject object, char *resource_name) |
| Returns a dataset object associated with the GIS Object. More... | |
| GlgBoolean | GlgGISGetElevation (GlgObject object, char *resource_name, char *layer_name, double lon, double lat, double *elevation) |
| Returns an elevation of a lat/lon point on a map. More... | |
| void | GlmConvert (GlgProjectionType projection, GlgBoolean stretch, GlgCoordType coord_type, GlgBoolean coord_to_lat_lon, GlgPoint *center, GlgPoint *extent, double angle, double min_x, double max_x, double min_y, double max_y, GlgPoint *in_point, GlgPoint *out_point) |
| A low level function that performs coordinate conversion from the GIS coordinates of a map to the GLG coordinates of the drawing and visa versa without the help of a GLG GIS Object. More... | |
| GlgBoolean GlgGISConvert | ( | GlgObject | object, |
| char * | resource_name, | ||
| GlgCoordType | coord_type, | ||
| GlgBoolean | coord_to_lat_lon, | ||
| GlgPoint * | in_point, | ||
| GlgPoint * | out_point | ||
| ) |
Performs coordinate conversion from the GIS coordinates of the GIS Object to the GLG coordinates of the drawing and visa versa.
| object |
|
| resource_name | If not NULL, specifies the resource path of the GIS Object inside the parent object specified by the object parameter. |
| coord_type | The type of the GLG coordinate system to convert to or from:
|
| coord_to_lat_lon |
|
| in_point | A pointer to the GlgPoint structure containing coordinate values to be converted. |
| out_point | A pointer to the GlgPoint structure that will receive converted coordinate values (x/y in the selected coordinate system or lon/lat) |
When converting from X/Y to lat/lon coordinates in the ORTHOGRAPHIC projection, the Z coordinate is set to a negative value for points on the invisible part of the globe or outside the globe area, and to zero for points on the edge of the globe. Coordinates of the returned point may be outside of the visible portion of the map for all projections.
This function performs coordinate conversion using the current settings of the GIS object, which must be setup and rendered.
The GlmConvert function may be used to perform coordinate conversion between GIS and GLG coordinates without the use of the GIS object, which could be done before the drawing is rendered, without a drawing at all, or without a GIS object being present.
| GlgObject GlgGISCreateSelection | ( | GlgObject | object, |
| char * | resource_name, | ||
| char * | layers, | ||
| GlgLong | x, | ||
| GlgLong | y, | ||
| GlgLong | select_labels | ||
| ) |
Returns a message object containing information about GIS features located at a specified position on the map.
This function provides a high-level interface to the map server's GlmGetSelection function and may be used to query GIS selection at the point selected by the mouse click.
| object |
|
| resource_name | If not NULL, specifies the resource path of the GIS Object inside the parent object specified by the object parameter. |
| layers | A list of layers to query. |
| x,y | Coordinates of a point in the screen coordinates of a viewport that contains the GIS object. |
| select_labels | Specifies the label selection mode, can have the following values (defined in the GlmLabelSelectionMode enum in the GlmApi.h file):
|
If the GIS verbosity level is set to 2000 or 2001, extended information is also written to the error log file and printed to the terminal on Linux/Unix for debugging purposes.
Refer to the GlmGetSelection section of the GLG Map Server Reference Manual for information on the structure of the returned message object as well as a programming example that demonstrates how to handle it.
Returns a dataset object associated with the GIS Object.
The function may be invoked after the GIS Object has been set up to retrieve its dataset. The dataset may be used to dynamically change attributes of individual layers displayed in the GIS Object. The program can use SetResourcefunctions for changing layer attributes. Refer to the GLG Map Server Reference Manual for information on layer attributes. The GLG GIS Demo provides an example of changing layer attributes programmatically.
| object |
|
| resource_name | If not NULL, specifies the resource path of the GIS Object inside the parent object specified by the object parameter. |
| GlgBoolean GlgGISGetElevation | ( | GlgObject | object, |
| char * | resource_name, | ||
| char * | layer_name, | ||
| double | lon, | ||
| double | lat, | ||
| double * | elevation | ||
| ) |
Returns an elevation of a lat/lon point on a map.
| object |
|
| resource_name | If not NULL, specifies the resource path of the GIS Object inside the parent object specified by the object parameter. |
| layer_name | The name of the layer with elevation data to query. |
| lon,lat | The lon/lat coordinates of a point on the map. |
| elevation | A pointer to the variable of a double type that will receive the returned elevation data. |
This function may be used to query elevation at the point selected by the mouse click.
The returned value is in the units (such as meters or feet) defined by the elevation data file.
| void GlmConvert | ( | GlgProjectionType | projection, |
| GlgBoolean | stretch, | ||
| GlgCoordType | coord_type, | ||
| GlgBoolean | coord_to_lat_lon, | ||
| GlgPoint * | center, | ||
| GlgPoint * | extent, | ||
| double | angle, | ||
| double | min_x, | ||
| double | max_x, | ||
| double | min_y, | ||
| double | max_y, | ||
| GlgPoint * | in_point, | ||
| GlgPoint * | out_point | ||
| ) |
A low level function that performs coordinate conversion from the GIS coordinates of a map to the GLG coordinates of the drawing and visa versa without the help of a GLG GIS Object.
Since the function does not rely on a GIS Object being displayed and set up, it may be used before the drawing is rendered, without a drawing at all, or without a GIS object being present.
When converting from X/Y to lat/lon coordinates in the ORTHOGRAPHIC projection, the Z coordinate is set to a negative value for points on the invisible part of the globe or outside the globe area, and to zero for points on the edge of the globe. Coordinates of the returned point may be outside of the visible portion of the map for all projections.
| projection | A GIS map projection: GLG_RECTANGULAR_PROJECTION or GLG_ORTHOGRAPHIC_PROJECTION. |
| stretch | Specifies if the map preserves the X/Y ratio (False) or not (True). |
| coord_type | The type of the GLG coordinate system to convert to or from:
|
| coord_to_lat_lon |
|
| center | A pointer to the GlgPoint structure containing lat/lon coordinates of the map center. The Z coordinate must be set to 0. |
| extent | A pointer to the GlgPoint structure containing X and Y extent of the map in the selected projection: in degrees for the RECTANGULAR projection or in meters for ORTHOGRAPHIC. The Z extent must be set to 0. Refer to the GIS Object section of the GLG User's Guide and Builder Reference Manual for more details. |
| angle | A map rotation angle in degrees. |
| min_x,max_x,min_y,max_y | A map extent in the selected coordinate system. To get X/Y coordinates relative to the map image origin, use min_x=0, min_y=0, max_x=image_width, max_y=image_height. |
| in_point | A pointer to the GlgPoint structure containing coordinate values to be converted (x/y in the selected coordinate system or lon/lat). |
| out_point | A pointer to the GlgPoint structure that will receive converted coordinate values (x/y in the selected coordinate system or lon/lat). |