|
TNTmips Downloads Menu

|
raster_labeller.sml
#raster labeller.sml
#written by: David Friberg
#date: 27 July 2004
#
#Purpose:
# Use this SML Layer to add labels to all raster layers
# in a group. Label used is the name of the raster.
#
#Requirements:
# TNTmips 6.9
# Must be used as an SML layer in the Display process.
#
#To use:
# Add all raster layers to be labeled.
# Add this SML layer.
class GRE_LAYER curLayer = ThisLayer.Group.FirstLayer;
ThisLayer.Name = "Labels";
DrawTextSetColors("red","red");
SetLineWidth(4);
DrawTextSetHeightPixels(13);
while(curLayer != 0) {
if(curLayer.Type == "Raster") {
class RASTER curRast;
DispGetRasterFromLayer(curRast, curLayer);
class GEOREF curGeoref;
curGeoref = GetLastUsedGeorefObject(curRast);
class POINT2D labelPos = ObjectToMap(curRast, 0, 15, curGeoref);
class TRANSPARM trans;
trans.InputCoordRefSys = curGeoref.CoordRefSys;
trans.OutputProjection = ThisLayer.Projection;
labelPos = trans.ConvertPoint2DFwd(labelPos);
MoveTo(labelPos.x, labelPos.y);
DrawTextSimple(sprintf("%s", curLayer.Name));
}
curLayer = curLayer.NextLayer;
}
©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010 USA
Business & Sales: (402)477-9554 Support: (402)477-9562 Fax: (402)477-9559
Business info@microimages.com
Support support@microimages.com
Web webmaster@microimages.com
| |