The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Using TGeoMap


Principal Function of TGeoMap

TGeoMap is a component providing support for displaying calibrated scanned maps. It combines the graphical display of scanned images with the logic of calibrating the corresponding graticule. In addition, TGeoMap supports displaying and managing landmarks. The map image may be panned by dragging it with the mouse.

Each map consists of two files: the image of the map (in BMP or JPG format), and its calibration data. The calibration data contains all the information concerning the graticule and is stored as an XML file. It also contains a pointer to the corresponding map image, so that TGeoMap can load the corresponding image when loading the calibration data.

Please note that the use of TGeoMap is not only restricted to geographic maps. Due to its general calibration approach it can be used for any other application which requires a calibrated image (e.g. spectra, scanned medical images, sensitive maps, etc.)

First steps

In order to utilize TGeoMap, you first have to put an empty TGeoMap on the form. The map to be used has to be read in during run-time using the methods LoadCalDataFromXML or ReadCalDataFromOpenXMLFile. As already mentioned, the calibration data contains the file name of the corresponding map image. In order to cope with situations where the map image has to be read from a location other than the one specified in the calibration data, the event OnMapImageRequest can be used to provide the correct file path of the map. If the map is loaded successfully, it is displayed on the TGeoMap canvas and the user can work with it.

Hint: If a map does not contain sufficient calibration data, many features are not available or are functioning improperly. Thus it is important to have a correctly calibrated map. If you are starting from scratch you may wish to use the sample application "SimpleGeomap" in order to create a graticule.

You may put landmarks on the map by using the method AddLandMark. Landmarks may be grouped controlling their visibility groupwise by setting the array property LMClassVisible. Please note that the visibility of landmarks can only be set on a group basis, while the other properties (position, type and color) can be set individually by specifying the properties when adding a landmark. In order to remove a landmark you may use the methods RemoveLandmark or RemoveAllLandmarks. Landmark data may be accessed directly by using the array property LandmarkData. Landmarks can be stored on disk and loaded from there by using the methods SaveLandmarks and LoadLandmarks.

In order to draw landmarks most efficiently, you should first set the desired common properties of the landmarks to be drawn by assigning the appropriate values to the LandMarkDefault property and then use AddLandMark to actually create individual landmarks.


Last Update: 2013-May-14