home products news downloads documentation support gallery online maps resellers search
TNTmips Downloads Menu

HOME

CONTACT US

CURRENT RELEASE
  TNT 2013

DEVELOPMENT VERSION
  TNT 2014

TNTmips Pro
PRIOR RELEASES
  TNT 2012

FREE SOFTWARE
  TNTmips Free
  TNTatlas
  TNTsdk

MORE DOWNLOADS
  HASP Key Driver
  Screen Recorder
  TNT Language Kits
  Sample Geodata
  TNT Scripts

DOCUMENTATION
  TNTmips Tutorials
  Tutorial Datasets
  Technical Guides
  Scripts
  Quick Guides

MORE INFO
  Download FAQs
  FTP
  Download Managers
  Find Reseller

SITE MAP


Custom Processing Scripts

Extend the Capabilities of the TNT products

Go to main SCRIPTING page...


If want to develop your skills in writing SML scripts, you will find some helpful examples here. Start with a working model and then modify it for your project. 

Go to 1-page index of over 200 scripts ...
Download all sample scripts: TNT_2013_SampleScripts.zip  (9.1 Mb)
Read the tutorial Writing Scripts in SML.  

Read the tutorial Building Dialogs in SML
Configure your text editor for SML

Download SML Custom Scripts:

Auto Register SML Scripts ...
...SPOT4band.sml

...SPOT4bandWebTileset

related Tech Guide

Automated Image Georeferencing in SML
The auto-register procedure, which generates hundreds to thousands of georeference control points for an image automatically using a reference image, is available for use in your TNT geospatial scripts. The auto-register operation can be integrated into general processing scripts that also carry out image resampling and enhancement.

MicroImages has created two sample scripts to demonstrate this capability:

AutoRegisterSPOT4bandWebTilesetRef.sml uses one of the standard web tilesets hosted at the MicroImages website as the reference image.

AutoRegisterSPOT4band.sml uses a local color-composite raster in a TNT Project File as the reference.

These scripts are designed for standalone auto-registration of a 4-band SPOT satellite image that has been imported to a TNT Project File. However, these scripts can be adapted easily to process any single-band or multiband image or color composite in a variety of file formats or to do batch processing of a number of input images.

ExportTerrainCollada.sml
Bingham4mCIR4.kmz

Export 3D Terrain and Image Overlay to Google Earth
This sample standalone SML script enables you to create a custom terrain surface and matching image overlay that can be viewed in 3D in Google Earth. The inputs are a DEM (Digital Elevation Model) raster and an overlapping IMAGE raster. The extents of the DEM and IMAGE do not have to match exactly, as the script automatically crops them to their common extents if necessary. These inputs also can have different coordinate reference systems.

The surface and image texture are output as a COLLADA model packaged in a KMZ file (compressed KML). The COLLADA model is referenced as a placemark in the KML file stored within the KMZ. The placemark includes the WGS84 Geographic coordinates of the origin (center point) of the model, its height in meters above sea level, and its orientation (angle to north). This placemark information allows Google Earth to correctly locate and orient the terrain model in 3D space.

The COLLADA model specifies a triangular mesh defining the custom 3D terrain derived from the DEM and a mapping to corresponding normalized image coordinates to allow the image (exported as a JPEG, PNG, or TIFF file) to be overlaid as a texture onto the triangular mesh in Google Earth. The triangular mesh coordinates are read from a TIN created from the DEM. The COLLADA model has projected coordinates derived from the coordinate reference system of the IMAGE (unless it has a non-projected CRS, in which case a location-appropriate UTM CRS is created and used).

The custom script dialog provides interactive selection of the input DEM and IMAGE and the output KMZ file. The elevation units for the DEM (meters or feet) must be correctly specified to provide proper vertical scaling for the model. A vertical offset of the model above the Google Earth terrain surface can be set to avoid intersection of the model and the Google Earth terrain (portions of the model below the Google Earth terrain are not visible).

Note that models with image overlays larger than about 1024 by 1024 cells may load very slowly in Google Earth and degrade its performance.

Export...ColladaKMZ.sml
Export...KMZtrack.sml
CastleReefSections.kmz
Section_C.kmz
CRgeolmap.zip
related color plate

Export 3D Cross-Sections to Google Earth
MicroImages has created a script using the TNT geospatial scripting language (SML) that automates the export of one or more manifold 3D cross-section objects to a KMZ file. This allows the section or sections to be viewed immediately in 3D in Google Earth in their correct geographic positions and orientations. The sample SML script creates a COLLADA file and corresponding PNG image file for each selected cross-section, creates the KML file that positions these models, and packages all of these products in a single KMZ file (ZIP file with a .kmz file extension) for easy use in Google Earth.

