|
GLG Toolkit, Java Class Library
Version 4.6
|
This group contains methods 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 methods 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 | |
| boolean | GISConvert (String resource_name, GlgCoordType coord_type, boolean 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 | GISCreateSelection (String resource_name, String layers, double x, double y, GlmLabelSelectionMode select_labels) |
| Returns a message object containing information about GIS features located at a specified position on the map. More... | |
| GlgDouble | GISGetElevation (String resource_name, String layer_name, double lon, double lat) |
| Returns an elevation of a lat/lon point on a map. More... | |
| static void | GlmConvert (GlgProjectionType projection, boolean stretch, GlgCoordType coord_type, boolean 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 method 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... | |
| boolean GISConvert | ( | String | resource_name, |
| GlgCoordType | coord_type, | ||
| boolean | 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.
| resource_name | The resource path of a child GIS object whose coordinate system to use for conversion, or null to use the GIS object the method is invoked on. The resource path is relative to the invoking object. |
| coord_type | The type of the GLG coordinate system to convert to or from:
|
| coord_to_lat_lon |
|
| in_point | GlgPoint containing input values (x/y in the selected coordinate system or lon/lat). |
| out_point | GlgPoint that will receive converted output 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 method performs coordinate conversion using the current settings of the GIS object, which must be set up and rendered.
The GlmConvert method 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 GISCreateSelection | ( | String | resource_name, |
| String | layers, | ||
| double | x, | ||
| double | y, | ||
| GlmLabelSelectionMode | select_labels | ||
| ) |
Returns a message object containing information about GIS features located at a specified position on the map.
This method 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.
| resource_name | The resource path of a child GIS object to query or null to query the GIS object the method is invoked on. |
| 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:
|
A message object containing information about the selected GIS features.
Refer to the GlmGetSelection section of the GLG Map Server Reference Manual for information on the structure of the returned message object.
| GlgDouble GISGetElevation | ( | String | resource_name, |
| String | layer_name, | ||
| double | lon, | ||
| double | lat | ||
| ) |
Returns an elevation of a lat/lon point on a map.
This method 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.
| resource_name | The resource path of a child GIS object to query or null to query the GIS object the method is invoked on. |
| layer_name | The name of the layer with elevation data to query. |
| lon,lat | The lon/lat coordinates of a point on the map. |
|
static |
A low level method 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 method 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: RECTANGULAR_PROJECTION or 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 | GlgPoint containing lat/lon coordinates of the map center. The Z coordinate must be set to 0. |
| extent | GlgPoint 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 on 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 | GlgPoint containing coordinate values to be converted (x/y in the selected coordinate system or lon/lat). |
| out_point | GlgPoint that will receive converted coordinate values (x/y in the selected coordinate system or lon/lat). |