Two versions of the cross-section export script are available. They differ in the method used to animate the cross-sections and limit use of the exported KMZ file to specific Google Earth versions:

- ExportMultiSectColladaKMZ.sml: KMZ useable in all Google
     Earth versions

- ExportMultiSectColladaKMZtrack.sml: KMZ file useable in Google
     Earth 5.2 and later. Smoother animation using element.

- CastleReefSections.kmz: Sample multiple cross-section KMZ file.
- Section_C.kmz: Sample single cross-section KMZ file.

- CRgeolmap.zip: Google Earth Super-Overlay of Matching geologic map.

LAS_GROUND.sml
LASextractByRegion.sml
related color plate

Processing LAS LIDAR Point Files. Processing scripts written in the TNT geospatial scripting language (SML) can access LIDAR point data directly from standard LAS files, process the points, and create new LAS files to contain the results. The LIDAR points do not have to be imported to an internal TNT geospatial format at any point in this processing. SML's ability to work directly with native LAS files can save a significant amount of processing time that would otherwise be needed to import files that can contain millions of points. To demonstrate direct processing of LAS files using TNT geospatial scripts, MicroImages has prepared several sample scripts. The LAS_GROUND script illustrates how an SML script can use LIDAR point classifications to control processing. It copies only points classified as Ground to a new LAS file. These ground points could then be used as input to generate a bare-earth elevation raster. The LASextractByRegion script uses a region to extract all LIDAR points within the region to a new LAS file

canvquakes.sml
canvquakespkg.zip
related color plate

Automatically Update Geomashup using SML and Job Processing. MicroImages has prepared a demonstration of an automated, regularly-scheduled geomashup application that downloads updated geospatial data from the Internet, processes and combines the data with other geospatial data, and posts the result on a web page for viewing in the Google Earth browser plug-in. The source geospatial data for this demonstration are global earthquake epicenter locations and associated attributes posted and continuously updated by the U.S. Geological Survey. The key component of the application is a custom processing script written in the TNT Geospatial Scripting Language (SML) that is run hourly by the TNTmips Pro Job Processing System. This script downloads the earthquake data, extracts the data for the desired area, sets up styles and DataTips, and renders the result to a KML file that is referenced by a web page that loads this file in the Google Earth browser plug-in. This sample script, associated reference data, and the sample web page are available for download in a Zip archive.

TiffToJP2getJobParms.sml
TiffToJP2fromJob.sml
related color plate

Script Example Using Job Processing. You can combine geospatial scripting and TNTmips Job Processing to perform specialized batch processing. A pair of scripts is required for such a task: an Input/Output script to collect user inputs and create one or more job files, and a Process script to obtain the processing parameters from each job file and perform the actual custom processing. This custom job processing example performs batch conversion of a set of four-band TIFF files to compressed JP2 files. The Input/Output script TiffToJP2getJobParms provides a dialog for selecting input TIFF files, an output directory, and JPEG2000 compression settings. It makes a job file for each input that includes these parameters and that calls the processing script TiffToJP2fromJob to perform the conversion.

MapUnitAreas.sml
related color plate

Tabulate Map Unit Areas for Watershed Catchments. Designed to relate the results of the Sample Catchments script to a geologic, soil, or other vector object containing map unit polygons. For each catchment the script tabulates the area and percent area of each intersecting map unit. These values are written to tables attached to copies of the original catchment polygon vector and sample point vector object. This generalized version of the GeolUnitArea script automatically compiles a list of unique map units from the selected vector object and tabulates areas for all units or optionally for a single target unit.

GeotagDbase.sml
related color plate

Add Geotags to Database Records. Standalone script automatically adds geotag information to a database table containing records of point observations. The script requires that the source table include fields with the date and time of observation for each record and requires a concurrent GPS track log. The source table is copied, fields with Latitude, Longitude, and Elevation are added for each record, and the new result table is placed in the same database object as the source.

GPSphoto2.sml.
related color plate

Add Geotags to Digital Photos. Customizable standalone script determines locations for any number of digital photo files in JPEG format and creates a point vector object with an attached database table with the photo and geotag information. Geotagging can be done automatically using the date and time recorded in each photo's EXIF header and one or more GPS track logs, or coordinates can be obtained visually by indicating photo locations on a georeferenced image.

MorphContour.sml
related color plate
Contours to DEM via Morphological Interpolation. Standalone script to demonstrate the results of a surface-fitting process from contour lines using morphological functions as described in the paper "An Image Space Algorithm for Morphological Contour Interpolation" by Barrett, Mortensen and Taylor.
RasterIntervals.sml
related color plate
Theme Mapping a Raster. Standalone script to categorize a grayscale raster into a specified number of grayscale-value intervals. The number of intervals and the distribution type (equal count or equal interval) can be specified. Separate dialogs are provided to set input parameters, view and edit the range values, and to preview the result. Script makes a categorical raster with a single value for each interval and a color palette. 
SampleCatchments.sml
related color plate
Mapping Catchment Areas for Sample Points.  Automates the delineation of upstream watershed catchments for many sample locations provided as points in a vector object. Point attributes (chemical analyses of stream sediment or water, for example) are transferred to the derived catchment polygons.
GeolUnitArea.sml
related color plate
Catchment Analysis for Locating Ore Deposits  Used to relate results of the SampleCatchments script to a geologic map vector object. Copies the catchment polygons vector object and adds a table that records the summed areas and percentages of each geologic map unit for each catchment.
VB_PanSharp.sml
VB_PanSharp.zip
related color plate
Build SML Dialogs Using Visual Basic   This standalone script demonstrates use of a custom dialog and supporting code implemented as a Windows ActiveX component class written in Visual Basic. This demonstration is derived from the PanSharpComp SML script that is distributed as a sample with the Building Dialogs in SML tutorial. It creates a pan-sharpened color-composite image from input Red, Green, Blue, and Panchromatic raster objects. In order to run the script, download and unzip the VB_PanSharp.zip file and run the Setup program in the Package subdirectory. This installs and registers the ActiveX component in your Windows OS. The SML script imports the Vbform class defined by this ActiveX program.
SRTMfill.sml
related color plate
SRTM Hole-Filling.  Fills the no-data cells in the DEMs produced from the Radar data acquired by the Shuttle Radar Topography Mission (SRTM).
surfcurv.sml
related color plate
Terrain Curvature.  Creates profile and plan curvature rasters from an input DEM using local best-fit mathematical surfaces.
LandsatCalibrationPilot.sml
related color plate
Calibrate Multitemporal Landsat Scenes via SML.  Automates the complex sequence of processing steps required to adjust a time-series of Landsat scenes to a common quantitative scale for use in monitoring change in surface conditions.
ParcelToolModal.sml
ParcelToolModeless.sml
related color plate
VBDEMO.zip
ActiveX Callbacks to SML.  
also
Communicate with Visual Basic Programs using SML(2-pages)
SML scripts use Microsoft Windows AcitveX technology to launch and communicate with Visual Basic, C++, or Java.
printsep.sml
related color plate
The Print Separation macro produces color  separations (TIFF files) for printing image layers.  The image layers in the layout must be grayscale; overlays are restricted to specified colors.
pansharpcomp.sml
related color plate
Panchromatic Sharpening.  The script computes a pan-sharpened color-composite image from three bands of a multispectral image and a higher-resolution panchromatic image.
deveg68.sml
related color plate
Suppressing Vegetation.  Suppress the expression of vegetation in multispectral images for geological and soil mapping applications.
radiogroup.sml
related color plate
Radio Group .  A small "stub" script that illustrates how you can build SML dialogs using XML.
doqq7.sml DOQQ Assembly.  Automated assembly of Digital Ortho photos.
fixseam.sml Fill Gaps implement gap filling rules for raster mosaic seams
nearnegh.sml Nearest Neighbor Polygons Update nearest neighbor databases for polygons in a vector object.
query_nn.sml Query Nearest Neighbor Polygon: Query nearest neighbor databases for polygons in a vector object.
inputmat.sml Parse Input String: find a numeric text position inside a string
values.txt Sample Input String: sample text input file for inputmat.sml
avirisl.sml Wavelength Description: automatically modify Project File descriptions for AVIRIS imagery to include a phrase in the form "wavelength xxxx"
focalmean.sml Vector Point to Raster Focal Mean: write result of focal mean operation for a raster cell chosen from a vector point
polybl.sml Polygon Boundary Length: read description
votdist.sml Voter Districts: read description
compar.sml Color Map: Toolscript to compare colors and manipulate color map in 8-bit raster object
tiger.sml TIGER Cities: extract TIGER city polygons

25 March 2009  

page update: 29 Oct 12


Back Home ©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