12.07.2015 Views

ERDAS Spatial Modeler Language Reference Manual.pdf

ERDAS Spatial Modeler Language Reference Manual.pdf

ERDAS Spatial Modeler Language Reference Manual.pdf

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Leica Geosystems<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong><strong>Reference</strong> <strong>Manual</strong>03 November 2005Geospatial Imaging, LLCNorcross, Georgia


Copyright © 2003 - 2005 Leica Geosystems Geospatial Imaging, LLCAll rights reserved.Printed in the United States of America.The information contained in this document is the exclusive property of Leica Geosystems Geospatial Imaging, LLC. This work is protected underUnited States copyright law and other international copyright treaties and conventions. No part of this work may be reproduced or transmitted inany form or by any means, electronic or mechanical, including photocopying and recording, or by any information storage or retrieval system, exceptas expressly permitted in writing by Leica Geosystems Geospatial Imaging, LLC. All requests should be sent to the attention of Manager ofTechnical Documentation, Leica Geosystems Geospatial Imaging, LLC, 5051 Peachtree Corners Circle, Norcross, GA 30092-2500, USA.The information contained in this document is subject to change without notice.Government Reserved Rights. MrSID technology incorporated in the Software was developed in part through a project at the Los Alamos NationalLaboratory, funded by the U.S. Government, managed under contract by the University of California (University), and is under exclusivecommercial license to LizardTech, Inc. It is used under license from LizardTech. MrSID is protected by U.S. Patent No. 5,710,835. Foreign patentspending. The U.S. Government and the University have reserved rights in MrSID technology, including without limitation: (a) The U.S. Governmenthas a non-exclusive, nontransferable, irrevocable, paid-up license to practice or have practiced throughout the world, for or on behalf of the UnitedStates, inventions covered by U.S. Patent No. 5,710,835 and has other rights under 35 U.S.C. § 200-212 and applicable implementing regulations;(b) If LizardTech's rights in the MrSID Technology terminate during the term of this Agreement, you may continue to use the Software. Anyprovisions of this license which could reasonably be deemed to do so would then protect the University and/or the U.S. Government; and (c) TheUniversity has no obligation to furnish any know-how, technical assistance, or technical data to users of MrSID software and makes no warranty orrepresentation as to the validity of U.S. Patent 5,710,835 nor that the MrSID Software will not infringe any patent or other proprietary right. Forfurther information about these provisions, contact LizardTech, 1008 Western Ave., Suite 200, Seattle, WA 98104.<strong>ERDAS</strong>, <strong>ERDAS</strong> IMAGINE, IMAGINE OrthoBASE, Stereo Analyst and IMAGINE VirtualGIS are registered trademarks; IMAGINE OrthoBASEPro is a trademark of Leica Geosystems Geospatial Imaging, LLC.SOCET SET is a registered trademark of BAE Systems Mission Solutions.Other companies and products mentioned herein are trademarks or registered trademarks of their respective owners.


Table of ContentsChapter 1Introduction to SMLConventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Words enclosed in < > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Working Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Setting Windows on Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Bin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Purpose of Bin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Example of a Bin Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Types of Bin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Default Bin Function for Output Data File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<strong>Modeler</strong> <strong>Language</strong> Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7General Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Declaration Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Declaration Statement Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9SCALAR Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10TABLE Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10Associating Table Variables With Descriptors and Color Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Examples of Table Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Associating Table Variables With Vector Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13MATRIX Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13RASTER Declarations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Using Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15File Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Existence Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Access Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Data Type Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Default Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Layer Type Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Interpolation Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Window Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Area of Interest Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Statistics Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Bin Function Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21iii


Table of ContentsEdge Extension Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Examples of Raster Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Data Type Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23VECTOR Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Window Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Area of Interest Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Cellsize Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Feature Type Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Rendering Method Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Binary Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Integer Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Float Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Complex Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Color Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28String Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Variable <strong>Reference</strong>s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Using Operators and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Table Subexpressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Matrix Subexpressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Raster Layer Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Assignment Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33Example Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Data Type Assignment Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Object Type Assignment Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33ASCII Input-Output Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35SHOW Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35READ Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35WRITE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35VIEW Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Setting Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37SET WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37SET CELLSIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Other SET Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38SET AOI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38SET DEFAULT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38SET DEFAULT ORIGIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39SET DEFAULT INTERPOLATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39SET DEFAULT STATISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39SET TILESIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40SET RANDOM SEED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40QUIT Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41Statement Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43Conditional Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43Looping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43iv<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Table of ContentsMacro Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45Running the <strong>Spatial</strong> <strong>Modeler</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Running from IMAGINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Model Maker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Running from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Model Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Statistics Computation and Descriptor Column Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Syntax Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Processing Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Common Causes of Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Standard Rules for Combining Different Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53COLOR Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Chapter 2SML Function SyntaxFunction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Point Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Neighborhood Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Global Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Zonal Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Layer Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Combination Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58<strong>Modeler</strong> Function Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61CLUMP (Clump - Contiguity Analysis) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62CONVOLVE (Convolution) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64CORRELATION (Correlation Matrix From Covariance Matrix) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65CORRELATION (Correlation Matrix From Raster). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66COVARIANCE (Covariance Matrix) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68DELROWS (Delete Rows from Sieved Descriptor Column) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70DIRECT LOOKUP (Map Integer Values Through Lookup Table) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72EIGENMATRIX (Compute Matrix of Eigenvectors) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73EIGENVALUES (Compute Table of Eigenvalues) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74HISTMATCH (Histogram Matching) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75HISTOEQ (Histogram Equalization). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76HISTOGRAM (Histogram) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78LINEARCOMB (Linear Combination) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80LOOKUP (Map Input Values Through Lookup Table Using Bin Function). . . . . . . . . . . . . . . . . . . . . . . . . 81PRINCIPAL COMPONENTS (Principal Components) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82RASTERMATCH (Raster Matching) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84SIEVETABLE (Get Sieve Lookup Table) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86STRETCH (Stretch) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87Arithmetic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89<strong>Reference</strong> <strong>Manual</strong>v


Table of Contents+ (Addition) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90- (Subtraction) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91- (Negation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92* (Multiplication) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93/ (Division) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94MOD (Modulus) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95! (Factorial). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96Bitwise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97& (Bitwise And) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98| (Bitwise Or) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99^ (Bitwise Exclusive Or) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100~ (Bitwise Not) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101Boolean. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103AND (Logical And) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104OR (Logical Or) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105NOT (Logical NOT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107COLOR (Create Color Scalar) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108HUE (Get Hue from RGB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109IHSTOBLU (Get Blue from Intensity, Hue, and Saturation). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111IHSTOGRN (Get Green from Intensity, Hue, and Saturation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112IHSTORED (Get Red from Intensity, Hue and Saturation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113IHSTORGB (Get Red, Green and Blue from Intensity, Hue and Saturation). . . . . . . . . . . . . . . . . . . . . . 114INTENS (Get Intensity from RGB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115RGBTOIHS (Get Intensity, Hue and Saturation from Red, Green and Blue). . . . . . . . . . . . . . . . . . . . . . 116SATUR (Get Saturation from RGB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118STACK (Convert FLOAT TABLE to COLOR SCALAR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119UNSTACK (Convert COLOR SCALAR to FLOAT TABLE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120Conditional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121CONDITIONAL (Conditional). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122EITHER...IF...OR....OTHERWISE (Select on Binary Test) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123INDEX (Index - Find Matching Item on List) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124PICK (Pick - Get nth Item on List) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125Data Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127MAPX (Create Raster Containing X Map Coordinates). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128MAPY (Create Raster Containing Y Map Coordinates). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129MATRIX (Create Matrix from List of Scalars). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130MATRIX (Read Matrix from Kernel Library). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131MATRIX SERIES (Create Matrix Containing 2-D Series) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132PIXELX (Create Raster Containing Column Number) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133PIXELY (Create Raster Containing Row Number) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134RANDOM (Generate Random Values) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135STACKLAYERS (Stack Raster Layers). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136TABLE (Create Table from List of Scalars) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137TABLE SERIES (Create Table Containing Series) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139. (Map Raster Through Descriptor Column). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140:: (Read Descriptor Column or Color Table) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143vi<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Table of ContentsDELTA (Delta) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220EVEN (Test if Even). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221FLOAT (Convert to Float) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222FLOOR (Floor). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223GAMMA (Gamma) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224IMAG (Imaginary Part). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225INTEGER (Convert to Integer). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226INV (Multiplicative Inverse) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227ODD (Test if Odd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228REAL (Real Part) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229ROUND (Round) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230SIGN (Sign) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231SINC (Sinc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232STEP (Step). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233TRUNC (Truncate). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234WHOLE (Test if Whole Number) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235Relational . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237EQ (Equality) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238GE (Greater Than or Equal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239GT (Greater Than) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240LE (Less Than or Equal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241LT (Less Than) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242NE (Inequality) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243=~ (Case Insensitive String Equality). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244!~ (Case Insensitive String Inequality) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245ISALLTRUE (Test for All Non-zero). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246ISNONZERO (Test for Non-zero) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249CELLAREA (Area of Grid Cells) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250CELLUNITS (Cell Size Units) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251CELLX (X Cell Size) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252CELLY (Y Cell Size) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253LAYERHEIGHT (Height of Raster Layer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254LAYERWIDTH (Width of Raster Layer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255NUMCOLS (Number of Columns) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256NUMLAYERS (Number of Layers). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257NUMROWS (Number of Rows) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259STACK DIVERSITY (Stack Diversity) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260STACK MAJORITY (Stack Majority) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261STACK MAX (Stack Maximum) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262STACK MEAN (Stack Mean) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263STACK MEDIAN (Stack Median). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264STACK MIN (Stack Minimum) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265STACK MINORITY (Stack Minority) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266STACK SD (Stack Standard Deviation). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267STACK STANDARD DEVIATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268STACK SUM (Stack Sum) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Statistical (Local) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271DENSITY (Local Density) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272viii<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Chapter 1Introduction to SMLIntroductionThe <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong> is a script language that is designed for GIS modeling andimage processing applications. The <strong>Spatial</strong> <strong>Modeler</strong> language allows you to define simple orcomplex processing operations outside of Model Maker, the graphical user interface in the<strong>Spatial</strong> <strong>Modeler</strong> component. Models created with Model Maker can be edited with the <strong>Spatial</strong><strong>Modeler</strong> <strong>Language</strong>. However, the models which are created or edited using the <strong>Spatial</strong> <strong>Modeler</strong><strong>Language</strong> cannot be accessed from Model Maker.Operations that you can perform with the <strong>Spatial</strong> <strong>Modeler</strong> include:• mathematical operations on raster layers (adding, subtracting, multiplying, ratioing, orother image algebra functions)• convolution filtering• neighborhood analyses (analyzing a pixel based on the values of neighboring pixels)• subsetting and mosaicking• principal components analysis• proximity analysis• contiguity analysis• descriptor table manipulationConventionsThe following conventions are used in this On-Line Help document:Words enclosed in < >When you see words with < > around them, you need to substitute these words with the properinformation. For example, when you see the following in this document:SCALAR ;you would substitute the actual name of the variable so that the actual statement syntax wouldbe something like:SCALAR scalefactor;StringsA string is a group of words or characters. You must use quotation marks to enclose a string.<strong>Reference</strong> <strong>Manual</strong>1


Bin FunctionsBin FunctionsPurpose of BinFunctionsExample of a BinFunctionAt the completion of a model, the <strong>Spatial</strong> <strong>Modeler</strong> will compute statistics and a histogram foreach output raster layer. The histogram will be stored in a descriptor table for the output layer.The model may also output other descriptor columns to a descriptor table. See AssociatingTable Variables With Descriptors and Color Tables.Bins are used to group ranges of data values together for better manageability. Histograms andother descriptor columns for 1, 2, 4 and 8-bit data are easy to handle, since they contain amaximum of 256 rows. However, to have a row in a descriptor table for every possible datavalue in floating point, complex, and 32-bit data would yield an enormous amount ofinformation.Suppose we have a floating point data layer with values ranging from 0.0 to 1.0. We could setup a descriptor table with 100 rows with each row or bin corresponding to a data range of .01 inthe layer.The bins would look like the following:Bin NumberData Range0 X < 0.011 0.01


Types of Bin FunctionsBin NumberData Range• LINEAR - establishes a linear mapping between data values and bin numbers, as in our firstexample, mapping the data range 0.0 to 1.0 to bin numbers 0 to 99.The bin number is computed by:where:1 -600.5 < X


Bin Functionsif (bin >= numbins) bin = numbins - 1• EXPLICIT - explicitly defines mapping between each bin number and data range.Explicit bin functions are not accessible from the current version of the <strong>Spatial</strong> <strong>Modeler</strong><strong>Language</strong>. They are only accessible through the C Programmers’ Toolkit.Default Bin Functionfor Output Data FileTypes• 1, 2, 4, and 8-bit integer layers:Direct binning. Number of bins equals 2, 4, 16, and 256 respectively.• 16 and 32-bit integer layers:If the difference between the maximum and minimum data values is less than 256, usesdirect binning with an offset of the minimum data value; number of bins is: maximum -minimum + 1If the difference is greater or equal to 256, linear binning from min to max with 256 bins isused by default.• Floating point layers:Linear binning from min to max, 256 bins.• Complex layers:Linear binning from minimum magnitude to maximum magnitude, 256 bins. The complexvalues are converted to magnitude before computing bin number.The declaration statement has options to override the default binning by setting the desired binfunction type and number of bins for the output layer. See the section Bin FunctionSpecification under Raster Declarations.6<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


General Syntax<strong>Spatial</strong> <strong>Modeler</strong><strong>Language</strong>StatementsThe <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong> includes several basic statements that you will use together tocreate models. These statements include:• Declaration statements• Assignment statements• Visual output statements• SET statements• Macro Definitions• QUIT statementExpressions are used in building statements.General SyntaxA model may contain an almost unlimited number of lines of text.The indentation of the lines that are used in the example models here are used for clarity only—they are not necessary. However, if used, they will make your models more readable.StatementsEach statement in a model makes one definition or calculation. A statement may occupy morethan one line. A semicolon must mark the end of each statement. The following statement islegal:YYYYYYYYYYYY = max (AAAAAAAAAAAA,BBBBBBBBBBBB,CCCCCCCCCCCC,DDDDDDDDDDDD,EEEEEEEEEEEE,FFFFFFFFFFFF ) + 127;Most syntax errors are caused when the semicolon is left off the end of a line. The line thatis missing the semicolon is the line preceding the one in which the error is detected. Forexample, if a semicolon is missing on line 7, the error will appear on line 8.CommentsAny line that begins with a # character is considered a comment line, and will be ignored by the<strong>Modeler</strong>. An exception is the Macro Definitions statement, which begins with #define.Comments can also be on lines with valid statements. Any text after a # is a comment (unless #is followed by define). Comment lines can be embedded anywhere within the model.A comment does not need to end with a semicolon. However, if a comment is on the same lineas a statement, the statement must end with a semicolon, and the # character must follow thesemicolon.<strong>Reference</strong> <strong>Manual</strong>7


<strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong> StatementsThe following lines contain comments. The text after the # is ignored by the <strong>Modeler</strong>.## this is a comment# # # # # # # # # # # # # # # # # # # # # # # # # ## this model worked on Tuesday# RASTER abc file "xyz.img";RASTER abc file "real.img"; # this is what I meant to doBlank lines are also ignored by the <strong>Modeler</strong>.You may also specify comments using the character sequences /* and */. Any text which isbetween /* and */ is ignored by the modeler. Comments delimited by /* and */ may span multiplelines. For example:/* This is an example ofa comment which spans severallines in a model */CaseThe case of characters (e.g., UPPER CASE vs. lower case) is not recognized by the <strong>Modeler</strong>.Therefore, any text within a statement can be upper case or lower case, and the case does notneed to be consistent within the model.In the examples in this documentation, upper case is used for keywords, and lower case is usedfor variable names and other user-defined text. This is used for clarity and is not essential.8<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Declaration StatementsDeclarationStatementsA declaration statement establishes a variable in the model. It defines:• the name and size of the variable,• its data type and• object type.There are five types of declarations statements used in the <strong>Modeler</strong>:SCALARTABLEMATRIXRASTERVECTORDeclaration Statement FormatThe basic format of the declaration statement is: ;where:Data type, either BINARY, INTEGER, FLOAT,COMPLEX, COLOR, or STRING. If the data type isomitted, the data type defaults to INTEGER.Object type, either SCALAR, TABLE, MATRIX,RASTER, or VECTOR. If the object type is omitted,the object type defaults to SCALAR.The name you specify for the variable. The name muststart with a letter and consist entirely of letters,numbers, and the underscore character (_). You cannotuse any of the keywords defined in the <strong>Spatial</strong><strong>Modeler</strong> <strong>Language</strong> as variable names.Sets the number of rows in a table, the number of rowsand columns of a matrix, or the number of layers in araster variable. The may also include aorigin specifier, which specifies what index is to beused to identify the first row, column, or layer. Theorigin is usually either 0 or 1.The component is not used for scalars orvectors, and may be omitted in the declaration of othertypes. If the variable is associated with existing filedata, the size will be derived from the file. Otherwise,the size will be set on the first assignment to thisvariable.<strong>Reference</strong> <strong>Manual</strong>9


Declaration StatementsMay be used to associate a raster variable with animage file, or a table with a descriptor column, or setvarious parameters used when creating a new imagefile.The used in associating rasters and tables with files are discussed in thefollowing pages of this document.SCALAR DeclarationsTABLE DeclarationsSCALAR variables may be declared with one of the following statements: SCALAR ;orSCALAR ;or name;If is omitted, the data type defaults to INTEGER. If a variable is declared withoutan object type, then it defaults to SCALAR.The basic format of a TABLE declaration is the following: TABLE ; and/or may be omitted. If is omitted, data type defaultsto INTEGER. is one of the following:[][:][:] is an integer constant specifying the index for the first row of the table.For example, if a table is declared as:TABLE bob [0:7];then bob [0] is the first row of the table and bob [6] is the last row.If is omitted, the origin will be the default table origin. The pre-set default table originis zero. The default table origin may be reset using the SET DEFAULT ORIGIN TABLEstatement, or may be set using the Preference Editor. must be a constant. is a numeric scalar expression specifying the number of rows in the table variable. If is non-integer, it will be converted to integer. If is omitted, the number of rowswill be set either by the descriptor table size or by the first assignment to the variable. If the tableis associated with a descriptor table as described in the next section, the size of the descriptortable may determine the size of the declared table.Associating Table Variables With Descriptors and Color TablesTABLE variables may be associated in the declaration statement with a descriptor table columnfrom an image file. The descriptor table column may already exist or be created by the model.10<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


TABLE Declarations• If the descriptor table column already exists, the column is read into the table variablefrom the file. At the end of model execution, the table will be written back to the file withany new values that may have been assigned to the table by the model.• If the descriptor table column does not already exist, the column will be created at the endof model execution and values written into the file.See Statistics Computation and Descriptor Column Output for more information on writingdescriptor table columns.The format for declaring a table associated with a descriptor column or color scheme is: TABLE DESCRIPTOR ::;orCOLOR TABLE COLORTABLE ; and are described in the previous section, Basic Table Declarations. is a raster expression which must represent a single layer raster object associatedwith a layer of an image file. The layer may already exist, or it may be a layer which will becreated by this model. The must be a reference to a raster variable, or a singlelayer of a raster variable, i.e., is either:or ()The , if present, must be an integer constant. is a string constant which specifies the name of the descriptor column tobe associated with this variable. This may be an existing descriptor column, or the name of anew column to be created by the <strong>Modeler</strong>. If the descriptor column exists, the data type of thecolumn must match the data type specified by the declaration. If the column does not exist, itwill be created using the data type of this table variable.The current version of the <strong>Modeler</strong> always defaults to INTEGER type, regardless of thedata type of the associated descriptor table, and the type of the variable must match thetype of the descriptor column.If either DESCRIPTOR or COLORTABLE is present in the declaration, and the descriptortable exists for the layer associated with the , the number of rows will be set tothe number of rows in the descriptor table for that layer. Otherwise, the number of rows for thetable will be deferred until the first assignment statement assigning a value to the variable name.At that point, the number of rows in the expression being assigned to this variable determinesthe size.The COLORTABLE keyword may be used only with a table of COLOR data type. The valuesfound in the “Red,” “Green,” and “Blue” descriptor columns will be read into this table, or ifthese columns do not exist, the <strong>Modeler</strong> will create them.<strong>Reference</strong> <strong>Manual</strong>11


Declaration StatementsOnly one table variable may be associated with each descriptor column for a single layer. If youtry to associate more than one table variable with the same descriptor column of the same layer,an error occurs. Also, since the COLORTABLE keyword associates a table variable with the“Red,” “Green,” and “Blue” columns of a descriptor table, you may not associate another tablevariable with any of these three descriptor columns for the same layer.Examples of Table DeclarationsPlease read the following sections before continuing with these examples:• RASTER Declarations• Variable <strong>Reference</strong>s• Raster Layer Stacks• Bin Function SpecificationExamplesTABLE tom;This declares an INTEGER TABLE named tom of undefined size. The number of rows in tomwill be defined when an assignment is made to tom.RASTER in FILE OLD INPUT "infile.img";STRING TABLE clnames DESCRIPTOR in :: "Class_Names";This declares the table clnames and associates it with the Class_Names column of thedescriptor table for the single layer in the existing file infile.img. The number of rows inclnames will be the number of bins in the descriptor table. The file infile.img must containexactly one layer, or the <strong>Modeler</strong> will report an error.RASTER in FILE OLD INPUT "mobbay.img";FLOAT TABLE hist DESCRIPTOR in (3) :: "Histogram";This time, the table hist is associated with the histogram for layer 3 of mobbay.img.The current version of the <strong>Modeler</strong> always defaults to INTEGER type, regardless of thedata type of the associated file data.RASTER out FILE NEW OUTPUT "newfile.img";STRING TABLE clnames DESCRIPTOR out :: "Class_Names";In this example, newfile.img is a new file, so the descriptor table has not been created yet.Thus the size of clnames is undefined after the declaration, and will be defined by the firstassignment to clnames. The descriptor table for newfile.img is not created until the statisticsare computed at the end of model execution.After the descriptor table is created, the Class_Names column is added, and the data inclnames is written to the column. If there are more rows in clnames than bins in thedescriptor table, only the rows up to the number of bins are written out. If there are more binsin the descriptor table than rows in clnames, the remaining rows in the descriptor column willbe initialized to "".12<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


MATRIX DeclarationsAlso, note that the number of layers in the RASTER variable out was left undefined in itsdeclaration. The declaration of clnames assumes that out has only one layer, and in factactually defines the number of layers in out to be one.FLOAT TABLE hist DESCRIPTOR out (3) :: "Histogram";This time, however, the number of layers in out is undefined when out (3) is referenced in thedeclaration of hist. This causes an error to be reported.RASTER in FILE NEW INPUT "infile.img";COLOR TABLE clrtab COLORTABLE in;This declares the color table clrtab to be associated with the Red, Green, and Blue columns ofthe descriptor table for the single layer in the existing file infile.img.Associating Table Variables With Vector AttributesTABLE variables may also be associated in the declaration statement with an attribute of avector coverage or an annotation layer. This is very similar to associating a table with adescriptor column from a raster image file. For vector coverages, the attribute may already existmay or be created by the model:• If the attribute already exists, the attribute data is read into the table variable from the file.At the end of model execution, the table will be written back to the attribute file with anynew values that may have been assigned to the table by the model.• If the attribute does not already exist, the attribute will be created at the end of modelexecution and values written into the file.For annotation layers, only the Name and Description can be treated as attributes. Either of thesemay be read from and/or written into. No new attributes for annotation can be created.The format for declaring a table associated with a attribute is: TABLE ATTRIBUTE :: ; and are described in the section Basic Table Declarations.The default data type is INTEGER, regardless of the type of attribute. is the variable name of a vector object. See VECTOR Declarations. is a string constant which specifies the name of the attribute to be associatedwith this variable. For vector coverages, this may be an existing attribute, or the name of a newattribute to be created by the <strong>Modeler</strong>. For annotation layers, must be either“Name” or “Description”;If ATTRIBUTE is present in the declaration, and the attribute table exists for the coverage orlayer associated with the , the number of rows will be set to the number of rowsin the attribute table. Otherwise, the number of rows for the table will be deferred until the firstassignment statement assigning a value to the variable name. At that point, the number of rowsin the expression being assigned to this variable determines the size.Only one table variable may be associated with each attribute for a single coverage or layer. Ifyou try to associate more than one table variable with the same attribute, an error occurs.MATRIX DeclarationsThe basic form of a matrix declaration is: MATRIX ;<strong>Reference</strong> <strong>Manual</strong>13


Declaration Statements and/or may be omitted. If is omitted, data type defaultsto INTEGER.Matrix objects may not be declared as COLOR or STRING data types. is one of the following:[, ][:, :][:, :] and are integer constants specifying the index for the first rowand first column of the table. For example, if a matrix is declared as:MATRIX biff [1:3, 0:4];then the elements of the matrix would be arranged as:biff [1,0] biff [1,1] biff [1,2] biff [1,3]biff [2,0] biff [2,1] biff [2,2] biff [2,3]biff [3,0] biff [3,1] biff [3,2] biff [3,3]If and are omitted, the origin for both rows and columns willbe the default matrix origin. The pre-set default table origin is zero. The default matrix originmay be reset using the SET DEFAULT ORIGIN MATRIX statement or may be set using thePreference Editor. and must be constants. and are numeric scalar expressions specifying the number of rows andcolumns in the matrix variable. If or is non-integer, it will be convertedto integer. If and are omitted, the number of rows and columns will bedeferred until the first assignment statement assigning a value to the variable name. At thatpoint, the number of rows and columns in the expression being assigned to this variabledetermines the size of the matrix.RASTER DeclarationsThe most basic format of a raster declaration is: RASTER ; and/or are optional. If is omitted, data type defaults toINTEGER.Raster objects may not be declared as COLOR or STRING data types. is one of the following:()(:)(:) is an integer constant specifying the index for the first layer of the raster. Forexample, if a raster is declared as:RASTER buffy (0:7);14<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RASTER Declarationsthen buffy (0) is the first layer of the raster and buffy (6) is the last layer.If is omitted, the origin will be the default raster origin. The pre-set default rasterorigin is one. The default table origin may be reset using the SET DEFAULT ORIGINRASTER statement or may be set using the Preference Editor. must be a constant. is a numeric scalar expression specifying the number of layers in the raster variable. If is non-integer, it will be converted to integer.If is omitted, the number of layers will be set by the first assignment to the variable. Ifthe variable is associated with a raster file as described in the next section, the number of layersmay be determined by the file.Using FilesRASTER variables may be associated with one or more layers of an image file within thedeclaration statement. The image file may be either an already existing file, a new file, or newlayers within a file which the <strong>Modeler</strong> will create. There is a variety of keywords which youmay use in the declaration to control the data type and various other parameters used whencreating a new image file.The format for declaring a raster variable associated with a file is: RASTER FILE ; and are described in the previous section, Basic RasterDeclarations.If is omitted from , the number of layers will be set either by the number oflayers specified in or by the first assignment to the variable. If the component is present in the declaration, the number of layers for the raster maybe determined by . (See the examples at the end of this section.) Otherwise, thenumber of layers for the raster will be deferred until the first assignment statement assigning avalue to the variable name. At that point, the number of layers in the expression being assignedto this variable determines the size. may be any combination of parameters which specify how new layersshould be created, criteria to test against existing layers, or how layers are to be read. Fileparameters include:OLDNEWDELETE_IF_EXISTINGINPUTOUTPUTINTEGERFLOATCOMPLEX64 BIT128 BITSINGLEDOUBLETHEMATICCATEGORICALATHEMATICCONTINUOUS<strong>Reference</strong> <strong>Manual</strong>15


Declaration StatementsSIGNEDUNSIGNEDNEAREST NEIGHBORBILINEAR INTERPOLATION1 BIT CUBIC CONVOLUTION2 BIT WINDOW 4 BIT AOI 8 BIT BIN 16 BIT EDGE REFLECT32 BIT EDGE FILLU1U2U4U8U16U32S8S16S32F32F64C64C128UNSIGNED_1_BITUNSIGNED_2_BITUNSIGNED_4_BITUNSIGNED_8_BITUNSIGNED_16_BITUNSIGNED_32_BITSIGNED_8_BITSIGNED_16_BITSIGNED_32_BITFLOAT_SINGLEFLOAT_DOUBLECOMPLEX_SINGLECOMPLEX_DOUBLEThese parameters will be discussed in detail in the next section. is a STRING constant which may contain either the name of a file or the nameof a file followed by a list of layers from the file.For example:"/usr/data/mobbay.img"would specify all layers in the file /usr/data/mobbay.img."/usr/data/mobbay.img(:Layer_4,:Layer_2,:Layer_1)"specifies layers 4, 2, and 1 (in that order) from /usr/data/mobbay.img.If explicit layer names are included in the component, and a size is specifiedin the declarations (with ), the number of layers must match the number specified inthe size. If no layer names are specified, the total number of layers in the file must match thespecified size (from ). See Examples of Raster Declarations.16<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RASTER DeclarationsThe <strong>Modeler</strong> will create temporary files for raster variables which are not associated withfile layers. These temporary files will be deleted when the <strong>Modeler</strong> finishes executing themodel.These temporary files will be created in the “Temporary File Directory” specified in thePreference Editor. The default is /tmp. If there is not enough space in /tmp for these files,you may wish to change the directory in which the <strong>Modeler</strong> creates temporary files bychanging the preference.File ParametersThe following keywords and parameters may be inserted in any order between the FILEkeyword and the parameter. Generally, these keywords specify how new filesor layers are to be created, or test conditions on existing files.Existence ParametersExistence parameters specify whether the layers named in are expected toalready exist at the time the model is run. They include:OLDIf OLD is present, the layers must already exist.Otherwise, an error is reported.NEWDELETE_IF_EXISTINGIf NEW is present, the layers must not exist. If they do,an error is reported.If DELETE_IF_EXISTING is present, and the layersalready exist, they will be deleted immediately, andthen recreated by the model.If none of the existence parameters is present, the <strong>Modeler</strong> will open the layers if they exist, orcreate them if they do not exist.Access ParametersAccess parameters specify access to the layers. They include:INPUTSpecifies that only read access is allowed to theselayers. An error occurs if the model assigns a value tothe associated variable. INPUT and NEW, or INPUTand DELETE_IF_EXISTING are incompatible.OUTPUTSpecifies read and write access to layers.If no access parameter is specified, read and write access are permitted.Data Type ParametersThe data type parameters control which of the following data types is used for the layersspecified in the declaration:INTEGERSpecifies one of the integer data types.<strong>Reference</strong> <strong>Manual</strong>17


Declaration StatementsFLOATCOMPLEXSIGNEDUNSIGNEDSpecifies one of the floating point data types.Specifies one of the complex data types.Specifies a signed integer type.Specifies an unsigned integer type.1 BIT 1-bit unsigned integer.2 BIT 2-bit unsigned integer.4 BIT 4-bit unsigned integer.8 BIT 8-bit integer data (signed or unsigned).16 BIT 16-bit integer data (signed or unsigned).32 BIT 32-bit integer data (signed or unsigned) or single precision float.64 BIT Specifies double precision float or single precision complex.128 BIT Specifies double precision complex.SINGLEDOUBLEU1UNSIGNED_1_BITU2UNSIGNED_2_BITU4UNSIGNED_4_BITU8UNSIGNED_8_BITU16UNSIGNED_16_BITU32UNSIGNED_32_BITS8SIGNED_8_BITS16SIGNED_16_BITS32SIGNED_32_BITF64FLOAT_DOUBLESpecifies single precision float or complex. FLOAT is used unlessCOMPLEX is specified or default is COMPLEX type.Specifies double precision float or complex. FLOAT is used unlessCOMPLEX is specified or default is COMPLEX type.1-bit unsigned integer.2-bit unsigned integer.4-bit unsigned integer.8-bit unsigned integer.16-bit unsigned integer data.32-bit unsigned integer data.8-bit signed integer.16-bit signed integer data.32-bit signed integer data.Specifies double precision float.18<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RASTER DeclarationsC64COMPLEX_SINGLEC128COMPLEX_DOUBLESpecifies single precision complex.Specifies double precision complex.These data type parameters may be used together in any consistent combination. If anyambiguity about the data type persists after all data type parameters are specified, the defaultdata types are used to resolve the ambiguity.An error is reported if contradictory data type parameters are specified such as SIGNEDFLOAT, 32 BIT COMPLEX, or SINGLE 16 BIT. An error will also be reported if redundantdata type parameters are used together such as SIGNED S32.Layers of image files in IMAGINE may be any of the following data types:1-bit unsigned integer2-bit unsigned integer4-bit unsigned integer8-bit unsigned integer8-bit signed integer16-bit unsigned integer16-bit signed integer32-bit unsigned integer32-bit signed integer32-bit (single precision) floating point64-bit (double precision) floating point64-bit (single precision) complex128-bit (double precision) complexIf the specified layers already exist, these parameters are checked against the data type of thelayers. If the layer data type is incompatible with the data type parameter, an error is reported.Default Data TypesIf the specified layers do not exist, the data type of the variable defines the default data type forthe new layers. The default data types are:• BINARY variable: 1-bit unsigned integer• INTEGER variable: 8-bit unsigned integer• FLOAT variable: 32-bit (single precision) floating point• COMPLEX variable: 64-bit (single precision) floating pointThe default file data types for each modeler data type may be altered using the SET DEFAULT statement or using the Preference Editor.<strong>Reference</strong> <strong>Manual</strong>19


Declaration StatementsLayer Type ParametersLayer type parameters include:THEMATICCATEGORICALATHEMATICCONTINUOUSThese parameters identify layers as either thematic (categorical), or athematic (continuous).Various programs in IMAGINE will treat thematic and athematic data differently.• THEMATIC or CATEGORICAL - use thematic layers• ATHEMATIC or CONTINUOUS - use athematic layers• THEMATIC and CATEGORICAL are incompatible with signed integer, floating point,and complex data, and these combinations will cause errors.Interpolation ParametersInterpolation parameters determine the resampling method that will be used if an existinglayer is not the same resolution as the Working Window.NEAREST NEIGHBORBILINEAR INTERPOLATIONCUBIC CONVOLUTIONThe default interpolation is NEAREST NEIGHBOR. The default interpolation type may bechanged using the SET DEFAULT INTERPOLATION statement or using the PreferenceEditor. New layers are always the same resolution as the Working Window, so interpolation isnot used for new layers.Window SpecificationThe window specification sets a window on input layers. The format of the windowspecification is:WINDOW , : MAPorWINDOW , : PIXELorWINDOW , : FILEThe coordinates in the window specifications must be constants. Window specifications areignored for output layers.See Setting Windows for more information about layer windows.Area of Interest SpecificationThe AOI specification sets an area of interest on input layers. The format of the AOIspecification is:AOI 20<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RASTER Declarations is a string constant containing the name of a file that contains an area of interest.When the data file is read, areas outside the AOI will be set to the background value. The AOIspecification is ignored if used in the declaration of an output file.AOI NONEThis indicates that no area of interest is to be used.See also the SET AOI statement for setting an area of interest on a model. Setting an AOI onan input file rather than on the model changes when the AOI is applied. For example, using theSEARCH function on a layer with an AOI would cause the function to search only from searchclass pixels inside the AOI. On the other hand, SEARCH applied to a file without an AOI, butinside a model with an AOI, would search from all search class pixels in the Working Window.The AOI is then applied to the output of the SEARCH function.Statistics ParametersStatistics parameters determine which values in the data file will be used or ignored for thecomputing of final statistics or in Global functions. Statistics parameters include:USEALL Use all values present in the data file for computing statistics or global functions. is optional and is not used if present.IGNORE Ignore when computing stats and global functions. may be omitted, in which case zero values are ignored., if present, must be a numeric constant.The default for statistics is USEALL. The default statistics computation may be changed usingthe SET DEFAULT STATISTICS statement, or using the Preference Editor.Bin Function SpecificationThe bin function specification controls the bin function used in new output layers. The binfunction specification may indicate:• the type of bin function,• the type and number of bins or type,• number of bins, minimum and maximum.If the bin function is completely specified, the descriptor table for each layer is created whenthe layer is created. If the bin function is only partially specified, the descriptor table is notcreated until the end of model execution, at which time statistics are computed, and theminimum and maximum used for the bin function are derived from the statistics.See Bin Functions for an explanation of how bin functions are used.The general format of a bin function specification is:BIN However, the bin function specification may be any of the following formats:BIN DIRECT DEFAULT<strong>Reference</strong> <strong>Manual</strong>21


Declaration StatementsUse direct binning. The number of bins and offset are derived from statistics. The offset will bethe minimum value (rounded to integer if necessary), the number of bins will be:maximum (rounded if necessary) - minimum + 1Exception: if THEMATIC is present, zero is used as the minimum, rather than the minimum filevalue. In this case the number of bins is:maximum + 1BIN DIRECT BINSUse direct binning, with an offset of zero, and bins.BIN DIRECT BINS FROM TO Use direct binning, offset , bins. must equal - + 1.BIN LINEAR BINSUse linear binning, bins. Min and max are derived from statistics.BIN LINEAR BINS FROM TO Use linear binning, bins, and specified.BIN LOG BINSUse logarithmic binning, bins. Min and max are derived from statistics.BIN LOG BINS FROM TO Use logarithmic binning, bins, and specified., and must be constants.Edge Extension SpecificationThe edge extension specification specifies how the edge of the data file is to be handledby neighborhood functions. Since the focus or kernel used by the neighborhood functiontypically extends beyond the edge of the data, the function must generate data values for pixelsoutside the edge. The specification is:EDGE REFLECTorEGDE FILLEGDE REFLECT specifies that data file values should be reflected around the edge of the datafile to generate pixels outside the edge. EGDE FILL specifies that pixels outside the edge of thedata are given the background value. The default is EDGE FILL.Examples of Raster DeclarationsRASTER joe;This declares a raster variable named joe, which is not associated with a file. The number oflayers in joe will be determined when an assignment is made to joe.RASTER bob (3);This declares a raster variable named bob with three layers.RASTER henry FILE OLD "/usr/data/mobbay.img";22<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RASTER DeclarationsThis declares a raster variable named henry, which is associated with all the layers of theexisting file /usr/data/mobbay.img. If /usr/data/mobbay.img does not exist, the fileparameter OLD causes an error to occur. The variable henry has the same number of layers asthe file /usr/data/mobbay.img.RASTER bob (3) FILE OLD "/usr/data/mobbay.img";This declares a raster variable named bob, which is associated with all the layers of the existingfile /usr/data/mobbay.img. If /usr/data/mobbay.img does not exist, the file parameterOLD causes an error to occur. The variable henry is declared to have three layers. If/usr/data/mobbay.img does not have exactly three layers, an error occurs.RASTER muddy FILE OLD"/usr/data/mobbay.img(:Layer_4,:Layer_2,:Layer_1)";This declares a raster variable named muddy, which is associated with the listed layers of theexisting file /usr/data/mobbay.img. The variable muddy will have three layers, since threelayers were listed in the component.RASTER skipper (3) FILE OLD"/usr/data/mobbay.img(:Layer_1,:Layer_2)";This will cause an error to occur, since skipper is declared to have three layers, but two layerswere listed in the component.RASTER susie FILE NEW "/usr/data/newfile.img";This will create a new image file named /usr/data/newfile.img. The number of layers in thefile, and the number of layers in the variable susie will be determined when an assignment ismade to the variable susie. If the file /usr/data/newfile.img already exists, the file parameterNEW will cause an error to occur.RASTER jill FILE NEW"/usr/data/newfile.img(:Layer_1,:Layer_2)";This declares the variable jill with 2 layers. If :Layer_1 or :Layer_2 is the name of an existinglayer in the file /usr/data/newfile.img, an error occurs.RASTER sam (3) FILE DELETE_IF_EXISTING"/usr/data/newfile.img";This creates a new file named /usr/data/newfile.img with three layers. If there alreadyexisted a file called /usr/data/newfile.img, it is deleted first. Since no layer names arespecified, the layers will be given the default names :Layer_1, :Layer_2, and :Layer_3.Data Type ExamplesAny data parameters in the declaration will modify the data type for the output layers based onthe defaults. For example:INTEGER RASTER a FILE NEW SIGNED "/usr/data/newfile.img";Specifies that the layers of /usr/data/newfile.img will be 8-bit signed integer type.You may specify any data type for the layers, regardless of the data type of the variable. Forexample, the following are valid declarations:BINARY RASTER b FILE DOUBLE COMPLEX"/usr/data/complexfile.img";COMPLEX RASTER c FILE 1 BIT "/usr/data/binaryfile.img";The data types are converted automatically when reading from or writing to the file layers.<strong>Reference</strong> <strong>Manual</strong>23


Declaration StatementsVECTOR DeclarationsVector data in either a vector coverage or annotation layer can be read directly into the modeler,converted from vector to raster, then processed similarly to raster data. This is accomplished bydeclaring a VECTOR variable, which functions similarly to a read-only RASTER variable. Themodeler cannot write to coverages or annotation layers.VECTOR variables must be associated with an existing vector coverage or annotation layerwithin the declaration statement. The format for declaring a vector variable is: VECTOR COVER ;or VECTOR ANNOTATION ; is optional. If is omitted, data type defaults to INTEGER.Vector objects may not be declared as COLOR or STRING data types.Vector objects always have only one layer.COVER indicates that is the name of a vector coverage. ANNOTATIONindicates that is the name of a file containing an annotation layer. may be any combination of parameters which specify how vector layers arerasterized. Parameters include:WINDOW AOI CELLSIZE LINEPOINTPOLYGONRENDER TO TEMPFILERENDER TO MEMORYLINE, POINT and POLYGON parameters are used only for coverages, not annotationlayers.These parameters will be discussed in detail in the next section. is a STRING constant which contains the name of a coverage. is a STRING constant which contains the name of an annotation file.ParametersThe following keywords and parameters may be inserted in any order between the COVERkeyword and the parameter or between the ANNOTATION keyword and the parameter. Generally, these keywords specify how the vector data is to berasterized.24<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


VECTOR DeclarationsWindow SpecificationThe window specification sets a window on the input layer. The format of the windowspecification is:WINDOW , : MAPThe coordinates in the window specifications must be constants.See Setting Windows for more information about layer windows.Area of Interest SpecificationThe AOI specification sets an area of interest on the input layer. The format of the AOIspecification is:AOI is a string constant containing the name of a file that contains an area of interest.When the data file is read, areas outside the AOI will be set to the background value. The AOIspecification is ignored if used in the declaration of an output file.AOI NONEThis indicates that no area of interest is to be used.See also the SET AOI statement for setting an area of interest on a model. Setting an AOI onan input file rather than on the model changes when the AOI is applied. For example, using theSEARCH function on a layer with an AOI would cause the function to search only from searchclass pixels inside the AOI. On the other hand, SEARCH applied to a file without an AOI, butinside a model with an AOI, would search from all search class pixels in the Working Window.The AOI is then applied to the output of the SEARCH function.Cellsize SpecificationThe CELLSIZE specification sets the default cell size to use in rendering the vector data. Theformat of the CELLSIZE specification is:CELLSIZE , and are numeric constants. is either METERS, FEET, INCHES, RADIANS, or any other units listed in the file$IMAGINE_HOME/etc/units.dat. Units and coordinates from input layers are converted tothe units specified here, if necessary.The vector data will always be rasterized to the cell size of the Working Window. If there is aSET CELLSIZE statement in the model which sets an explicit cell size for the WorkingWindow, this parameter will be ignored. Otherwise, this cell size specification is used incomputing the Working Window cell size using the cell size rule. See Setting Windows formore info.If there is no SET CELLSIZE statement specifying an explicit cell size, and no input RASTERlayers to establish the cell size of the Working Window, a CELLSIZE specification is requiredin the VECTOR declaration to establish the cell size to use for the Working Window. If theWorking Window cell size has not been established by the time the modeler attempts to readfrom the vector data, an error is reported.<strong>Reference</strong> <strong>Manual</strong>25


Declaration StatementsFeature Type SpecificationThe feature type specification is one of the following:LINEPOINTPOLYGONThe feature type specification determines which type of features are to be rasterized from avector coverage. Feature type specifications may only be used with vector coverages, not withannotation layers. If this specification is not present the feature type to be rasterized isdetermined from the types of features present in the coverage.Rendering Method SpecificationThe rendering method specification specifies how the vector data should be rendered bythe modeler. The two options areRENDER TO TEMPFILERENDER TO MEMORYRENDER TO TEMPFILE specifies that the entire vector coverage or annotation layer will berasterized into a temporary file up front by the modeler, and subsequently is treated as any otherraster temp file. RENDER TO MEMORY specifies that the vectors or annotation are renderedtile by tile into memory without using any temporary disk space. Rendering tile by tile may beefficient enough when there is a relatively small number of relatively simple vector features tobe rendered. However, if there is a large number of complicated features each with a largegeographic extent, it is likely that rendering to a temporary file will be much more efficient,although it would require more disk space. If no rendering method is specified, RENDER TOMEMORY is used by default.The temporary files will be created in the “Temporary File Directory” specified in thePreference Editor. The default is /tmp. If there is not enough space in /tmp for these files,you may wish to change the directory in which the <strong>Modeler</strong> creates temporary files bychanging the preference.26<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ConstantsExpressionsExpressions are the basic building blocks of most <strong>Modeler</strong> statements. Expressions consistof constants and variables linked together by operators and functions. Every expressionrepresents an object in the <strong>Modeler</strong>. An expression has a data type and an object type. Thedata type and object type for an expression are determined by the types of the constants andvariables it is built from, together with the Standard Rules for combining types for eachoperation or function involved.It is possible to create expressions which have data and object type combinations whichare not supported in variable declarations, such as color matrices and string rasters.ConstantsConstants are SCALAR objects with a fixed value. Constants may be any data type. Thereare six types of constants:• Binary• Integer• Float• Complex• Color• StringEach type is explained in the following:Binary ConstantsTRUEDEFAULTFALSEvalue of 1 or "true" logical valuevalue of 1 or "true" logical valuevalue of 0 or "false" logical valueInteger ConstantsAny numeric value between -2,147,483,648 and 2,147,483,647 which does not contain adecimal point or scientific notation is an integer constant.Examples:601-43Float ConstantA numeric value containing a decimal point, in scientific notation, or outside the 32-bit signedinteger range.<strong>Reference</strong> <strong>Manual</strong>27


ExpressionsExamples:1.-.0003454e3PI is also recognized as a float constant 3.141592653589793.Complex ConstantsComplex constants have the form (, ), where and are float or integer constants.Examples:(1, 0)(.07, 4e13)Color ConstantsColor constants have the form (, , ), where , , and are float or integer constants.Examples:(1, 1, 0)(.5, .3, .1)The values for red, green, and blue should be in the range 0.0 to 1.0 when the color is going tobe used in a color table by the <strong>Modeler</strong>. However, values outside this range are allowed.For example, you can create color constants such (255, 0, 255) and (128, 255, 0). If the 0-255scale is used, at some point later in the model, the values should be divided by 255 before theyare output to a color table.Example:RASTER out NEW OUTPUT "/usr/data/newfile.img";COLOR TABLE ct COLORTABLE out;...# initialize table using colors in 0-255 rangect = TABLE ( (0,0,0),(255,255,0),(0,255,128),(240,120,120),(0,220,255) );...ct = ct / 255.;#divide by 255 so that output is in 0-1 rangeString ConstantsString constants are any sequence of characters enclosed in double quotes.Examples:28<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Using Operators and Functions"water""deciduous forest land"Variable <strong>Reference</strong>sVariable references are expressions which retrieve the value stored in a variable. A variablereference is simply the variable name.For example, if the variable bob is declared as:INTEGER RASTER bob FILE OLD"/usr/data/mobbay.img(:Layer_4,:Layer_2,:Layer_1)";Then the expression:bobwould cause data to be read from the specified layers of /usr/data/mobbay.img into theexpression object.In most cases, you may not use a variable of undefined size in an expression. A variable hasundefined size if its size was not specified in its declaration, and no assignment has been madeto the variable that would determine its size. There is one exception to this rule:• in a TABLE declaration when you associate a table with a descriptor column that will becreated by the model.In this case, one layer is assumed.Previous versions of the modeler required variable references to be prefaced with the $character. This is now optional. In the current version, any valid expression may bepreceded by $, which will be ignored.Using Operators andFunctionsConstants and variable references are combined in expressions using operators andfunctions. For example:If biff is declared asMATRIX biff [3, 4];thenbiff + 1creates a new 3 row and 4 column matrix object with one added to the value of each element ofbiff.If sid and tom are declared as:TABLE sid [10];TABLE tom [10];thenmax (sid, tom)creates a new 10 row table. The value in the first row of the new table will be the maximum ofthe first row of sid and the first row of tom, the second row contains the maximum of thesecond rows of sid and tom, and so forth.See Model Function Categories for a description of each operator and function in the<strong>Modeler</strong>.<strong>Reference</strong> <strong>Manual</strong>29


ExpressionsTable SubexpressionsTable subexpressions define new objects which are copied from portions of a tableexpression. Table subexpressions have one of the following forms: []This expression results in a SCALAR object. [ : ]This expression results in a TABLE object with - + 1 rows., , and are SCALAR numeric expressions. They are converted toINTEGER data type if necessary.Examples:If sid is declared as:FLOAT TABLE sid [0:10];then sid is a table with 10 rows numbered 0 to 9, andsid [9]will be a floating point SCALAR. The value will be copied from the last row of sid.sid [0:3]will be a floating point table with four rows copied from the first four rows of sid.You may not use a TABLE variable of undefined size in a subexpression.MatrixSubexpressionsMatrix subexpressions define new objects which are copied from portions of a matrixexpression. Matrix subexpressions have one of the following forms: [, ]This expression results in a SCALAR object. [ , : ,]This expression results in a MATRIX object with - + 1 rows and - + 1 columns., , , , , and arescalar numeric expressions. They are converted to INTEGER data type if necessary.Examples:If fred is declared as:COMPLEX MATRIX fred [12, 9];thenfred [6, 7]will be a complex scalar.fred [3, 4:8, 7]will be a complex matrix with six rows and four columns.You may not use a matrix variable of undefined size in a subexpression.30<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Raster Layer StacksRaster Layer StacksRaster layer stacks define new objects which are copied from portions of a raster expression.Raster layer stacks have one of the following forms. () is a list of ranges of layer numbers separated by commas:, , ...Each may either be a single layer number or a and separated by a colon:or:, , and are scalar numeric expressions. They are convertedto INTEGER data type if necessary.The new raster will be a copy of the layers specified in layer list in the order listed.Example:If biff is declared as:RASTER biff (12);thenbiff (8, 2:6, 1, 10:11)will be a raster with 9 layers: layers 8, 2, 3, 4, 5, 6, 1, 10, and 11 of biff in that order.You may not use a raster variable of undefined size in a raster layer stack.<strong>Reference</strong> <strong>Manual</strong>31


Expressions32<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Object Type Assignment CompatibilityAssignmentStatementsAn assignment statement is used to assign the value of an expression to a variable. Thebasic form of an assignment statement is: = ;You can also make assignment to subexpressions of tables and matrices, or to raster layerstacks: [] = ; [ : ] = ; [, ] = ; [ : , :] = ; () = ;Example AssignmentsSTRING TABLE bob [10];bob = "hello, world";bob [9] = "goodbye, cruel world";These two assignment statements assign the string constant "hello, world" to all rows of thetable bob, then the last row is changed to "goodbye, cruel world."RASTER biff (12);RASTER buff (9);biff (8, 2:6, 1, 10:11) = buff;This assignment copies all layers of buff to the layers listed for biff.Data Type AssignmentCompatibilityThe following are the rules for assigning expressions of particular data types to variables:• An expression may be assigned to a variable of the same data type (assuming object typecompatibility - see next section).• A numeric expression (BINARY, INTEGER, FLOAT, or COMPLEX) may be assignedto a numeric variable. Numeric conversion will be performed.• A numeric expression may be assigned to a COLOR variable. The red, green, and bluecomponents will all receive the same value.• A COLOR expression may not be assigned to a numeric variable, with one exception notedin the next section.STRING expressions may be assigned only to STRING variables.Object TypeAssignmentCompatibilityThe following are the rules for assigning expressions of particular object types to variables:• An expression may be assigned to a variable (or subtable, submatrix, or raster layer stack)of the same object type and size.• An expression may be assigned to a variable of the same object type whose size has not yetbeen defined. The assignment statement will define the size of the variable, and allsubsequent assignments to this variable must conform to this size.<strong>Reference</strong> <strong>Manual</strong>33


Assignment Statements• A SCALAR expression may be assigned to a variable of any object type. All elements ofthe variable are assigned the same value.• A SCALAR expression may be assigned to a variable of another object type of undefinedsize. The variable size will be set to one (i.e., one row for a table, one row and one columnfor a matrix, and one layer for a raster).• A one layer raster expression may be assigned to a multiple layer raster variable. The singlelayer is copied to each layer of the variable.• A table expression may be assigned to a raster variable which has the same number oflayers as the table has rows. Each layer of the raster variable is filled with the value fromthe corresponding row of the table expression.• A COLOR SCALAR expression may be assigned to a three layer RASTER variable. Thered value of the expression fills the first layer of the variable, the green value fills thesecond layer, and the blue value fills the third.Any assignment statement which does not conform to these rules will cause an error to bereported.34<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


VIEW StatementASCII Input-OutputStatementsThe SHOW, READ, and WRITE statements allow you to input and output objects to and fromASCII format.• The SHOW statement prints the values in a SCALAR, MATRIX, or TABLE object tostandard output.• The READ statement reads a SCALAR, MATRIX, or TABLE object from an input ASCIIfile.• The WRITE statement writes a SCALAR, MATRIX, or TABLE object to an output ASCIIfile.SHOW StatementREAD StatementWRITE StatementThe SHOW statement has the form:SHOW ;orSHOW , , ... ;The contents of each expression object are printed to the standard output. If the <strong>Modeler</strong> is runfrom IMAGINE, the standard output is the Session Log. All expressions in a SHOW statementmust be a SCALAR, TABLE, or MATRIX object type.The READ statement reads a SCALAR, MATRIX, or TABLE object from an input ASCII file.The form of the READ statement is:READ FROM ; must be a scalar, matrix, or table object. If the size of the object has not yet beendefined, it will be determined from the number of columns and lines of data in the ASCII file. is a string constant containing the name of an ASCII file. The file should containthe same number of rows as the object. The individual elements of a single row should beseparated by white space (spaces or tabs). There must not be any extra blank lines in the file, oran error will occur. Only one object must be contained in the file. READ statements cannot readmultiple objects from the same file.The WRITE statement writes a SCALAR, MATRIX, or TABLE object to an output ASCII file.The form of the WRITE statement is:WRITE TO ; must be a scalar, matrix, or table object. is a string constant containing the name of an ASCII file. The file will contain thesame number of rows as the object. The individual elements of a single row will be separatedby spaces. Only one object can be written to an ASCII file using the WRITE statement. Anyprevious contents of the ASCII file will be deleted when a WRITE statement is encountered.VIEW StatementThe VIEW statement, which was supported in earlier versions of the modeling languageis no longer supported.<strong>Reference</strong> <strong>Manual</strong>35


ASCII Input-Output Statements36<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Set StatementsSet StatementsBy default, the Working Window at any point in a model will be the union of the windows forall layers from existing files associated with variables declared up to that point in the model. Ifinput files are georeferenced, the Working Window will be the union of the map coordinatewindows defined for each input layer. If any input file is georeferenced, all input files must begeoreferenced using the same projection. The default cell size is the minimum of the cell sizesof all input layers.If all input files are non-georeferenced, the default Working Window will be as wide as thewidest input layer window and as long as the longest input layer window. The upper left cornersof each input layer window are overlaid.The SET WINDOW and SET CELLSIZE statements are used to change the WorkingWindow. The formats of these statements are explained below.SET WINDOWSET WINDOW INTERSECTION;If this is the first statement in the model, the Working Window will be set to the intersection ofthe windows from all existing layers declared in the model.If existing input layers have already been declared, the current Working Window will alreadyhave been set to the union of the already declared layers' windows. After this statement,declaring any more input layers will intersect the Working Window with the new windows.SET WINDOW UNION;This statement sets the Working Window computation rule back to union, the default.The “Default Window Rule” preference can be changed using the Preference Editor to changethe default from Union to Intersection.SET WINDOW ,:,MAP;This statement sets the Working Window to the map coordinate area explicitly specified in thestatement. All input layers must be georeferenced to the same projection.SET WINDOW ,:,PIXEL;orSET WINDOW ,:,FILE;This statement sets the Working Window to the pixel coordinates explicitly specified in thestatement. , , , and are allnumeric constants. You may set pixel windows for georeferenced or non-georeferenced inputlayers. If the input layers are georeferenced, then the specified pixel window is applied relativeto the pixels of the current Working Window, and converted into a map coordinate window.Coordinates used in the SET WINDOW statement must be constants.SET CELLSIZESET CELLSIZE MAX;<strong>Reference</strong> <strong>Manual</strong>37


Set StatementsThis statement causes the cell size for the working window to be computed from the maximumcell size of input layers rather than the minimum.SET CELLSIZE MIN;This statement resets the cell size computation rule to use the minimum input cell size, whichis the default.The “Default Cellsize Rule” preference can be changed using the Preference Editor to changethe default rule for the Working Window cell size from Minimum to Maximum.SET CELLSIZE , ;Set the cell size for the Working Window to the specified size. and are numeric constants. is either METERS, FEET, INCHES, RADIANS, or any other units listed in the file/usr/imagine/etc/units.dat. Units and coordinates from input layers are converted to theunits specified here, if necessary.All forms of the SET CELLSIZE statement may be used only with georeferenced input layers.Cell sizes in the SET CELLSIZE statement must be constants.All new output layers created by the <strong>Modeler</strong> have size and georeferencing informationdetermined by the current Working Window at the time of their creation. Output layers arecreated when the first assignment is made to the variable associated with the output layers. Youmay output to existing layers, but only if the size and resolution of the existing layer exactlymatches the Working Window. Unexpected results may occur otherwise.Other SET StatementsSET AOIThis statement sets an area of interest (AOI) for the model.SET AOI ; is a string constant containing the name of a file that contains an area of interest.This sets the area of interest for the model. All functions will return 0 for pixels that are insidethe Working Window but outside the area of interest.Note that setting the AOI does not affect the Working Window. To set the Working Window tothe bounding rectangle of the AOI, you must determine the bounding area of the AOI using acursor box in the Viewer, and then use a SET WINDOW statement to set the Working Window.SET AOI NONE;This indicates that no area of interest is to be used.See also Area of Interest Specification for RASTER or VECTOR file declarations.SET DEFAULT This statement has the form:SET DEFAULT is either BINARY, INTEGER, FLOAT, or COMPLEX.38<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Other SET Statements is any valid combination of data type or layer type parameters usedin raster declarations.This statement resets the default file layer data type associated with raster variables of aparticular <strong>Modeler</strong> data type, based on the pre-set defaults. For example:SET DEFAULT INTEGER SIGNED;The pre-set default file layer data type for INTEGER variables is 8-bit unsigned integer. Thisstatement changes the default to 8-bit signed integer.The pre-set defaults for each data type may be changed using the Preference Editor.SET DEFAULT ORIGINThis statement has the form:SET DEFAULT ORIGIN is either TABLE, MATRIX, or RASTER. is an integer constant (usually 0 or 1).This statement resets the default origin for table rows, matrix rows and columns, or raster layers.The pre-set default for tables and matrices is 0. The pre-set default for raster layers is 1.The pre-set defaults for the origin of each object type may be changed using the PreferenceEditor.SET DEFAULT INTERPOLATIONThis statement has the form:SET DEFAULT INTERPOLATION orSET DEFAULT INTERPOLATION where: is either NEAREST NEIGHBOR, BILINEAR INTERPOLATION, orCUBIC CONVOLUTION. is either THEMATIC or ATHEMATIC.This sets the default interpolation type to be used when reading from existing layers of differentresolution than the Working Window. The parameter controls whether this defaultis set for thematic or athematic files. If is omitted, the specified interpolation typeis set for both file types.The pre-set default for both types is NEAREST NEIGHBOR. The pre-set default may bechanged using the Preference Editor.SET DEFAULT STATISTICSThis statement allows you to set a background value which will be ignored when statistics orglobal functions are computed, or to specify that all values be used.SET DEFAULT STATISTICS USEALL Use all values present for computing statistics or global functions. isoptional and is not used if present.SET DEFAULT STATISTICS IGNORE <strong>Reference</strong> <strong>Manual</strong>39


Set StatementsIgnore when computing stats and global functions. may be omitted, in which case zero values are ignored., if present, must be a numeric constant.The pre-set default for statistics is USEALL. The pre-set default statistics computation may bechanged using the Preference Editor.SET TILESIZERaster objects are processed by the <strong>Modeler</strong> in tiles. The tile size determines how many pixelsof raster data are processed in each tile. The default tile size is 64 by 64 pixels. You may changethe tile size using the SET TILESIZE statement:SET TILESIZE , ; and are integer constants.SET RANDOM SEEDThe RANDOM function normally generates numbers from a seed derived from the current time,so that each sequence of numbers generated may be different. To guarantee that the samesequence of random numbers is generated each time a model is run, you may set a seed for therandom number sequence using the SET RANDOM SEED statement:SET RANDOM SEED ; is an integer constant.Whenever the same seed is used, the same sequence of pseudo-random numbers will begenerated by the RANDOM function.40<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statement BlocksQUIT StatementAfter the <strong>Modeler</strong> executes the QUIT statement, it does not execute any more statements. TheQUIT statement has the form:QUIT;After the QUIT statement is encountered, statistics are computed for all output files, descriptortables associated with table variables are written out, and all files are closed.Statement BlocksStatement blocks collect a group of statements into a block to be executed together.Statement blocks are created by enclosing a group of statements in braces:{...}The most common use for statement blocks is to group a set of raster Assignment statementsinto a block. The entire block will be executed tile-by-tile rather than individual statementsbeing executed tile-by-tile. For example, consider the follow two models:Model A:RASTER in OLD INPUT "mobbay.img";RASTER out1 NEW OUTPUT "out1.img";RASTER out2 NEW OUTPUT "out2.img";out1 = in + 5;out2 = in * 2;QUIT;Model B:RASTER in OLD INPUT "mobbay.img";RASTER out1 NEW OUTPUT "out1.img";RASTER out2 NEW OUTPUT "out2.img";{}QUIT;out1 = in + 5;out2 = in * 2;In model A, each 64 by 64 pixel tile is read from mobbay.img. Then 5 is added to each pixelin the tile, and the tile is written into out1.img. After this is complete, the tiling starts again atthe beginning of mobbay.img and multiplies each tile by 2, and writes the output toout2.img.In model B, each tile from mobbay.img is read only once. 5 is added to the tile and written toout1.img; then the tile values from mobbay.img are multiplied by 2 and written toout2.img. Since each tile from mobbay.img is read only once, rather than twice, model Bruns faster than model A.<strong>Reference</strong> <strong>Manual</strong>41


Flow ControlNot every function can be executed tile-by-tile. Point functions are executed tile by tile.Neighborhood functions on existing layers are executed tile-by- tile. Neighborhoodfunctions operating on intermediate results require a temporary file to be createdbeforehand. Global, Zonal, and Layer functions do not operate tile-by-tile. Seeindividual operators and functions to determine function type.Variables declared inside a statement block are only defined within the statement block. Thevariable name will not be defined after the end of the statement block.Generally, statement blocks are used for grouping together raster assignments or used in flowcontrol. There are certain combinations of statements you should avoid putting into statementblocks:Do not declare a variable whose size is a non-constant expression in the same statementblock in which an assignment is made to that variable.Do not put SET WINDOW, SET CELLSIZE, SET DEFAULT, or SET TILESIZEstatements in the same block as raster assignments.It is most efficient to group raster assignments sequentially inside a statement block,rather than alternating raster assignments with assignments to other object types, or othertypes of statements.Failure to follow these guidelines can result in errors, unexpected results, or inefficientmodel execution.Flow ControlConditional BranchingIFIF ... ELSEFlow control is used to control the execution of a model, using conditional branching or looping.The various forms of conditional branching are described below:IF () is a numeric SCALAR expression. If zero, it is treated asFALSE; nonzero is treated as TRUE. is a set of statements enclosed in braces. (See Statement Blocks.)If the is TRUE, the statements in areexecuted. If FALSE, they are skipped.IF () ELSE42<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


LoopingIf the is TRUE, the statements in areexecuted and is skipped. If FALSE, isskipped, is executed.IF () ELSE IF () ELSE IF () ...The statement block corresponding to the first SCALAR expression which is TRUE isexecuted. All other statement blocks are skipped. If none of the expressions is true, none of thestatement blocks is executed.IF () ELSE IF () ELSE IF () ...ELSE The statement block corresponding to the first scalar expression which is TRUE is executed.All other statement blocks are skipped. If none of the expressions is true, is executed.UNLESSLoopingWHILEUNTILUNLESS () If the is FALSE, the statements in areexecuted. If TRUE, they are skipped.The forms of looping are described below:WHILE () If is TRUE, the statements in areexecuted. After execution, is evaluated again. If TRUE, is executed again. This is repeated until is FALSE.UNTIL () If is FALSE, the statements in areexecuted. After execution, is evaluated again. If FALSE, is executed again. This is repeated until is TRUE.Note that the in all flow control structures must beSCALAR. to make decisions based on other object types, use the EITHER-IF-OR-OTHERWISE, PICK, or CONDITIONAL functions.The statement block in a flow control structure must be syntactically correct, even if it is notexecuted. Parse-time errors may be reported from statements in a statement block, even thoughthose statements will not be executed.<strong>Reference</strong> <strong>Manual</strong>43


Macro DefinitionsMacro DefinitionsMacro definitions allow you to associate a string of text with a name. Subsequently, wheneverthe name is encountered in the model, it is replaced with the string of text. The syntax of a macrodefinition is:#define Any subsequent occurrences of will be replaced with . Forexample:raster in1 file old ì/usr/data/input1.imgî;raster in2 file old ì/usr/data/input2.imgî;raster out file new ì/usr/data/output.imgî;float matrix kernel [3, 3];kernel = 1. / 9.;#define average ((in1 + in2) / 2)out = average * 2 - convolve (average, kernel);The last statement in this model is equivalent to:out = ((in1 + in2) / 2) * 2 - convolve (((in1 + in2) / 2),kernel);The replacement text consists of all characters, including spaces, following on the linestarting with #define. To continue a macro definition onto the next line, end the line with abackslash (\).The total number of characters in the replacement text, including continuation lines, mustnot be greater than 1024. To define a macro longer than 1024 characters, you can nestthem (i.e. use one macro in the definition of another).44<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Running from the Command LineRunning the<strong>Spatial</strong> <strong>Modeler</strong>Running fromIMAGINEModels can be written, edited, and run from the <strong>Spatial</strong> <strong>Modeler</strong> component or directly from thecommand line as described below. To write or edit models within IMAGINE, left-click the<strong>Spatial</strong> <strong>Modeler</strong> icon from the <strong>ERDAS</strong> IMAGINE icon panel and then left-click the ScriptLibrarian option. You then have access to models generated from Model Maker and the <strong>Spatial</strong><strong>Modeler</strong> <strong>Language</strong>.Model MakerModels written with Model Maker can be run or edited using the tools in Model Maker. Youcan also generate a script from Model Maker that will let you edit the model using the <strong>Spatial</strong><strong>Modeler</strong> <strong>Language</strong>. This may be helpful if you have a general idea for a model and want to“sketch” it out graphically. You can then add to the model with the <strong>Modeler</strong> language bychoosing the Edit option from the Model Maker menu.This technique may also help you learn how to use the <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>. Bygenerating a script from within Model Maker, you can see the correct syntax for generating aparticular model.Although Model Maker is a powerful modeling tool, it does not include all the functionalityavailable with the <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>.Running from theCommand LineYou can run the <strong>Spatial</strong> <strong>Modeler</strong> directly from the command line. The syntax for the <strong>Spatial</strong><strong>Modeler</strong> is:modeler The name of the text file containing the model.Arguments to be passed into the model. The model substitutesthese arguments for the strings ARG1, ARG2, ARG3, etc., inthe model as described below.Any of a set of options described below which control the<strong>Spatial</strong> <strong>Modeler</strong> execution.Model Arguments is a list of arguments: ...Each argument may be any string of characters. When run from the command line, an argumentwhich contains a space should be enclosed in double quotes ("). The shell will remove thequotes before passing the argument to the <strong>Modeler</strong>.The model may contain the strings ARG1, ARG2, ARG3, etc. The <strong>Spatial</strong> <strong>Modeler</strong> willsubstitute for ARG1 in the model, for ARG2, and so forth. Thestring ARGCOUNT may also be used in the model. The integer constant representing thenumber of arguments passed in on the command line will be substituted for ARGCOUNT.<strong>Reference</strong> <strong>Manual</strong>47


Running the <strong>Spatial</strong> <strong>Modeler</strong>The <strong>Spatial</strong> <strong>Modeler</strong> will automatically enclose certain arguments in double quotes beforepassing them to the model, unless the -nq option is included on the command line. Anyargument will be enclosed in quotes before being passed to the model, unless it meets one of thefollowing conditions:• The argument already starts and ends with the double quote character (").• The argument is a valid floating point number.• The argument contains only letters, numbers, or underscore (_) characters.• The argument does not contain any letters, numbers, or underscore characters.So, for example:bob.img or 12*10would be enclosed in quotes, while34.2e12, bob, or +would not be.Example:Suppose the file binaryop.mdl contains:RASTER a FILE OLD INPUT ARG2;RASTER b FILE OLD INPUT ARG4;RASTER c FILE NEW OUTPUT ARG1;c = a ARG3 b;QUIT;Then running the <strong>Spatial</strong> <strong>Modeler</strong> using the command line:modeler binaryop.mdl out.img in1.img + in2.imgwould result in this model being executed after substitutions were made:RASTER a FILE OLD INPUT "in1.img";RASTER b FILE OLD INPUT "in2.img";RASTER c FILE NEW OUTPUT "out.img";c = a + b;QUIT;Note that ARG2, ARG4, and ARG1 were enclosed in quotes, while ARG3 was not.ARGCOUNT is useful for making sure that the model is executed with the correct number ofarguments. In the previous example, we could add as the first line of the model:IF (ARGCOUNT < 4) { QUIT; }This would cause the model to stop executing after the first line if less than 4 model argumentswere included on the command line.48<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statistics Computation and Descriptor Column OutputCommand Line Options may be any combination of the following:-s or -state-m or -meter-nqThese are described below.-s or -stateWhen run from the command line, the -s or -state option causes the <strong>Spatial</strong> <strong>Modeler</strong> to printto standard output a status message which indicates the current status of model execution.-m or -meterWhen run from the command line, the -m or -meter option causes the <strong>Spatial</strong> <strong>Modeler</strong> to printto standard output a message which indicates the progress of the current stage of modelexecution as a percent of total time for that stage. This message has the form:% = For example if the model binaryop.mdl in the previous example were run with the commandline:modeler binaryop.mdl out.img in1.img + in2.img -s -mthe following would be sent to standard output:Initializing...Processing points% = 0 (increases to 100% as file is processed)Computing stats, file: out.img% = 0 (increases to 100% as statistics are computed)All doneWhen you run from an <strong>ERDAS</strong> Macro <strong>Language</strong> (EML) macro, you can use the -statusand -meter options to output the status and percent completion to a progress meter window.-nqThe -nq option disables the automatic enclosure of Model Arguments in double quotes asdescribed in the previous section.StatisticsComputation andDescriptor ColumnOutputAt the completion of model execution, the <strong>Spatial</strong> <strong>Modeler</strong> will compute statistics and ahistogram for each raster layer output by the model. The histogram will be stored in a descriptortable for the layer. The statistics for each layer include:• min• max• mean• standard deviation• mode• median<strong>Reference</strong> <strong>Manual</strong>49


Running the <strong>Spatial</strong> <strong>Modeler</strong>The histogram, mode, and median will depend on the bin function for the layer.ErrorsSee Bin Functions and Raster Declarations for more information on bin functions andhow to change them.The statistics calculation will depend on whether or not you have specified a background valueto be ignored during statistics calculation. You have the option of specifying StatisticsParameters when you declare the raster variable for the output layers, which specify whetheror not a background value is to be ignored. If no statistics parameters were specified ondeclaration, the default statistics option is used. You can change the default statistics optionusing either the SET DEFAULT STATISTICS statement, or the Preference Editor.After the statistics and histogram have been written out, any tables which are associated withdescriptor columns of the layer are also written out to the file. If the table has more rows thanthe number of bins in the descriptor table, only the rows up to the number of bins will be writtenout. If the table has less rows than the number of bins in the descriptor table, the remaining rowsin the descriptor column will be set to 0 for numeric columns, or "" for STRING columns.See Associating Table Variables With Descriptors and Color Tables for more information.Syntax ErrorsWhen the <strong>Spatial</strong> <strong>Modeler</strong> encounters an error, it prints an error message or list of errormessages explaining what error occurred. It also prints the line number in the model, and theword, symbol, or string at which it recognized the error. This may be at or after where the actualproblem in the model is located.For example, suppose newmodel.mdl has as its first two lines:RASTER a FILE "file1.img"RASTER b FILE "file2.img";The first statement is missing the terminating semicolon. The <strong>Spatial</strong> <strong>Modeler</strong> would print thefollowing error:***ERROR NUMBER 1 IN FUNCTION elex_Parse***>>>Error in file newmodel.mdl, line 2parse error: at or near [RASTER]


ErrorsWhen the <strong>Spatial</strong> <strong>Modeler</strong> is run from IMAGINE, the error messages are displayed in theSession Log. When run from the command line, the error messages are printed to standardoutput.Common Causes of ErrorsSome common causes of errors are listed below.• Missing semicolon at the end of a statement.• Mismatched parentheses.• Mixing up parentheses and brackets. Parentheses must be used for raster sizedeclarations and raster layer stacks. Brackets must be used for TABLE and matrixdeclarations and subexpressions.• Subexpression index or layer number out of valid range. Check the origin and size forthe table, matrix, or raster.• Layers specified as NEW already exist.• Attempting to use a file of incorrect format as input, or a corrupted or incomplete file.• Out of disk space for output images.• Out of disk space in /tmp directory. You may be able to prevent this error by changing the“Temporary File Directory” preference in the Preference Editor.• Wrong data type or object type for function or operation.• Invalid mixture of object types as inputs to a function.• Assignment of expression of one object type or size to an incompatible object type or size.• Using variable with undefined size in an expression.• Wrong number of arguments to a function.• Mixing input files which are not georeferenced to the same projection type, or mixinggeoreferenced and non-georeferenced files.• Misspelled name for descriptor columns.• Using a reserved keyword as a variable name.• Using non-scalar expressions where a scalar expression is required.• Using an expression where a constant is required.• Attempting to use a variable declared inside a statement block outside that statementblock.<strong>Reference</strong> <strong>Manual</strong>51


Running the <strong>Spatial</strong> <strong>Modeler</strong>• Parse-time errors in statements inside the statement block of a flow control structure. Thestatement block must parse correctly, even if the condition for the control structure is suchthat the statement block will not be executed.• Data type for CLUMP output file is too limited for output data range. Try a larger datatype, preferably 32-bit unsigned.52<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Combining Different TypesStandard RulesCombining DifferentTypesMost operators and functions can take inputs of different data and object types. Many of theoperators and functions follow a set of standard rules for combining different data and objecttypes, which are described here.These rules apply to both Model Maker and the <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>. However,some capabilities mentioned may be accessible only through the <strong>Spatial</strong> <strong>Modeler</strong><strong>Language</strong>.These rules are very similar to the rules governing assigning an expression to a variableof a different type described in Assignment Statements.Data TypesIn general, most functions and operators will accept a mixture of numeric data types as inputs.The inputs are “promoted” to the maximum numeric data type present, in the order BINARY,INTEGER, FLOAT, COMPLEX. This maximum data type is considered the input data typefor the function.For example, if a function has two inputs, one BINARY and one COMPLEX, the BINARYinput will be converted to COMPLEX, and COMPLEX will be the input data type for thefunction. If an operator or function has an input of type COLOR, the inputs are promoted in thesame way, in the order BINARY, INTEGER, FLOAT, COLOR.You should not combine COLOR and COMPLEX inputs into a function, since this willusually result in an undefined output data type.Most functions will not accept a combination of numeric and STRING inputs.For most operators and functions, the Data Types section includes a chart which shows theoutput data type for each input data type to the function. For example:InputBINARYINTEGERFLOATCOMPLEXCOLORSTRINGOutputnot supportedFLOATFLOATCOMPLEXCOLORnot supportedNow using the promotion rules above and this chart, the following can be determined:• If the inputs are all INTEGER, this function returns FLOAT.<strong>Reference</strong> <strong>Manual</strong>53


Standard Rules• If the inputs are BINARY and COMPLEX, this function returns COMPLEX.• If the inputs are all BINARY, an error is reported.• If any of the inputs is STRING, an error is reported.In this chart, “not supported” means that an error will be reported if this data type is input intothis function. “Undefined” means that the return data type is not one of the defined data types.COLOR Data TypeThe COLOR data type is implemented as a “stack” of three FLOATs. Any function whichreturns a FLOAT on FLOAT input will return COLOR for COLOR input by simply applyingthe function to the red, green, and blue components individually.However, if a function returns anything other than FLOAT for FLOAT input, the output typefor COLOR input is "undefined," or a data type that is not fully supported by the <strong>Modeler</strong>. Forexample, the Data Type chart for the "==" (test for equality) operator is:InputBINARYINTEGERFLOATCOMPLEXCOLORSTRINGOutputBINARYBINARYBINARYBINARYundefinedBINARYSince FLOAT input returns BINARY output, COLOR input will return a "stack" of threeBINARY values, which is not a supported data type. However, a few functions will accept this"undefined" data type and return a supported data type. The ISALLTRUE function will acceptthis type and return a BINARY SCALAR. Also, the UNSTACK function will accept the stackof 3 binary values and return a BINARY TABLE with 3 rows.Object TypesThe following are the standard rules for combining various object types as inputs to mostoperators and functions:• Objects that are the same object type and size can be combined and will produce an outputof that same object type and size. Each element of the first object will be combined withthe element at the same row, column, and layer number of the second object to produce thecorresponding element of the output object.• Any object type may be combined with a SCALAR. The output object will be the type andsize of the larger object. The SCALAR will be combined with every element of the largerobject.• A RASTER with multiple layers may be combined with a RASTER with a single layer.The output will be a RASTER with the same number of multiple layers. The function willcombine the single layer input with each layer of the multiple layer input.54<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Object Types• A TABLE of any data type other than COLOR may be combined with a multiple layerRASTER which has the same number of layers as the TABLE has rows. The output willbe the same size as the RASTER. The function combines each row of the TABLE witheach element of the corresponding layer of the RASTER.• A TABLE of any data type other than COLOR may be combined with a single layerRASTER. The output will be a RASTER with as many layers as the TABLE has rows.The function combines each row of the TABLE with each element of the RASTER toproduce the corresponding layer of the output RASTER.• A COLOR SCALAR may be combined with a three layer RASTER. The output is a threelayer RASTER. The red component of the COLOR SCALAR is combined with the firstlayer of the RASTER, the green with the second, and the blue with the third.Any other combination of object types will cause an error to be reported for most functions.Any function which does not conform to these rules will have its object type rules explicitlystated in the function description.<strong>Reference</strong> <strong>Manual</strong>55


Standard Rules56<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Chapter 2SML Function SyntaxFunction TypesThere are five function types in the <strong>Modeler</strong>:• Point• Neighborhood• Global• Zonal• LayerPoint FunctionsNeighborhoodFunctionsGlobal FunctionsPoint functions operate "point by point." The standard rules for object type combinationsgenerally apply to most point functions. Point functions usually operate on any object type.Point functions operating on a RASTER consider the value of only one pixel in each input layerin determining the value for a single pixel of output. Point functions make up the majority offunctions supported by the <strong>Modeler</strong>.An example point function is:MAX (, , , ...)Each element of the output of MAX is the maximum of the corresponding element in ,, , etc.Neighborhood functions operate on a RASTER using a neighborhood which is defined in aMATRIX. Neighborhood functions involve each pixel's "neighbors," or nearby pixels, in thecalculations.An example neighborhood function is:FOCAL MAX (, )Each pixel in the output of FOCAL MAX is the maximum of the neighbors of the correspondingpixel in the input , using the MATRIX to define the size and shape of theneighborhood.Global functions operate on an entire object or layer, and return a single value for that object orlayer.An example neighborhood function isGLOBAL MAX ()If is a TABLE or MATRIX, GLOBAL MAX returns the maximum value in the entireTABLE or MATRIX. If is a RASTER, GLOBAL MAX returns a TABLE containingthe maximum value of each entire layer in the RASTER.<strong>Reference</strong> <strong>Manual</strong>57


Zonal FunctionsLayer FunctionsCombinationFunctionsZonal functions operate on two input RASTER layers, and return either a MATRIX or TABLE.One of the two input layers is called the zone layer, and the values of this layer (which must beunsigned integer data type) are called zones. The second input layer is called the class layer orvalue layer. Statistics are computed from the class or value layer for each zone in the zone layer,and the results are returned in the output TABLE or MATRIX. Each row of the returned objectcorresponds to one zone.SUMMARY is a Zonal function which returns a MATRIX. Zonal functions which return aTABLE include the versions of the ZONAL MAX, ZONAL MIN, ZONAL MEAN, ZONALRANGE, and ZONAL SD which have two raster layers as input. The other versions of thesefunctions use the output of SUMMARY as input, and so are actually Point functions rather thanZonal functions, since their input is a MATRIX, not two RASTER layers.Layer functions operate on an entire RASTER. Layer functions output a RASTER. The valuefor each pixel in the output RASTER may depend on the arrangement of pixel values over theentire input layer.Layer functions include SEARCH and CLUMP.Some functions in the modeler are actually combinations of simpler functions. An example isPRINCIPAL COMPONENTS, which combines COVARIANCE, EIGENMATRIX,MATTRANS, and LINEARCOMB into one function.COVIARANCE is a Global function, while the others are Point functions. Other combinationfunctions include HISTOEQ, STRETCH, and RASTERMATCH.58<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


<strong>Modeler</strong> Function Categories<strong>Modeler</strong> FunctionCategoriesFor your convenience, the <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong> functions and operators have been dividedinto several categories. These categories are listed below with a brief description of some of thecapabilities included in each:AnalysisArithmeticBitwiseBooleanColorConditionalData GenerationDescriptorDistanceExponentialFocal (Scan)GlobalMatrixOtherRelationalSizeStackStatisticalStringIncludes convolution filtering, histogram matching, contraststretch, principal components, and more.Perform basic arithmetic functions including addition,subtraction, multiplication, division, factorial, and modulus.Use bitwise and, or, exclusive or, and not.Perform logical functions including and, or, and not.Manipulate colors to and from RGB and IHS.Run logical tests using conditional statements andeither...if...or...otherwise.Create raster layers from map coordinates, column numbers, orrow numbers. Create a matrix or table from a list of scalars.Read descriptor information and map a raster through adescriptor column.Perform distance functions including proximity analysis.Use exponential operators including natural and commonlogarithms, power, and square root.Several neighborhood analysis functions are availableincluding boundary, density, diversity, majority, mean,minority, rank, standard deviation, sum, and others.Perform global operations including diversity, maximum,mean, minimum, standard deviation, sum, and more.Matrix functions allow you to multiply, divide and transposematrices, as well as convert a matrix to table and vice versa.A host of miscellaneous functions provide data type conversion,various tests, and other utilities.Relational operators include equality, inequality, greater than,less than, greater than or equal, less than or equal, and others.Measure cell X and Y size, layer width and height, number ofrows and columns, etc.Perform operations over a stack of layers including diversity,majority, max, mean, median, min, minority, standarddeviation, and sum.Local statistical operations include density, diversity, majority,mean, rank, standard deviation, and more.Concatenate strings and convert text to upper or lower case.<strong>Reference</strong> <strong>Manual</strong>59


<strong>Modeler</strong> Function CategoriesSurfaceTrigonometricZonalSurface functions allow you to calculate aspect and degree orpercent slope.Use common trigonometric functions including sine/arcsine,cosine/arccosine and tangent/arctangent, and hyperbolicarcsine, arccosine, cosine, sine and tangent.Perform zonal operations including summary, diversity,majority, max, mean, min, range, and standard deviation.60<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisAnalysisCLUMP (Clump - Contiguity Analysis)CONVOLVE (Convolution)CORRELATION (Correlation Matrix from Covariance Matrix)CORRELATION (Correlation Matrix from Raster)COVARIANCE (Covariance Matrix)DELROWS (Delete Rows from Sieved Descriptor Column)DIRECT LOOKUP (Map Integer Values Through Lookup Table)EIGENMATRIX (Compute Matrix of Eigenvectors)EIGENVALUES (Compute Table of Eigenvalues)HISTMATCH (Histogram Matching)HISTOEQ (Histogram Equalization)HISTOGRAM (Histogram)LINEARCOMB (Linear Combination)LOOKUP (Map Input Values Through Lookup Table Using Bin Function)PRINCIPAL COMPONENTS (Principal Components)RASTERMATCH (Raster Matching)SIEVETABLE (Get Sieve Lookup Table)STRETCH (Stretch)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>61


AnalysisCLUMP (Clump - Contiguity Analysis)Syntax:Function Type:Description:LayerCLUMP (, )Performs a contiguity analysis on , a single layer RASTER. Each separate rasterregion, or clump, is recoded to a separate class. The output is a single layer raster in which thecontiguous areas are numbered sequentially. is a SCALAR whichdetermines the number of neighbors around a pixel used for determining contiguity. The onlycurrently supported values for are 4 and 8.Data Types:Input Output CommentsBINARYINTEGERINTEGERINTEGERFLOAT INTEGER FLOAT inputs convertedto INTEGERCOMPLEXCOLORSTRINGnot supportednot supportednot supportedObject Types:Example Model: is a single layer RASTER. is a SCALAR. The output is a singlelayer RASTER.# This model produces a clumped output, then copies the classname for each # clump from the original class of the clump.RASTER in FILE OLD INPUT "/usr/imagine/examples/lnlandc.img";RASTER cl FILE NEW OUTPUT 32 BIT UNSIGNED THEMATIC BIN DIRECTDEFAULT"/usr/imagine/examples/clump.img";STRING TABLE clnames DESCRIPTOR cl :: "Class_Names";# do the clumpcl = CLUMP (in, 8);# get class names for each clumpclnames = LOOKUP (cl :: "Original Value", in ::"Class_Names");QUIT;Notes:If the output from CLUMP is associated with a file layer, the layer should be declared at least16-bit integer, or preferably 32-bit integer. The CLUMP function will use the output file layerto store temporary results. If the layer's data type is not sufficient to store the data range of thetemporary results, an error is reported.62<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisThe CLUMP function will create a descriptor column called "Original Value" which containsthe input file value for each clump in the output file. CLUMP is the only function in the <strong>Spatial</strong><strong>Modeler</strong> <strong>Language</strong> which automatically generates descriptor columns, and after which the newdescriptor columns are available to be used later in the model. All other descriptors columnscreated by models are created when the QUIT statement is encountered.See the example for the DELROWS function. SIEVETABLE can be used to filter out smallclumps from a layer processed with CLUMP.See Also:SIEVETABLEDELROWS<strong>Reference</strong> <strong>Manual</strong>63


AnalysisCONVOLVE (Convolution)Syntax:Function Type:Description:CONVOLVE (, )NeighborhoodPerforms convolution on using as convolution kernel.Convolution filtering is a method of spatial filtering that analyzes pixels based on neighboringpixels. A convolution kernel is a matrix of numbers that is moved across the image to determinethe output value of each pixel in the raster.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXnot supportednot supportedObject Types:Notes:See Also: is a RASTER; is a MATRIX.Output is a RASTER with same number of layers as .The output data are not normalized. To normalize, divide the by the sum of itscoefficients before using CONVOLVE. This can be done by using: / GLOBAL SUM ()Make sure that GLOBAL SUM () is non-zero to avoid division by zero.MATRIXGLOBAL SUMFOCAL functions64<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisCORRELATION (Correlation Matrix From Covariance Matrix)Syntax:Function Type:Description:PointCORRELATION ()Computes the correlation matrix from the covariance matrix.If any band is a linear combination of other bands, the bands are non-independent. Usingeither of the Correlation functions with non-independent data bands will result in anerror.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATFLOATnot supportednot supportedObject Types:See Also: is a square MATRIX. The output is the same size as the input.CORRELATION (from raster)COVARIANCE<strong>Reference</strong> <strong>Manual</strong>65


AnalysisCORRELATION (Correlation Matrix From Raster)Syntax:Function Type:Description:ororGlobalCORRELATION ()CORRELATION (, )CORRELATION (, )Returns the correlation matrix of . is either USEALL or IGNORE.USEALL indicates to use all input values inthe computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. If the pixel value for any of the layers is equal to thebackground value, that pixel is not included in the correlation calculation.If is not present, the computation depends on whether is apreviously existing file, or a RASTER created within the model. If is a RASTERcreated within the model, the default statistics option is used, as set by the Preference Editor orthe SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of contain statistics which were computed using all values, or if all layers have statistics whichwere computed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option is used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.If any band is a linear combination of other bands, the bands are non-independent. Usingeither of the Correlation functions with non-independent data bands will result in anerror.Data Types:The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATFLOATnot supportednot supported66<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisObject Types:Notes:See Also: is a RASTER. The output is a square MATRIX. The number of rows and columns inthe output is the same as the number of layers in . is one of the keywords USEALL or IGNORE. mustbe SCALAR.If your model will be using both the covariance matrix and the correlation matrix, it is moreefficient to calculate the covariance matrix first, using the COVARIANCE function, then usethe CORRELATION from covariance matrix function, rather than using this function.This function is equivalent to:CORRELATION (COVARIANCE (, ))CORRELATION (from covariance matrix)COVARIANCESET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>67


AnalysisCOVARIANCE (Covariance Matrix)Syntax:Function Type:Description:Data Types:ororGlobalCOVARIANCE ()COVARIANCE (, )COVARIANCE (, )Returns the covariance matrix of . The covariance matrix is an n x n matrix containingall the variance and covariance within n bands of data. The covariance matrix can be used inmatrix equations such as principal components analysis. is either USEALL or IGNORE.USEALL indicates to use all input values inthe computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. If the pixel value for any of the layers is equal to thebackground value, that pixel is not included in the covariance calculation.If is not present, the computation depends on whether is apreviously existing file, or a RASTER created within the model. If is a RASTERcreated within the model, the default statistics option is used, as set by the Preference Editor orthe SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of contain statistics which were computed using all values, or if all layers have statistics whichwere computed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option is used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATFLOATnot supportednot supportedObject Types: is a RASTER. The output is a square MATRIX. The number of rows and columns inthe output is the same as the number of layers in .68<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Analysis is one of the keywords USEALL or IGNORE. mustbe SCALAR.See Also:EIGENMATRIXMATTRANSPRINCIPAL COMPONENTSSET DEFAULT STATISTICSCORRELATION<strong>Reference</strong> <strong>Manual</strong>69


AnalysisDELROWS (Delete Rows from Sieved Descriptor Column)Syntax:Function Type:Description:Data Types:PointDELROWS (, )DELROWS returns a TABLE, which is the same data type and size and . Thetable is initialized to zero if numeric, or "" if it is STRING type. Then, for each row i of thetable:if [i] > 0then [ [i]] = [i]DELROWS is typically used after the SIEVETABLE function. The output of SIEVETABLEis used as . A descriptor table from the input clumped layer whose histogram wasinput to SIEVETABLE would be used as . Then DELROWS outputs a tablewhere the rows corresponding to the "sieved" values have been deleted. This allows you to copythe appropriate descriptor information from the clumped file to the sieved file. is INTEGER. may be any type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:Example Model: and are TABLE type with the same number of rows. The outputis also a TABLE with the same number of rows.# This model uses a clumped file as input (see example modelfor CLUMP), then # produces a sieved output using a thresholdof 5. The Original Values and# Class Names are input to DELROWS to remove the descriptortable rows for# classes removed by the sieve.RASTER cl FILE OLD INPUT "/usr/data/clump.img";RASTER sv FILE NEW OUTPUT 32 BIT UNSIGNED THEMATIC BIN DIRECTDEFAULT"/usr/data/sieve.img";STRING TABLE clnames DESCRIPTOR cl :: "Class_Names";STRING TABLE svnames DESCRIPTOR sv :: "Class_Names";INTEGER TABLE svoriginal DESCRIPTOR sv :: "Original Value";TABLE svtable;INTEGER threshold; #threshold for sieve70<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Analysisthreshold = 5;# get the sieve tablesvtable = SIEVETABLE (threshold, histogram (cl));# do the sievesv = LOOKUP (cl, svtable);# use DELROWS to get Original Value and Class Names for sievedfilesvoriginal = DELROWS (cl :: "Original Value", svtable);svnames = DELROWS (clnames, svtable);QUIT;See Also:CLUMPSIEVETABLELOOKUP<strong>Reference</strong> <strong>Manual</strong>71


AnalysisDIRECT LOOKUP (Map Integer Values Through Lookup Table)Syntax:Function Type:Description:Data Types:PointDIRECT LOOKUP (, )Map integer values in through lookup table . For example, if isSCALAR, the result will be the value in row of , i.e., [](assuming the origin for is 0). must be INTEGER.The output will be the same data type as :Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:Notes:See Also: may be any object type. is a TABLE. The output will be the same object typeand size as .Exception: If is single layer RASTER and is COLOR, output will be a threelayer RASTER. If is RASTER and is COLOR, the number of layers in must be one or three.DIRECT LOOKUP differs from LOOKUP in that LOOKUP uses the bin functions associatedwith the lookup table and DIRECT LOOKUP does not.LOOKUP72<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisEIGENMATRIX (Compute Matrix of Eigenvectors)Syntax:Function Type:Description:PointEIGENMATRIX ()The input must be a square matrix, typically the result of the COVARIANCE function. Theoutput is the matrix of eigenvectors derived from the input matrix. An eigenvector matrix isoften used in image processing functions such as principal components analysis.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportedFLOATnot supportedCOLORnot supportedObject Types:See Also:The input must be a square MATRIX. The output will be a MATRIX the same size as the input.COVARIANCEMATTRANSLINEARCOMBEIGENVALUESPRINCIPAL COMPONENTS<strong>Reference</strong> <strong>Manual</strong>73


AnalysisEIGENVALUES (Compute Table of Eigenvalues)Syntax:Function Type:Description:PointEIGENVALUES ()The input must be a square matrix, typically the result of the COVARIANCE function. Theoutput is the eigenvalues of the matrix returned as a table.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportedFLOATnot supportedCOLORnot supportedObject Types:See Also:The input must be a square MATRIX. The output will be a TABLE with the same number ofrows as the input.EIGENMATRIXCOVARIANCEMATTRANSLINEARCOMB74<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisHISTMATCH (Histogram Matching)Syntax:Function Type:Description:PointHISTMATCH (, )Histogram matching is the process of determining a lookup table that will convert the histogramof one object to resemble the histogram of another object. The inputs are two histogram tables.This function creates a lookup table. If the data used to generate are passed throughthis lookup table, the histogram of the new data will approximate the shape of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportedFLOATnot supportednot supportednot supportedObject Types:Notes:See Also: and are TABLEs. The output is a TABLE the same size as .For rasters, HISTMATCH is useful for matching data of the same or adjacent scenes which areslightly different due to sun angle or atmospheric effects.LOOKUPHISTOGRAMHISTOEQRASTERMATCHBin Functions<strong>Reference</strong> <strong>Manual</strong>75


AnalysisHISTOEQ (Histogram Equalization)Syntax:Function Type:Description:Data Types:ororHISTOEQ (, )GLOBAL MEAN (, , )GLOBAL MEAN (, , )Combination (Global and Point)Computes histogram equalization of using bins. is either USEALL or IGNORE.USEALL indicates to use all input values inthe computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value.If is not present, the computation depends on whether is apreviously existing file, or a RASTER created within the model. If is a RASTERcreated within the model, the default statistics option is used, as set by the Preference Editor orthe SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of contain statistics which were computed using all values, or if all layers have statistics whichwere computed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option is used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement. is numeric and is converted to INTEGER. may be any numeric type;the output is INTEGER:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERINTEGERINTEGERnot supportednot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.76<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisObject Types:See Also: is a RASTER, is a scalar. The result is a RASTER with the samenumber of layers as . is one of the keywords USEALL or IGNORE. mustbe SCALAR.HISTMATCHHISTOGRAMLOOKUPSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>77


AnalysisHISTOGRAM (Histogram)Syntax:Function Type:Description:Data Types:ororGlobalHISTOGRAM ()HISTOGRAM (, )HISTOGRAM (, )Returns the histogram of .A histogram is a graph which represents data distribution. For a single band of data, thehorizontal axis of the graph is the range of all possible data file values. The vertical axis is thenumber of pixels that have each value. is either USEALL or IGNORE.USEALL indicates to use all input values inthe computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option is used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGFLOATFLOATFLOATFLOATnot supportednot supported78<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Analysis is one of the keywords USEALL or IGNORE. maybe any numeric type.Object Types: may be any object type. If is a RASTER, must have only one layer.The result is a TABLE. The number of rows in the table is determined by the bin function forthe table. If is a RASTER associated with a file layer, then the bin function from thatfile layer's descriptor table is used. Otherwise, the default bin function is used based on the datatype of and the minimum and maximum data value of .BINARY Direct, offset = 0INTEGER, max - min < 256INTEGER, max - min >= 256FLOATCOMPLEXDirect, offset = minLinear, 256 binsLinear, 256 binsLinear, 256 bins, use magnitude is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.See Also:HISTMATCHSET DEFAULT STATISTICSBin Functions<strong>Reference</strong> <strong>Manual</strong>79


AnalysisLINEARCOMB (Linear Combination)Syntax:Function Type:Description:PointLINEARCOMB (, )Computes linear combination of using as a transformation matrix. Forexample:RASTER x (3);RASTER y (2);MATRIX m [1:2, 1:3];y = LINEARCOMB (x, m);is equivalent to:y (1) = x (1) * m [1,1] + x (2) * m [1,2] + x (3) * m [1,3];y (2) = x (1) * m [2,1] + x (2) * m [2,2] + x (3) * m [2,3];Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXnot supportednot supportedObject Types: is a RASTER. must have as may many columns as has layers. is normally a MATRIX, but may be a TABLE or even SCALAR if has onlyone layer. The result is a RASTER with as many layers as has rows.80<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisLOOKUP (Map Input Values Through Lookup Table Using Bin Function)Syntax:Function Type:Description:Data Types:PointLOOKUP (, )If has an associated bin function, the values in will be converted to binnumbers, then the bin number will be used as an index into the lookup table .If does not have an associated bin function, is converted to INTEGER, andthis number is used as an index to the lookup table.If is BINARY, INTEGER, FLOAT, or COMPLEX, the output will be the same datatype as :Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGIf is COLOR, and is FLOAT or COLOR, output will be COLOR. If is COLOR and is any other type, output is undefined type.STRING type for is not supported.Object Types:Notes:See Also: may be any object type. is a TABLE. The output will be the same object typeand size as .Exception: If is single layer RASTER and is COLOR, output will be a threelayer RASTER. If is RASTER and is COLOR, the number of layers in must be one or three.Tables will have an associated Bin Function if they are associated with a descriptor column, orif they are the result of the HISTOGRAM or HISTMATCH functions. In either case the binfunction for the descriptor table is used. All other table objects do not have associated binfunctions.DIRECT LOOKUP and Map Raster through Descriptor Column<strong>Reference</strong> <strong>Manual</strong>81


AnalysisPRINCIPAL COMPONENTS (Principal Components)Syntax:Function Type:Description:Data Types:ororPRINCIPAL COMPONENTS (, )PRINCIPAL COMPONENTS (, )PRINCIPAL COMPONENTS (, )Combination (Global and Point)Computes the first principal components of . is either USEALL or IGNORE.USEALL indicates to use all input valuesin the computation of the covariance matrix used in the principal components transform,IGNORE indicates to ignore a background value. specifies thebackground value to be ignored. If is not present, zero is used as thebackground value. If the pixel value for any one of the layers of is equal to thebackground value, that pixel is not included in the covariance calculation.If is not present, the computation depends on whether is apreviously existing file, or a RASTER created within the model. If is a RASTERcreated within the model, the default statistics option is used, as set by the Preference Editor orthe SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of contain statistics which were computed using all values, or if all layers have statistics whichwere computed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option is used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement. is numeric, and is converted to INTEGER.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATFLOATnot supportednot supported82<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Analysis is one of the keywords USEALL or IGNORE. maybe any numeric type.Object Types:Notes:See Also: is SCALAR. is a RASTER and must have at least layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR.The output is RASTER with layers.Equivalent to:LINEARCOMB (, MATTRANS (EIGENMATRIX (COVARIANCE()) [0, 0: NUMLAYERS () - 1, -1]))EIGENMATRIXCOVARIANCEMATTRANSLINEARCOMBSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>83


AnalysisRASTERMATCH (Raster Matching)Syntax:Function Type:Description:Data Types:orororRASTERMATCH (, )RASTERMATCH (, , )RASTERMATCH (, , )RASTERMATCH (, , , )Combination (Global and Point)Maps through a lookup table so that the histogram of each layer of the returnedRASTER will have approximately the same shape as the histogram of the corresponding layerof . and determine how histograms are computed for and respectively. Each of and consists of or , as inthe HISTOGRAM function. is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value.If is not present, the computation depends on whether the associatedRASTER ( or ) is a previously existing file, or a RASTER createdwithin the model. If it is a RASTER created within the model, the default statistics option isused, as set by the Preference Editor or the SET DEFAULT STATISTICS statement.If the RASTER ( or ) is a previously existing raster file, and is not present, the result will normally be computed from the statistics storedwith the file. If all layers of the RASTER contain statistics which were computed using allvalues, or if all layers have statistics which were computed ignoring the same background value,the statistics from the file will be used to compute the result of this function. However, if layersused a different background value to compute statistics, or some layers ignored a backgroundvalue while others used all values, the default statistics option is used, as set by the PreferenceEditor or the SET DEFAULT STATISTICS statement. may be any numeric type. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATBINARYINTEGERFLOAT84<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisInput Output CommentsCOMPLEXCOLORSTRINGnot supportednot supportednot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.Object Types:Notes:See Also: and are both RASTER. They must either have the same number oflayers, or either may have one layer. is one of the keywords USEALL or IGNORE. mustbe SCALAR.The output is a RASTER which has the same number of layers as the maximum of and .If and both have one layer, this is equivalent to:LOOKUP (, HISTMATCH (HISTOGRAM (),HISTOGRAM ()))HISTMATCHHISTOEQHISTOGRAMLOOKUPSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>85


AnalysisSIEVETABLE (Get Sieve Lookup Table)Syntax:Function Type:Description:Data Types:PointSIEVETABLE (, )SIEVETABLE produces a lookup table which can be used to filter out small clumps from alayer which is the output of CLUMP. is a table which contains the histogram from theCLUMPed layer. is a SCALAR which specifies the minimum clump size toretain.You can use the CLUMPed layer and the output of SIEVETABLE as input into the LOOKUPfunction to create a new layer with the small clumps filtered out. The small clumps will berecoded to value zero. may be any numeric type, and is converted to FLOAT. must be FLOAT.The output is INTEGER.Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportedINTEGERnot supportednot supportednot supportedObject Types:Notes:See Also: is a single layer RASTER. is a SCALAR. The output is a single layerRASTER.See the example for DELROWS.CLUMPLOOKUPDELROWS86<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


AnalysisSTRETCH (Stretch)Syntax:ororSTRETCH (, , , )STRETCH (, , , , )STRETCH (, , , , )Function Type:Description:Data Types:Combination (Global and Point)Performs a linear scale and shift on the input such that each layer of the outputRASTER meets the following conditions:mean (output) - * standard deviation (output) =mean (output) + * standard deviation (output) = is either USEALL or IGNORE. USEALL indicates to use all input valuesfrom in the computing the mean and standard deviation, IGNORE indicates to ignorea background value. specifies the background value to be ignored. If is not present, zero is used as the background value.If is not present, the computation depends on whether is apreviously existing file, or a RASTER created within the model. If is a RASTERcreated within the model, the default statistics option is used, as set by the Preference Editor orthe SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultis normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file are used to computethe result of this function. However, if layers used a different background value to computestatistics, or some layers ignored a background value while others used all values, the defaultstatistics option is used, as set by the Preference Editor or the SET DEFAULT STATISTICSstatement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXnot supportednot supported<strong>Reference</strong> <strong>Manual</strong>87


Analysis, , and may be any numeric type. is one of the keywords USEALL or IGNORE. maybe any numeric type.Object Types:Notes:See Also: is a RASTER. , , and must be either SCALAR or aTABLE with as may rows as has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR.Equivalent to: + ( - GLOBAL MEAN () + GLOBAL SD() *) * ( - ) / (GLOBAL SD () * 2. *)GLOBAL MEANGLOBAL SDSET DEFAULT STATISTICS88<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ArithmeticArithmetic+ (Addition)- (Subtraction)- (Negation)* (Multiplication)/ (Division)MOD (Modulus)! (Factorial)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>89


Arithmetic+ (Addition)Syntax:Function Type:Description:Point + Add and .Data Types:Input Output CommentsBINARY BINARY Equivalent to: OR INTEGERFLOATCOMPLEXCOLORSTRINGINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.SUMFOCAL SUMGLOBAL SUM90<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Arithmetic- (Subtraction)Syntax:Function Type:Description:Point - Subtract from .Data Types:Input Output CommentsBINARY BINARY Equivalent to: AND NOT INTEGERFLOATCOMPLEXCOLORSTRINGINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.- (Negation)+ (Addition)<strong>Reference</strong> <strong>Manual</strong>91


Arithmetic- (Negation)Syntax:Function Type:Description:Point- Negative of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.See Also: - (Subtraction)~ (Bitwise Not)NOT92<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Arithmetic* (Multiplication)Syntax:Function Type:Description:Point * Multiply by .Data Types:Input Output CommentsBINARY BINARY Equivalent to: AND INTEGERFLOATCOMPLEXCOLORSTRINGINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.MATMUL<strong>Reference</strong> <strong>Manual</strong>93


Arithmetic/ (Division)Syntax:Function Type:Description:Point / Divide by .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:Notes:See Also:All object types, standard rules.Integer division by 0 will cause error to be reported. Floating point division by zero results infloating point "Infinity" value.MATDIV94<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ArithmeticMOD (Modulus)Syntax:Function Type:Description:Point MOD Returns the remainder (modulus) when is divided by the . The result is thesame sign as .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedINTEGERFLOATnot supportedCOLORnot supportedObject Types:All object types, standard rules.Example: 3 MOD 2 equals 1-3 MOD 2 equals -13 MOD -2 equals 1-3 MOD -2 equals -1Notes:See Also:Integer modulus by 0 will cause error to be reported. Floating point modulus by zero results infloating point "NaN" (not a number) value./ (Division)<strong>Reference</strong> <strong>Manual</strong>95


Arithmetic! (Factorial)Syntax: !Function Type:Description:PointComputes factorial.Factorial is commonly used in statistical analyses.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.GAMMA96<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


BitwiseBitwise& (Bitwise And)| (Bitwise Or)^ (Bitwise Exclusive Or)~ (Bitwise Not)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>97


Bitwise& (Bitwise And)Syntax:Function TypeDescription:: Point & Compute bitwise and of and .Data Types:Input Output CommentsBINARYINTEGERBINARYINTEGERFLOAT INTEGER FLOAT inputs converted toINTEGERCOMPLEXCOLORSTRINGnot supportedundefinednot supportedObject Types:See Also:All object types, standard rules.| (Bitwise Or)&& (Logical And)98<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Bitwise| (Bitwise Or)Syntax:Function Type:Description:Point | Computes bitwise or of and .Data Types:Input Output CommentsBINARYINTEGERBINARYINTEGERFLOAT INTEGER FLOAT inputs converted toINTEGERCOMPLEXCOLORSTRINGnot supportedundefinednot supportedObject Types:See Also:All object types, standard rules.^ (Bitwise Exclusive Or)& (Bitwise And)|| (Logical Or)<strong>Reference</strong> <strong>Manual</strong>99


Bitwise^ (Bitwise Exclusive Or)Syntax:Function Type:Description:Point ^ Computes bitwise exclusive or of and .Data Types:Input Output CommentsBINARYINTEGERBINARYINTEGERFLOAT INTEGER FLOAT inputs converted toINTEGERCOMPLEXCOLORSTRINGnot supportedundefinednot supportedObject Types:See Also:All object types, standard rules.| (Bitwise Or)100<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Bitwise~ (Bitwise Not)Syntax:Function Type:Description:Point~ Reverse bits of .Data Types:Input Output CommentsBINARYINTEGERBINARYINTEGERFLOAT INTEGER FLOAT inputs converted toINTEGERCOMPLEXCOLORSTRINGnot supportedundefinednot supportedObject Types:See Also:All object types, standard rules.NOT- (Subtraction)<strong>Reference</strong> <strong>Manual</strong>101


Bitwise102<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


BooleanBooleanAND (Logical And)&& (Logical And)OR (Logical Or)|| (Logical Or)NOT (Logical NOT)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>103


BooleanAND (Logical And)Syntaxes:Function Type:Description: AND or && PointTrue if and are both non-zero, false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYBINARYundefinednot supportedObject Types:Notes:See Also:All object types, standard rules.Identical to &&.& (Bitwise And)OR (Logical Or)104<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


BooleanOR (Logical Or)Syntaxes:Function Type:Description: OR or || PointTrue if either or is non-zero, false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYBINARYundefinednot supportedObject Types:All object types, standard rules.Notes: Identical to ||.See Also:| (Bitwise Or)AND (Logical And)<strong>Reference</strong> <strong>Manual</strong>105


BooleanNOT (Logical NOT)Syntax:Function Type:Description:PointNOT True if is zero, false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYBINARYundefinednot supportedObject Types:Notes:See Also:All object types, standard rules.Equivalent to DELTA ().DELTA~ (Bitwise Not)ISALLTRUEISNONZERO106<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ColorColorCOLOR (Create Color Scalar)HUE (Get Hue from RGB)IHSTOBLU (Get Blue from Intensity, Hue, and Saturation)IHSTOGRN (Get Green from Intensity, Hue, and Saturation)IHSTORED (Get Red from Intensity, Hue, and Saturation)IHSTORGB (Get Red, Green, and Blue from Intensity, Hue, and Saturation)INTENS (Get Intensity from RGB)RGBTOIHS (Get Intensity, Hue, and Saturation from Red, Green, and Blue)SATUR (Get Saturation from RGB)STACK (Convert FLOAT TABLE to COLOR TABLE)UNSTACK (Convert COLOR SCALAR to FLOAT TABLE)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>107


ColorCOLOR (Create Color Scalar)Syntax:Function Type:Description:Data Types:Object Types:Notes:See Also:orPointCOLOR ()COLOR (, , )Converts either the color name string constant in , or the red, green, and bluevalues input into a COLOR SCALAR. is a STRING constant., , and are numeric type, and are converted to FLOAT.The output is COLOR. is a constant., , and are SCALAR.Output is SCALAR.The color names and associated RGB values available to use for are containedin the file /usr/imagine/etc/color.txt.STACKUNSTACK:: (Read Descriptor Column or Color Table)108<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ColorHUE (Get Hue from RGB)Syntax:Function Type:Description:ororPointHUE (, , )HUE (, , , )HUE (, , , , ,)Computes hue from red, green, and blue values. If is present, the range of input datavalues for red, green, and blue is assumed to be zero to . If ,, and are present, red input values are assumed to range from zeroto , green input values from zero to , and blue input values from zero to.If neither nor , , and are present, the datarange for all three inputs is assumed to be zero to the default RGB maximum, which is 255. Theoutput data values will range from 0.0 to 360.0. The values of hue are as follows:Blue 0Magenta 60Red 120Yellow 180Green 240Cyan 300Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:, , and may be any object type. The standard rules apply forthe result type. , , , and , if present, must beSCALAR.<strong>Reference</strong> <strong>Manual</strong>109


ColorSee Also:INTENS SATUR RGBTOIHS IHSTORGBIHSTORED IHSTOGRN IHSTOBLU110<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ColorIHSTOBLU (Get Blue from Intensity, Hue, and Saturation)Syntax:Function Type:Description:ororPointIHSTOBLU (, , )IHSTOBLU (, , , )IHSTOBLU (, , , ,, )Computes blue from intensity, hue, and saturation values.If is present, the range of input data values for intensity, hue, and saturation isassumed to be zero to . If , , and arepresent, intensity input values are assumed to range from zero to , hue inputvalues from zero to , and saturation input values from zero to .If neither nor , , and are present, the datarange for the inputs is assumed to be zero to the default maximums for IHS, which are 1.0 forintensity, 360.0 for hue, and 1.0 for saturation. The output data values will range from 0.0 to 1.0.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:, , and may be any object type. The standard rules apply forthe result type. , , , and , if present, mustbe SCALAR.See Also:INTENS HUE SATUR RGBTOIHSIHSTORGB IHSTORED IHSTOGRN<strong>Reference</strong> <strong>Manual</strong>111


ColorIHSTOGRN (Get Green from Intensity, Hue, and Saturation)Syntax:Function Type:Description:ororPointIHSTOGRN (, , )IHSTOGRN (, , , )IHSTOGRN (, , , ,, )Computes green from intensity, hue, and saturation values.If is present, the range of input data values for intensity, hue, and saturation isassumed to be zero to . If , , and arepresent, intensity input values are assumed to range from zero to , hue inputvalues from zero to , and saturation input values from zero to .If neither nor , , and are present, the datarange for the inputs is assumed to be zero to the default maximums for IHS, which are 1.0 forintensity, 360.0 for hue, and 1.0 for saturation. The output data values will range from 0.0 to 1.0.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:, , and may be any object type. The standard rules apply forthe result type. , , , and , if present, mustbe SCALAR.See Also:INTENS HUE SATUR RGBTOIHSIHSTORGB IHSTORED IHSTOBLU112<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ColorIHSTORED (Get Red from Intensity, Hue and Saturation)Syntax:Function Type:Description:ororPointIHSTORED (, , )IHSTORED (, , , )IHSTORED (, , , ,, )Computes red from intensity, hue, and saturation values.If is present, the range of input data values for intensity, hue, and saturation isassumed to be zero to . If , , and arepresent, intensity input values are assumed to range from zero to , hue inputvalues from zero to , and saturation input values from zero to .If neither nor , , and are present, the datarange for the inputs is assumed to be zero to the default maximums for IHS, which are 1.0 forintensity, 360.0 for hue, and 1.0 for saturation. The output data values will range from 0.0 to 1.0.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:, , and may be any object type. The standard rules apply forthe result type. , , , and , if present, mustbe SCALAR.See Also:INTENS HUE SATUR RGBTOIHSIHSTORGB IHSTOGRN IHSTOBLU<strong>Reference</strong> <strong>Manual</strong>113


ColorIHSTORGB (Get Red, Green and Blue from Intensity, Hue and Saturation)Syntax:Function Type:Description:ororPointIHSTORGB ()IHSTORGB (, )IHSTORGB (, , , )Computes red, green, and blue from intensity, hue, and saturation values contained in . may be a three layer RASTER, in which case the first layer is used for intensity inputvalues, the second for hue, and the third for saturation. In this case a three layer RASTER isoutput, with the layers representing red, green, and blue. may also be a COLOR SCALAR or COLOR TABLE, in which case the three valuesfor each element of are considered to be intensity, hue, and saturation, rather than red,green, and blue. The output in this case is a COLOR object the same size and type as the input.If is present, the range of input data values for intensity, hue, and saturation isassumed to be zero to . If , , and arepresent, intensity input values are assumed to range from zero to , hue inputvalues from zero to , and saturation input values from zero to .If neither nor , , and are present, the datarange for the inputs is assumed to be zero to the default maximums for IHS, which are 1.0 forintensity, 360.0 for hue, and 1.0 for saturation. The output data values will range from 0.0 to 1.0.Data Types:Input Output CommentsBINARYnot supportedINTEGER FLOAT Three layer RASTER onlyFLOAT FLOAT Three layer RASTER onlyCOMPLEXCOLORSTRINGnot supportedCOLORnot supportedObject Types: may be either a three layer RASTER or any object of data type COLOR. The outputwill be the same object type and size as . , , , and, if present, must be SCALAR.See Also:INTENS HUE SATUR RGBTOIHSIHSTORED IHSTOGRN IHSTOBLU114<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ColorINTENS (Get Intensity from RGB)Syntax:Function Type:Description:ororPointINTENS (, , )INTENS (, , , )INTENS (, , , ,, )Computes intensity from red, green, and blue values.If is present, the range of input data values for red, green, and blue is assumed to bezero to . If , , and are present, red inputvalues are assumed to range from zero to , green input values from zero to, and blue input values from zero to .If neither nor , , and are present, the datarange for all three inputs is assumed to be zero to the default RGB maximum, which is 255. Theoutput data values will range from 0.0 to 1.0.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:, , and may be any object type. The standard rules apply forthe result type. , , , and , if present, must beSCALAR.See Also:HUE SATUR RGBTOIHS IHSTORGBIHSTORED IHSTOGRN IHSTOBLU<strong>Reference</strong> <strong>Manual</strong>115


ColorRGBTOIHS (Get Intensity, Hue and Saturation from Red, Green and Blue)Syntax:Function Type:Description:ororPointRGBTOIHS ()RGBTOIHS (, )RGBTOIHS (, , , )Computes intensity, hue, and saturation from red, green, and blue values contained in . may be a three layer RASTER, in which case the first layer is used for red input values,the second for green, and the third for blue. In this case a three layer RASTER is output, withthe layers representing intensity, hue, and saturation. may also be a COLOR SCALAR or COLOR TABLE. The output in this case is aCOLOR object the same size and type as the input, where the three values for each element ofthe output are considered to be intensity, hue, and saturation, rather than red, green, and blue.If is present, the range of input data values for red, green, and blue is assumed to bezero to . If , , and are present, red inputvalues are assumed to range from zero to , green input values from zero to, and blue input values from zero to .If neither nor , , and are present, the datarange for all three inputs is assumed to be zero to the default RGB maximum, which is 255. Theoutput data values will range from 0.0 to 1.0 for intensity, 0.0 to 360.0 for hue, and 0.0 to 1.0for saturation.Data Types:Input Output CommentsBINARYnot supportedINTEGER FLOAT Three layer RASTER onlyFLOAT FLOAT Three layer RASTER onlyCOMPLEXCOLORSTRINGnot supportedCOLORnot supportedObject Types: may be either a three layer RASTER or any object of data type COLOR. The outputwill be the same object type and size as . , , , and, if present, must be SCALAR.See Also:INTENS HUE SATUR IHSTORGB116<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ColorIHSTORED IHSTOGRN IHSTOBLU<strong>Reference</strong> <strong>Manual</strong>117


ColorSATUR (Get Saturation from RGB)Syntax:Function Type:Description:ororPointSATUR (, , )SATUR (, , , )SATUR (, , , , ,)Computes saturation from red, green, and blue values.If is present, the range of input data values for red, green, and blue is assumed to bezero to . If , , and are present, red inputvalues are assumed to range from zero to , green input values from zero to, and blue input values from zero to .If neither nor , , and are present, the datarange for all three inputs is assumed to be zero to the default RGB maximum, which is 255. Theoutput data values will range from 0.0 to 1.0.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:, , and may be any object type. The standard rules apply forthe result type. , , , and , if present, must beSCALAR.See Also:INTENS HUE RGBTOIHS IHSTORGBIHSTORED IHSTOGRN IHSTOBLU118<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ColorSTACK (Convert FLOAT TABLE to COLOR SCALAR)Syntax:Function Type:Description:PointSTACK ()STACK converts the RGB values from a float table to a color scalar.If input is FLOAT TABLE with three rows, output will be COLOR SCALAR.If input is a TABLE of data type BINARY, INTEGER, FLOAT, COMPLEX, or STRINGwith one row, output is SCALAR of same type.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERCOLORCOMPLEXnot supportedSTRINGObject Types:Notes:See Also:Input must be a TABLE; output is SCALAR.Inverse of UNSTACK.An input TABLE of any size not listed in the Description above will have undefined result.COLOR data type input or input of any object type other than TABLE will result in an error.UNSTACK<strong>Reference</strong> <strong>Manual</strong>119


ColorUNSTACK (Convert COLOR SCALAR to FLOAT TABLE)Syntax:Function Type:Description:PointUNSTACK ()If input is COLOR SCALAR, output will be FLOAT TABLE with three rows. Input of anyother data type will be converted to TABLE with one row.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXFLOATSTRINGObject Types:Notes:See Also:Input must be SCALAR, output is TABLE.Inverse of STACK.STACK120<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ConditionalConditionalCONDITIONAL (Conditional)EITHER...IF...OR....OTHERWISE (Select on Binary Test)INDEX (Index - Find Matching Item on List)PICK (Pick - Get nth Item on List)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>121


ConditionalCONDITIONAL (Conditional)Syntax:Function Type:Description:Data Types:PointCONDITIONAL {() , () , (), ...} is converted to BINARY. If true, is returned. Otherwise, isconverted to BINARY. If true, is returned, etc. The first expression that is true willdetermine the output value. If none of the test objects is true, zero is returned, or "" (the emptystring) if the type of the is STRING.For rasters, a conditional statement is often used to determine the output class value (recode) bytesting the input class value., , etc., are numeric, and are converted to BINARY., , etc., may be any type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:Notes:See Also:All object types, standard rules.CONDITIONAL operates element by element on tables, matrices, and rasters, like most otherpoint functions.EITHER...IF...OR...OTHERWISEPICK122<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ConditionalEITHER...IF...OR....OTHERWISE (Select on Binary Test)Syntax:Function Type:Description:Data Types:EITHER IF () OR OTHERWISEPoint is converted to BINARY. If true, is returned. Otherwise, is returned. is numeric, and is converted to BINARY. and may be any type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:Notes:All object types, standard rules.EITHER...IF...OR....OTHERWISE operates element by element on tables, matrices, andrasters, like most other point functions.See Also:CONDITIONALPICKFlow Control<strong>Reference</strong> <strong>Manual</strong>123


ConditionalINDEX (Index - Find Matching Item on List)Syntax: INDEX () {, , , ...}Function Type:Description:PointIf equals , 1 is returned. If equals , 2 is returned, etc. If is not equal to any of the arguments on the right, 0 is returned.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERINTEGERINTEGERINTEGERINTEGERObject Types:Notes:See Also:All object types, standard rules.INDEX operates element by element on tables, matrices, and rasters, like most other pointfunctions.PICK124<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ConditionalPICK (Pick - Get nth Item on List)Syntax: PICK () {, , , ...}Function Type:Description:Data Types:PointIf is 1, is returned. If is 2, is returned, etc. If is less than one or greater than the number of arguments on the right, zero isreturned, or if the arguments are STRING, "" (the empty string) is returned. must be BINARY, INTEGER, or FLOAT, and is converted to INTEGER., , etc., may be any data type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:Notes:See Also:All object types, standard rules.PICK operates element by element on tables, matrices, and rasters, like most other pointfunctions.CONDITIONALEITHER...IF...OR...OTHERWISEINDEX<strong>Reference</strong> <strong>Manual</strong>125


Conditional126<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Data GenerationData GenerationMAPX (Create Raster Containing X Map Coordinates)MAPY (Create Raster Containing Y Map Coordinates)MATRIX (Create Matrix from List of Scalars)MATRIX (Read Matrix from Kernel Library)MATRIX SERIES (Create Matrix Containing 2-D Series)PIXELX (Create Raster Containing Column Number)PIXELY (Create Raster Containing Row Number)RANDOM (Generate Random Value))STACKLAYERS (Stack Raster Layers)TABLE (Create Table from List of Scalars)TABLE SERIES (Create Table Containing Series)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>127


Data GenerationMAPX (Create Raster Containing X Map Coordinates)Syntax:Function Type:Description:Data Types:Object Types:Notes:See Also:MAPXPointReturns a raster in which each pixel contains the X map coordinate corresponding to its position.Output is FLOAT.Output is single layer RASTER.If Working Window is in pixel coordinates, returns pixel coordinates converted to FLOAT.MAPYPIXELX128<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Data GenerationMAPY (Create Raster Containing Y Map Coordinates)Syntax:Function Type:Description:Data Types:Object Types:Notes:See Also:MAPYPointReturns a raster in which each pixel contains the Y map coordinate corresponding to its position.Output is FLOAT.Output is single layer RASTER.If Working Window is in pixel coordinates, returns pixel coordinates converted to FLOAT.MAPXPIXELY<strong>Reference</strong> <strong>Manual</strong>129


Data GenerationMATRIX (Create Matrix from List of Scalars)Syntax: MATRIX (, : , , , ...)Function Type:Description:Data Types:PointReturns a matrix rows by columns containing the scalar arguments in theorder listed across successive rows. For example:MATRIX (2, 3: 1, 2, 3, 4, 5, 6)results in the matrix:1 2 34 5 6 and are INTEGER constants. , , etc., may be any type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:See Also: and are constants. All input objects are SCALAR. Output is MATRIXwith having rows and columns. The number of arguments ,, etc., must equal * .MATRIX (Read Matrix from Kernel Library)MATRIX SERIESTABLE130<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Data GenerationMATRIX (Read Matrix from Kernel Library)Syntax:Function Type:Description:Data Types:PointMATRIX ()orMATRIX (, )Returns a matrix read from a kernel library. If is present, the kernel is readfrom this library. Otherwise the default kernel library/etc/default.klb is used. and are STRING constants.The output is type FLOAT.Object Types:See Also: and are SCALAR constants. Output is MATRIX. The sizeof the output matrix is determined by the input file.MATRIX (Create Matrix from List of Scalars)CONVOLVE<strong>Reference</strong> <strong>Manual</strong>131


Data GenerationMATRIX SERIES (Create Matrix Containing 2-D Series)Syntax:Function Type:Description:Data Types:PointMATRIX SERIES (, , , ,)Returns a matrix having rows and columns. The first element of thereturned matrix contains . Each successive column in the matrix is incremented by, and each successive row by . For example:MATRIX SERIES (2, 3, 10, 2, .3)results in the matrix:10 10.3 10.612 12.3 12.6 and are BINARY, INTEGER, or FLOAT, and are converted toINTEGER. , , and may be any type otherthan STRING:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All input objects are SCALAR. Output is MATRIX having rows and columns.MATRIX (Create Matrix from List of Scalars)MATRIX (Read Matrix from Kernel Library)TABLE SERIES132<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Data GenerationPIXELX (Create Raster Containing Column Number)Syntax:Function Type:Description:Data Types:Object Types:See Also:PointPIXELXReturns a raster in which each pixel contains its column position in the Working Window.Column positions start at zero.Output is INTEGEROutput is single layer RASTER.PIXELYMAPX<strong>Reference</strong> <strong>Manual</strong>133


Data GenerationPIXELY (Create Raster Containing Row Number)Syntax:Function Type:Description:Data Types:Object Types:See Also:PointPIXELYReturns a raster in which each pixel contains its row position in the Working Window. Rowpositions start at zero.Output is INTEGEROutput is single layer RASTER.PIXELXMAPY134<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Data GenerationRANDOM (Generate Random Values)Syntax:Function Type:Description:PointRANDOM(Returns object filled with pseudo-randomly generated floating point values greater than or equalto 0 and less than 1. The data type and value of the input is ignored. The input object determinesthe object type of the result.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGFLOATFLOATFLOATFLOATCOLORFLOATObject Types:See Also:Any object type may be input. Output object type is the same as input.SET RANDOM SEED<strong>Reference</strong> <strong>Manual</strong>135


Data GenerationSTACKLAYERS (Stack Raster Layers)Syntax: STACKLAYERS (, , , ...)Function Type:Description:PointOutputs RASTER which includes all the layers from , , , etc. Forexample, if has three layers, and has four layers, layers 1 through 3 of theoutput would be copied from , layers 4 through 7 would be copied from , andso forth.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXnot supportednot supportedObject Types:See Also:All inputs must be either RASTER or SCALAR. Each RASTER input may have any numberof layers. The output is a RASTER. The number of layers in the output is the sum of the numberof layers from all inputs.Raster Layer Stacks136<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Data GenerationTABLE (Create Table from List of Scalars)Syntax: TABLE (: , , , ...)orTABLE (, , , ...)Function Type:PointDescription:Data Types:Creates a table containing the scalar arguments input in the order listed. If is present,the number of subsequent arguments must equal . is an INTEGER constant. , , etc., may be any type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:See Also: is a constant. All input objects are SCALAR. Output is TABLE having number ofrows equal to number of arguments , , etc. If is present, number ofrows equals .LOOKUPTABLE SERIESMATRIX<strong>Reference</strong> <strong>Manual</strong>137


Data GenerationTABLE SERIES (Create Table Containing Series)Syntax:Function Type:Description:Data Types:PointTABLE SERIES (, , )Creates a table containing elements. The first element of the returned table contains. Each successive element in the table contains its predecessor + . Forexample:TABLE SERIES (4, 10, 2)results in the table:10121416 is BINARY, INTEGER, or FLOAT, and is converted to INTEGER. and may be any type other than STRING:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All input objects are SCALAR. Output is TABLE having rows.TABLEMATRIX SERIES138<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


DescriptorDescriptor. (Map Raster Through Descriptor Column):: (Read Descriptor Column or Color Table)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>139


Descriptor. (Map Raster Through Descriptor Column)Syntax:Function Type:Description:Data Types:Object Types:Notes:See Also:Point . Maps the single layer RASTER through the descriptor column from thedescriptor table for the file layer associated with .The pixel values of the input are converted to bin numbers using the descriptor table'sbin function. These bin numbers are then used as an index into the table read from the nameddescriptor column. The result is a single layer raster whose data type is the same as the nameddescriptor column. may be any data type. is a STRING constant. Output is the same type asthe descriptor column named in . is a single layer RASTER. is a constant. Output is single layer RASTER. must be a raster variable associated with an existing single layer file or an explicitlayer from an existing file: () is correct, but () is not allowed.This function is equivalent to:LOOKUP (, :: )If a TABLE variable has been declared to be associated with the descriptor column referencedby this operation, and that variable has been modified, this operation will not use the modifiedvalue stored in the variable. It will read the original unmodified values from the file layer'sdescriptor table.:: (Read Descriptor Column or Color Table)LOOKUP140<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


DistanceDistanceCIRC (Test if Inside Unit Circle)DIST (Distance)RECT (Rectangle)SEARCH (Search - Proximity Analysis)TRI (Triangle)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>143


DistanceCIRC (Test if Inside Unit Circle)Syntax:Function Type:Description:CIRC (, )PointReturns true if inside unit circle, false otherwise. For example:True if ** 2 + ** 2 1.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYnot supportedundefinednot supportedObject Types:See Also:All object types, standard rules.RECTTRIDIST144<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


DistanceDIST (Distance)Syntax:Function Type:Description:Data Types:DIST (, )PointComputes distance from origin:SQRT ( ** 2 + ** 2)Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportedCOLORnot supportedObject Types:See Also:All object types, standard rules.SQRT<strong>Reference</strong> <strong>Manual</strong>145


DistanceRECT (Rectangle)Syntax:Function Type:Description:PointRECT ()For INTEGER, FLOAT, COLOR—Returns: ABS ()


DistanceSEARCH (Search - Proximity Analysis)Syntax:Function Type:Description:orLayerSEARCH (, , )SEARCH (, , , , , ...)Performs a proximity analysis on , a single layer RASTER. The distance in pixels tosearch is specified by , a numeric SCALAR. The classes in from which tosearch are either listed as arguments , , etc., or are contained in .The output is a single layer RASTER, where the data value at each pixel is the distance in pixelsfrom the nearest pixel whose value in belongs to the set of search classes.Data Types:Input Output CommentsBINARYINTEGERINTEGERINTEGERFLOAT INTEGER FLOAT inputs converted toINTEGERCOMPLEXCOLORSTRINGnot supportednot supportednot supportedObject Types: is a single layer RASTER. is a SCALAR. is a TABLE, ,, etc., are SCALAR. The output is a single layer RASTER.<strong>Reference</strong> <strong>Manual</strong>147


DistanceTRI (Triangle)Syntax:Function Type:Description:PointTRI ()For INTEGER, FLOAT, COLOR—Computes MAX (1. - ABS (), 0.), i.e.:0 if < -11 + if -1


ExponentialExponentialEXP (Exponential)LOG (Natural Logarithm)LOG10 (Common Logarithm)POWER (Raise to Power)** (Raise to Power)SQRT (Square Root)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>149


ExponentialEXP (Exponential)Syntax:Function Type:Description:PointEXP ()Computes e raised to the power. The constant e equals 2.71828182845904, the base ofthe natural logarithm.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: EXP (1) equals 2.718281828 (the approximate value of e)EXP (2) equals e 2 (7.389056099)Notes:See Also:EXP is the inverse of LOG, the natural logarithm of .LOGPOWER150<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ExponentialLOG (Natural Logarithm)Syntax:Function Type:Description:PointLOG ()Computes the natural logarithm of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: LOG (e) equals 1Notes:See Also:If is INTEGER or FLOAT, and is less than or equal to zero, NaN (not anumber) is returned.LOG10EXP<strong>Reference</strong> <strong>Manual</strong>151


ExponentialLOG10 (Common Logarithm)Syntax:Function Type:Description:PointLOG10 ()Computes the common logarithm (base 10) of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: LOG10 (10) equals 1LOG10 (86) equals 1.9344985Notes:See Also:If is INTEGER or FLOAT, and is less than or equal to zero, NaN (not anumber) is returned.LOG152<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ExponentialPOWER (Raise to Power)Syntaxes:Function Type:Description:Data Types: POWER ** PointRaise to power. cannot be COMPLEX. The type of determines the output data type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.<strong>Reference</strong> <strong>Manual</strong>153


ExponentialSQRT (Square Root)Syntax:Function Type:Description:PointSQRT ()Computes the square root of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: SQRT (16) equals 4SQRT (-16) equals NaN (not a number)SQRT ((-16, 0)) equals (0, 4)Notes:See Also:If is a negative INTEGER or FLOAT, NaN (not a number) will be returned.** (Raise to Power)154<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Focal (Scan)Focal functions are generally used for neighborhood analyses.BOUNDARY (Boundary)FOCAL DENSITY (Focal Density)FOCAL DIVERSITY (Focal Diversity)FOCAL MAJORITY (Focal Majority)FOCAL MAX (Focal Maximum)FOCAL MEAN (Focal Mean)FOCAL MEDIAN (Focal Median)FOCAL MIN (Focal Minimum)FOCAL MINORITY (Focal Minority)FOCAL RANK (Focal Rank)FOCAL SD (Focal Standard Deviation)FOCAL STANDARD DEVIATION (Focal Standard Deviation)FOCAL SUM (Focal Sum)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>155


Focal (Scan)BOUNDARY (Boundary)Syntax:ororBOUNDARY (, )BOUNDARY (, , )BOUNDARY (, , , )Function Type:NeighborhoodDescription: Returns 0 (FALSE) if all pixels in the focal window have the same value. Returns 1(TRUE) if there is more than one value in the focal window. and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is 0.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.156<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERBINARYINTEGERFLOAT INTEGER input rounded to INTEGERCOMPLEXCOLORSTRINGnot supportednot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .FOCAL DIVERSITY<strong>Reference</strong> <strong>Manual</strong>157


Focal (Scan)FOCAL DENSITY (Focal Density)Syntax:ororFOCAL DENSITY (, )FOCAL DENSITY (, , )FOCAL DENSITY (, , , )Function Type:Description:NeighborhoodReturns number of occurrences of the center pixel value in focal window around eachpixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is 0.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.158<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERnot supportednot supportednot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .DENSITY<strong>Reference</strong> <strong>Manual</strong>159


Focal (Scan)FOCAL DIVERSITY (Focal Diversity)Syntax:ororFOCAL DIVERSITY (, )FOCAL DIVERSITY (, , )FOCAL DIVERSITY (, , , )Function Type:Description:NeighborhoodReturns number of different values in focal window around each pixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is 0.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.160<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERnot supportednot supportednot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .DIVERSITYGLOBAL DIVERSITYSTACK DIVERSITYBOUNDARYZONAL DIVERSITY<strong>Reference</strong> <strong>Manual</strong>161


Focal (Scan)FOCAL MAJORITY (Focal Majority)Syntax:ororFOCAL MAJORITY (, )FOCAL MAJORITY (, , )FOCAL MAJORITY (, , , )orFOCAL MAJORITY (, , )orFOCAL MAJORITY (, , , )orFOCAL MAJORITY (, , , , )Function Type:Description:NeighborhoodReturns the most commonly occurring value in focal window around pixel of. If is present, and the ratio of the number of occurrences of themajority value to the size of the focal window is greater than or equal to , thereturned pixel is the majority value. If this ratio is less than , the returned pixel isthe input pixel value. and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.162<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is the same as the input value.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.Data Types: may be any numeric type; it is converted to BINARY. may be anynumeric type, and is converted to FLOAT. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERnot supportednot supportednot supportednot supported and may be used only with INTEGER input rasterdata.If or is present, they must be INTEGER or BINARY, and must be INTEGER.Object Types:See Also: is a RASTER; is a MATRIX; is a SCALAR. and are either SCALAR, TABLE, or a comma-separated list of SCALARsenclosed in braces. Output is a RASTER with same number of layers as .MAJORITYGLOBAL MAJORITYSTACK MAJORITYZONAL MAJORITY<strong>Reference</strong> <strong>Manual</strong>163


Focal (Scan)FOCAL MAX (Focal Maximum)Syntax:ororFOCAL MAX (, )FOCAL MAX (, , )FOCAL MAX (, , , )Function Type:Description:NeighborhoodReturns the maximum of the data file values in focal window around each pixel of. and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is the same as the input value.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.164<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportednot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .MAXGLOBAL MAXSTACK MAXZONAL MAX<strong>Reference</strong> <strong>Manual</strong>165


Focal (Scan)FOCAL MEAN (Focal Mean)Syntax:ororFOCAL MEAN (, )FOCAL MEAN (, , )FOCAL MEAN (, , , )Function Type:Description:NeighborhoodReturns mean of pixels in focal window around each pixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is the same as the input value.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.166<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXnot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .MEANGLOBAL MEANSTACK MEANZONAL MEAN<strong>Reference</strong> <strong>Manual</strong>167


Focal (Scan)FOCAL MEDIAN (Focal Median)Syntax:ororFOCAL MEDIAN (, )FOCAL MEDIAN (, , )FOCAL MEDIAN (, , , )Function Type:Description:NeighborhoodReturns the median of values in focal window around each pixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is the same as the input value.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.168<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportednot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .MEDIANGLOBAL MEDIANSTACK MEDIANZONAL MEDIAN<strong>Reference</strong> <strong>Manual</strong>169


Focal (Scan)FOCAL MIN (Focal Minimum)Syntax:ororFOCAL MIN (, )FOCAL MIN (, , )FOCAL MIN (, , , )Function Type:Description:NeighborhoodReturns the minimum of values in focal window around each pixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is the same as the input value.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.170<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportednot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .MINGLOBAL MINSTACK MINZONAL MIN<strong>Reference</strong> <strong>Manual</strong>171


Focal (Scan)FOCAL MINORITY (Focal Minority)Syntax:ororFOCAL MINORITY (, )FOCAL MINORITY (, , )FOCAL MINORITY (, , , )Function Type:Description:NeighborhoodReturns the least commonly occurring value among in focal window around pixel of. and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is the same as the input value.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.172<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERnot supportednot supportednot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .MINORITYGLOBAL MINORITYSTACK MINORITY<strong>Reference</strong> <strong>Manual</strong>173


Focal (Scan)FOCAL RANK (Focal Rank)Syntax:ororFOCAL RANK (, )FOCAL RANK (, , )FOCAL RANK (, , , )Function Type:Description:NeighborhoodReturns the number of pixels in the focal window whose value is less than the centerpixel, for each pixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is 0.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.174<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERINTEGERnot supportednot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .RANK<strong>Reference</strong> <strong>Manual</strong>175


Focal (Scan)FOCAL SD (Focal Standard Deviation)Syntax:ororFOCAL SD (, )FOCAL SD (, , )FOCAL SD (, , , )Function Type:Description:NeighborhoodReturns standard deviation of pixels in focal window around each pixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is 0.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.176<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATFLOATnot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:Notes:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .Equivalent to:FOCAL STANDARD DEVIATION (, )FOCAL STANDARD DEVIATIONSDGLOBAL SDSTACK SDZONAL SD (from summary)<strong>Reference</strong> <strong>Manual</strong>177


Focal (Scan)FOCAL STANDARD DEVIATION (Focal Standard Deviation)Syntax:ororFOCAL STANDARD DEVIATION (, )FOCAL STANDARD DEVIATION (, , )FOCAL STANDARD DEVIATION (, , , )Function Type:Description:NeighborhoodReturns standard deviation of pixels in focal window around each pixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is 0.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.178<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATFLOATnot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:Notes:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .Equivalent to:FOCAL SD (, )FOCAL SD (, , )FOCAL SD (, , , )FOCAL SDSDGLOBAL STANDARD DEVIATIONSTACK STANDARD DEVIATION<strong>Reference</strong> <strong>Manual</strong>179


Focal (Scan)FOCAL SUM (Focal Sum)Syntax:ororFOCAL SUM (, )FOCAL SUM (, , )FOCAL SUM (, , , )Function Type:Description:NeighborhoodReturns sum of pixels in focal window around each pixel of . and , if present, may be either a or an. A is one of the following:IGNORE_VALUEUSE_VALUEUSE_LOOKUP_TABLEAn is one of the following:NO_APPLY_AT_VALUEAPPLY_AT_VALUEAPPLY_LOOKUP_TABLEIf and are both present, one of them must be a and theother must be an . and , if present, may be either a scalar or table expression, or theymay be:{ , , ..., }where , , etc., are each scalar expressions.A and its specifies which values are to be used in computing thefocal function. Pixels in the neighborhood whose values are specified as being ignored will notbe counted in the calculation of the focal function. IGNORE_VALUE specifies that the valuesin will not be used. USE_VALUE specifies that only the values in are used, all other values are ignored. USE_LOOKUP_TABLE specifies that its will be cast to BINARY and used as a binary lookup table to determine whether or not a valueis used: TRUE indicates to use the value, FALSE to ignore it. If all values in the neighborhoodof a pixel are ignored, the output value is 0.An and its specifies whether or not the focal function iscalculated for a particular input pixel value. If the option specifies that the function is not to beapplied for the value of a particular input pixel, the focal function is not calculated at that pixel,and the function returns the value of the input pixel. NO_APPLY_AT_VALUE specifies thatthe function will not be applied at values in . APPLY_AT_VALUE specifies thatthe function is applied only at the values in , and at no other values.APPLY_LOOKUP_TABLE specifies that its will be cast to BINARY and usedas a binary lookup table to determine whether or not to apply the function at a value: TRUEindicates to apply at the value, FALSE indicates not to apply at the value.180<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Focal (Scan)Data Types: may be any numeric type; it is converted to BINARY. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGFLOATFLOATFLOATCOMPLEXnot supportednot supported and may be used only with INTEGER input rasterdata.Object Types:See Also: is a RASTER; is a MATRIX. and are eitherSCALAR, TABLE, or a comma-separated list of SCALARs enclosed in braces. Output is aRASTER with same number of layers as .+ (Addition)SUMGLOBAL SUMSTACK SUM<strong>Reference</strong> <strong>Manual</strong>181


Focal (Scan)182<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalGlobalGLOBAL DIVERSITY (Global Diversity)GLOBAL MAJORITY (Global Majority)GLOBAL MAX (Global Maximum)GLOBAL MEAN (Global Mean)GLOBAL MEDIAN (Global Median)GLOBAL MIN (Global Minimum)GLOBAL MINORITY (Global Minority)GLOBAL SD (Global Standard Deviation)GLOBAL STANDARD DEVIATION (Global Standard Deviation)GLOBAL SUM (Global Sum)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>183


GlobalGLOBAL DIVERSITY (Global Diversity)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL DIVERSITY ()GLOBAL DIVERSITY (, )GLOBAL DIVERSITY (, )Computes number of different values in each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERnot supportednot supportednot supportednot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.184<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.DIVERSITYFOCAL DIVERSITYSTACK DIVERSITYSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>185


GlobalGLOBAL MAJORITY (Global Majority)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL MAJORITY ()GLOBAL MAJORITY (, )GLOBAL MAJORITY (, )Computes the most commonly occurring value (mode) in each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERnot supportednot supportednot supportednot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.186<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.MAJORITYFOCAL MAJORITYSTACK MAJORITYSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>187


GlobalGLOBAL MAX (Global Maximum)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL MAX ()GLOBAL MAX (, )GLOBAL MAX (, )Computes the maximum value of each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedFLOATnot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.188<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.MAXFOCAL MAXSTACK MAXSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>189


GlobalGLOBAL MEAN (Global Mean)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL MEAN ()GLOBAL MEAN (, )GLOBAL MEAN (, )Computes mean of all elements in each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.190<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.MEANFOCAL MEANSTACK MEANSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>191


GlobalGLOBAL MEDIAN (Global Median)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL MEDIAN ()GLOBAL MEDIAN (, )GLOBAL MEDIAN (, )Computes the median of each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.192<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.MEDIANFOCAL MEDIANSTACK MEDIANSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>193


GlobalGLOBAL MIN (Global Minimum)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL MIN ()GLOBAL MIN (, )GLOBAL MIN (, )Computes the minimum value of each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.194<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.MINFOCAL MINSTACK MINSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>195


GlobalGLOBAL MINORITY (Global Minority)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL MINORITY ()GLOBAL MINORITY (, )GLOBAL MINORITY (, )Computes the least commonly occurring value in each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERnot supportednot supportednot supportednot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.196<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.MINORITYFOCAL MINORITYSTACK MINORITYSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>197


GlobalGLOBAL SD (Global Standard Deviation)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL SD ()GLOBAL SD (, )GLOBAL SD (, )Computes the standard deviation of all elements in each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATFLOATCOLORnot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.198<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:Notes:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.Identical to:GLOBAL STANDARD DEVIATIONGLOBAL STANDARD DEVIATIONSDFOCAL SDSTACK SDSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>199


GlobalGLOBAL STANDARD DEVIATION (Global Standard Deviation)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL STANDARD DEVIATION ()GLOBAL STANDARD DEVIATION (, )GLOBAL STANDARD DEVIATION (, )Computes the standard deviation of all elements in each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATFLOATCOLORnot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.200<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:Notes:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.Identical to:GLOBAL SDGLOBAL SDSTANDARD DEVIATIONFOCAL STANDARD DEVIATIONSTACK STANDARD DEVIATIONSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>201


GlobalGLOBAL SUM (Global Sum)Syntax:Function Type:Description:Data Types:ororGlobalGLOBAL SUM ()GLOBAL SUM (, )GLOBAL SUM (, )Computes the total of all elements in each layer of . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. and may be used onlyif is a RASTER object.If is not present and is a RASTER object, the computation dependson whether is a previously existing file, or a RASTER created within the model. If is a RASTER created within the model, the default statistics option is used, as set bythe Preference Editor or the SET DEFAULT STATISTICS statement.If is a previously existing raster file, and is not present, the resultwill normally be computed from the statistics stored with the file. If all layers of containstatistics which were computed using all values, or if all layers have statistics which werecomputed ignoring the same background value, the statistics from the file will be used tocompute the result of this function. However, if layers used a different background value tocompute statistics, or some layers ignored a background value while others used all values, thedefault statistics option will be used, as set by the Preference Editor or the SET DEFAULTSTATISTICS statement.The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGFLOATFLOATFLOATCOMPLEXCOLORnot supported is one of the keywords USEALL or IGNORE. maybe any numeric type.202<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


GlobalObject Types:See Also: may be any object type. If is a SCALAR, TABLE, or MATRIX, the result isa SCALAR. If is a RASTER, the result is a TABLE with the same number of rowsas has layers. is one of the keywords USEALL or IGNORE. mustbe SCALAR. and may be present only if isa RASTER.SUMFOCAL SUMSTACK SUMSET DEFAULT STATISTICS<strong>Reference</strong> <strong>Manual</strong>203


Global204<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


MatrixMatrixMATDIV (Matrix Division)MATINV (Matrix Inverse)MATMUL (Matrix Multiplication)MATRIXTOTABLE (Convert Matrix to Table)MATTRANS (Matrix Transpose)TABLETOMATRIX (Convert Table to Matrix)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>205


MatrixMATDIV (Matrix Division)Syntax:Function Type:Description:PointMATDIV (, )Divides by using standard matrix division.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:See Also:Both inputs must be MATRIX. The matrices must be square and the same size.The output will be a MATRIX the same size as the input matrices./ (Division)MATMULMATINV206<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


MatrixMATINV (Matrix Inverse)Syntax:Function Type:Description:PointMATINV ()Returns the inverse of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:Notes:See Also:The input must be a square MATRIX. The output will be a MATRIX the same size as the input.Inverse matrices are generally used for solving systems of mathematical equations involvingseveral variables. An inverse matrix can also be used in computing inverse principalcomponents.INVMATDIVMATMUL<strong>Reference</strong> <strong>Manual</strong>207


MatrixMATMUL (Matrix Multiplication)Syntax:Function Type:Description:PointMATMUL (, )Multiplies by using standard matrix multiplication.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:See Also:Inputs must be either MATRIX or TABLE. The number of columns in must be thesame as the number of rows in .The output will be a MATRIX with number of rows equal to the number of rows in .The number of columns in the output will be the same as the number of columns in .The matrix product a of two arrays b and c is:where i is the row number and j is the column number.*(Multiplication)MATINVMATDIVMATRIXTOTABLEa ij=n∑k = 1b ik c kj208<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


MatrixMATRIXTOTABLE (Convert Matrix to Table)Syntax:Function Type:Description:PointMATTRIXTOTABLE ()Converts the one column matrix to a table.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:See Also:The input must be a one column MATRIX. The output will be a TABLE with the same numberof rows as the input MATRIX.TABLETOMATRIXMATMUL<strong>Reference</strong> <strong>Manual</strong>209


MatrixMATTRANS (Matrix Transpose)Syntax:Function Type:Description:PointMATTRANS ()Returns the transpose of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:Notes:See Also:The input type must be MATRIX or TABLE. The number of rows in the output MATRIX willbe the number of columns in . The number of columns in the output will be thenumber of rows in .Use MATTRANS to switch the vertical and horizontal orientation of .MATMULEIGENMATRIXLINEARCOMB210<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


MatrixTABLETOMATRIX (Convert Table to Matrix)Syntax:Function Type:Description:PointTABLETOMATRIX ()Converts the table to a one column matrix.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORSTRINGObject Types:See Also:The input must be a TABLE. The output will be a one column MATRIX with the same numberof rows as the input TABLE.MATRIXTOTABLEMATMUL<strong>Reference</strong> <strong>Manual</strong>211


Matrix212<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherOtherABS (Absolute Value)ANGLE (Angle)BINARY (Convert to Binary)CEIL (Ceiling)COMPLEX (Convert to Complex)CONJ (Complex Conjugate)DELTA (Delta)EVEN (Test if Even)FLOAT (Convert to Float)FLOOR (Floor)GAMMA (Gamma)IMAG (Imaginary Part)INTEGER (Convert to Integer)INV (Multiplicative Inverse)ODD (Test if Odd)REAL (Real Part)ROUND (Round)SIGN (Sign)SINC (Sinc)STEP (Step)TRUNC (Truncate)WHOLE (Test if Whole Number)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>213


OtherABS (Absolute Value)Syntax:Function Type:Description:PointABS ()Computes the absolute value of . The absolute value of is always greater thanor equal to zero.Data Types:Input Output CommentsBINARYINTEGERBINARYINTEGERFLOATFLOATCOMPLEX FLOAT Computes magnitude, i.e., SQRT(re*re + im*im)COLORSTRINGCOLORnot supportedObject Types:All object types, standard rules.Example: ABS (2) equals 2ABS (-2) equals 2ABS ((2, 3)) equals 3.605551275, which is equal to2 2 + 3 2214<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherANGLE (Angle)Syntax:Function Type:Description:ANGLE ()PointReturns the angle for a complex number, i.e.:ATAN (IMAG () / REAL ())Returns zero for other types.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATFLOATCOLORnot supportedObject Types:See Also:All object types, standard rules.CONJATANIMAGREAL<strong>Reference</strong> <strong>Manual</strong>215


OtherBINARY (Convert to Binary)Syntax:Function Type:Description:PointBINARY ()Returns true if non-zero, false if zero.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYBINARYundefinednot supportedObject Types:See Also:All object types, standard rules.NOTISNONZERO216<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherCEIL (Ceiling)Syntax:Function Type:Description:PointCEIL ()Computes the least integer greater than or equal to .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supportedObject Types:See Also:All object types, standard rules.FLOORROUND<strong>Reference</strong> <strong>Manual</strong>217


OtherCOMPLEX (Convert to Complex)Syntax:Function Type:Description:orPointCOMPLEX ()COMPLEX (, )Converts to COMPLEX type. If and are present, uses for the real partand for the imaginary part. If only is used and is BINARY,INTEGER, or FLOAT, is used for the real part and zero for the imaginary part.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGCOMPLEXCOMPLEXCOMPLEXCOMPLEXundefinednot supportedObject Types:See Also:All object types, standard rules.REALIMAGABS218<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherCONJ (Complex Conjugate)Syntax:Function Type:Description:PointCONJ ()Returns the conjugate of a complex number, i.e., the real part minus the imaginary part. Returns for other types.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:Notes:See Also:All object types, standard rules.Equivalent to:REAL () - IMAG ()REALIMAGABSANGLE<strong>Reference</strong> <strong>Manual</strong>219


OtherDELTA (Delta)Syntax:Function Type:Description:PointDELTA ()True if is zero, false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYBINARYundefinednot supportedObject Types:See Also:All object types, standard rules.Equivalent to NOT .NOTISNONZEROISALLTRUE220<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherEVEN (Test if Even)Syntax:Function Type:Description:PointEVEN ()Returns true if is an even number, false otherwise.Data Types:Input Output CommentsBINARYINTEGERBINARYBINARYFLOAT BINARY FLOAT inputs converted toINTEGERCOMPLEXCOLORSTRINGnot supportedundefinednot supportedObject Types:See Also:All object types, standard rules.ODD<strong>Reference</strong> <strong>Manual</strong>221


OtherFLOAT (Convert to Float)Syntax:Function Type:Description:PointFLOAT ()Converts to FLOAT type.Data Types:Input Output CommentsBINARYINTEGERFLOATFLOATFLOATFLOATCOMPLEX FLOAT Returns magnitude:ABS ()COLORSTRINGCOLORnot supportedObject Types:See Also:All object types, standard rules.ABSREAL222<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherFLOOR (Floor)Syntax:Function Type:Description:PointFLOOR ()Computes the greatest integer less than or equal to .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supportedObject Types:See Also:All object types, standard rules.INTEGERTRUNCCEILROUND<strong>Reference</strong> <strong>Manual</strong>223


OtherGAMMA (Gamma)Syntax:Function Type:Description:GAMMA ()PointComputes the gamma function of . GAMMA can be used in statistical analyses.For an integer n:GAMMA (n) = (n - 1) !Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.! (Factorial)224<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherIMAG (Imaginary Part)Syntax:Function Type:Description:PointIMAG ()Returns the imaginary part of a complex number. Returns zero for other types.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATFLOATCOLORnot supportedObject Types:See Also:All object types, standard rules.REALCONJABSANGLE<strong>Reference</strong> <strong>Manual</strong>225


OtherINTEGER (Convert to Integer)Syntax:Function Type:Description:PointINTEGER ()Truncates , returns INTEGER type.Data Types:Input Output CommentsBINARYINTEGERFLOATINTEGERINTEGERINTEGERCOMPLEX INTEGER Truncated magnitude:INTEGER (ABS ())COLORSTRINGundefinednot supportedObject Types:All object types, standard rules.226<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherINV (Multiplicative Inverse)Syntax:Function Type:Description:PointINV ()Computes the multiplicative inverse of , i.e., 1. / .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules./ (Division)MATINV<strong>Reference</strong> <strong>Manual</strong>227


OtherODD (Test if Odd)Syntax:Function Type:Description:PointODD ()Returns true if is an odd number, false otherwise.Data Types:Input Output CommentsBINARYINTEGERBINARYBINARYFLOAT BINARY FLOAT inputs converted toINTEGERCOMPLEXCOLORSTRINGnot supportedundefinednot supportedObject Types:See Also:All object types, standard rules.EVEN228<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherREAL (Real Part)Syntax:Function Type:Description:PointREAL ()Returns the real part of a complex number. Returns for other types.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATFLOATCOLORnot supportedObject Types:See Also:All object types, standard rules.FLOATIMAGABS<strong>Reference</strong> <strong>Manual</strong>229


OtherROUND (Round)Syntax:Function Type:Description:PointROUND ()Computes the nearest integer to .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supportedObject Types:All object types, standard rules.Notes: ROUND (-0.5) returns 0ROUND (0.5) returns 1See Also:INTEGERTRUNCFLOORCEIL230<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherSIGN (Sign)Syntax:Function Type:Description:PointSIGN ()Determines the sign of . Returns 1 if is positive, 0 if 0, -1 if negative.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supportedObject Types:All object types, standard rules.Example: SIGN (10) equals 1See Also:STEP<strong>Reference</strong> <strong>Manual</strong>231


OtherSINC (Sinc)Syntax:Function Type:Description:PointSINC ()Returns (SIN (π * )) / (π * ).Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.SIN232<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherSTEP (Step)Syntax:Function Type:Description:PointSTEP ()Returns true if >= 0, false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYnot supportedundefinednot supportedObject Types:All object types, standard rules.Notes: Equivalent to ( >= 0).See Also:SIGN<strong>Reference</strong> <strong>Manual</strong>233


OtherTRUNC (Truncate)Syntax:Function Type:Description:PointTRUNC ()Truncates to integer by removing the fractional part.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supportedObject Types:All object types, standard rules.Example: TRUNC (8.9) equals 8.0TRUNC (-8.9) equals -8.0Notes:See Also:TRUNC and INTEGER are similar, however they differ in the data type returned. If you inputa FLOAT to TRUNC, a FLOAT will be returned.INTEGERFLOORROUND234<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


OtherWHOLE (Test if Whole Number)Syntax:Function Type:Description:PointWHOLE ()Returns true if is a whole number (a non-negative integer). Returns false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATBINARYBINARYBINARYCOMPLEX BINARY True if real is whole and imaginaryis wholeCOLORSTRINGundefinednot supportedObject Types:See Also:All object types, standard rules.INTEGERSTEP<strong>Reference</strong> <strong>Manual</strong>235


Other236<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RelationalRelationalEQ (Equality)GE (Greater Than or Equal)GT (Greater Than)LE (Less Than or EqualLT (Less Than)NE (Inequality)== (Equality)>= (Greater Than or Equal)> (Greater Than)


RelationalEQ (Equality)Syntaxes:Function Type:Description: EQ == PointTrue if and are equal, false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATBINARYBINARYBINARYCOMPLEXBINARYCOLOR undefined for scalars use ISALLTRUE ( EQ)STRINGBINARYObject Types:Notes:See Also:All object types, standard rules.If inputs are COLOR scalars, the output data type is not fully supported, but may be used asinput to the ISALLTRUE function, which will return BINARY SCALAR.NE=~ (Case Insensitive String Equality)MATCHESISALLTRUE238<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RelationalGE (Greater Than or Equal)Syntaxes:Function Type:Description: GE >= PointTrue if is greater than or equal to , false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORBINARYBINARYBINARYnot supportedundefinedSTRING BINARY Uses lexical orderingObject Types:See Also:All object types, standard rules.GT<strong>Reference</strong> <strong>Manual</strong>239


RelationalGT (Greater Than)Syntaxes:Function Type:Description: GT > PointTrue if is greater than , false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORBINARYBINARYBINARYnot supportedundefinedSTRING BINARY Uses lexical orderingObject Types:See Also:All object types, standard rules.GE240<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RelationalLE (Less Than or Equal)Syntaxes:Function Type:Description: LE


RelationalLT (Less Than)Syntaxes:Function Type:Description: LT < PointTrue if is less than , false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORBINARYBINARYBINARYnot supportedundefinedSTRING BINARY uses lexical orderingObject Types:See Also:All object types, standard rules.LE242<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RelationalNE (Inequality)Syntaxes:Function Type:Description: NE != PointTrue if and are not equal, false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATBINARYBINARYBINARYCOMPLEXBINARYCOLOR undefined for scalars use ISNONZERO ( NE)STRINGBINARYObject Types:Notes:See Also:All object types, standard rules.If inputs are COLOR scalars, the output data type is not fully supported, but may be used asinput to the ISNONZERO function, which will return BINARY SCALAR.!~ (Case Insensitive String Inequality)EQISNONZERO<strong>Reference</strong> <strong>Manual</strong>243


Relational=~ (Case Insensitive String Equality)Syntax:Function Type:Description:Point =~ True if and are equal ignoring upper and lower case differences, falseotherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedBINARYObject Types:See Also:All object types, standard rules.!~ (Case Insensitive String Inequality)== (Equality)MATCHES244<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Relational!~ (Case Insensitive String Inequality)Syntax:Function Type:Description:Point !~ True if and are not equal ignoring upper and lower case differences,false otherwise.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedBINARYObject Types:See Also:All object types, standard rules.=~ (Case Insensitive String Equality)!= (Inequality)<strong>Reference</strong> <strong>Manual</strong>245


RelationalISALLTRUE (Test for All Non-zero)Syntax:Function Type:Description:PointISALLTRUE ()Returns BINARY SCALAR regardless of the input type. If any element of the input table ormatrix is zero, returns false. Returns true if all elements are non-zero.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYBINARYBINARYnot supportedObject Types:Notes:See Also:SCALAR, TABLE, or MATRIX on input, SCALAR output.RASTER input is not supported.ISALLTRUE will also accept as input the "undefined" data types returned by operations suchas:color1 == color2where color1 and color2 are COLOR SCALARs. In this case,ISALLTRUE (color1 == color2)will return a BINARY SCALAR which is true if the two colors are identical, or false if they arenot.ISNONZERO== (Equality)BINARY246<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


RelationalISNONZERO (Test for Non-zero)Syntax:Function Type:Description:PointISNONZERO ()Returns BINARY SCALAR regardless of input type. If any element of the input table or matrixis non-zero, returns true. Returns false if all elements are zero.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYBINARYBINARYBINARYBINARYnot supportedObject Types:Notes:See Also:SCALAR, TABLE, or MATRIX on input, SCALAR output.RASTER input is not supported.ISNONZERO will also accept as input the "undefined" data types returned by operations suchas:color1 != color2where color1 and color2 are COLOR SCALARs. In this case,ISNONZERO (color1 != color2)will return a BINARY SCALAR which is true if the two colors are different, or false if they arenot.ISALLTRUE!= (Inequality)BINARY<strong>Reference</strong> <strong>Manual</strong>247


Relational248<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


SizeSizeCELLAREA (Area of Grid Cells)CELLUNITS (Cell Size Units)CELLX (X Cell Size)CELLY (Y Cell Size)LAYERHEIGHT (Height of Raster Layer)LAYERWIDTH (Width of Raster Layer)NUMCOLS (Number of Columns)NUMLAYERS (Number of Layers)NUMROWS (Number of Rows)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>249


SizeCELLAREA (Area of Grid Cells)Syntax:)>Function Type:Description:PointCELLAREA (


SizeCELLUNITS (Cell Size Units)Syntax:Function Type:Description:PointCELLUNITSReturns a STRING specifying the distance units used in the current Working Window. If thecurrent Working Window is not georeferenced, “None” is returned.Data Types:Input Output CommentsnoneSTRINGObject Types:See Also:Output is SCALAR.CELLXCELLY<strong>Reference</strong> <strong>Manual</strong>251


SizeCELLX (X Cell Size)Syntax:Function Type:Description:PointCELLX ()Returns the X cell size of one pixel in the units specified. The cell width is from the currentWorking Window. is a STRING which specifies a distance unit from the file/etc/units.dat, such as “meters” or “feet.” Also, if is either“pixels” or “none,” 1 is returned. If a distance unit is specified and the Working Window isnot georeferenced, 0 is returned. If is not recognized as a distance unit, “pixels,” or“none,” 0 is returned.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedFLOATObject Types:See Also:Input and output are SCALAR.CELLAREACELLUNITSCELLY252<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


SizeCELLY (Y Cell Size)Syntax:Function Type:Description:PointCELLY ()Returns the Y cell size of one pixel in the units specified. The cell height is from the currentWorking Window. is a STRING which specifies a distance unit from the file/etc/units.dat, such as “meters” or “feet.” Also, if is either“pixels” or “none,” 1 is returned. If a distance unit is specified and the Working Window isnot georeferenced, 0 is returned. If is not recognized as a distance unit, “pixels,” or“none,” 0 is returned.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedFLOATObject Types:See Also:Input and output are SCALAR.CELLAREACELLUNITSCELLX<strong>Reference</strong> <strong>Manual</strong>253


SizeLAYERHEIGHT (Height of Raster Layer)Syntax:Function Type:Description:PointLAYERHEIGHT ()Returns the height in pixels of the first layer of the stack of raster file layers associated with. If there is no raster file layer associated with , 0 is returned.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERINTEGERINTEGERINTEGERINTEGERObject Types:See Also:Returns 0 if input is any type other than RASTER.NUMROWSNUMLAYERSLAYERWIDTH254<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


SizeLAYERWIDTH (Width of Raster Layer)Syntax:Function Type:Description:PointLAYERWIDTH ()Returns the width in pixels of the first layer of the stack of raster file layers associated with. If there is no raster file layer associated with , 0 is returned.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERINTEGERINTEGERINTEGERINTEGERObject Types:See Also:Returns 0 if input is any type other than RASTER.NUMCOLSNUMLAYERSLAYERHEIGHT<strong>Reference</strong> <strong>Manual</strong>255


SizeNUMCOLS (Number of Columns)Syntax:Function Type:Description:PointNUMCOLS ()Returns the number of columns in an object.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERINTEGERINTEGERINTEGERINTEGERObject Types:Notes:See Also:All input object types supported, see Notes for RASTER type. Output object type is SCALAR.Always returns 1 for SCALAR or TABLE. Returns the number of columns for MATRIX.Returns the width of the Working Window for RASTER input, which may not be the same aswidth of the associated file layer. Earlier versions of this function returned the tile size forRASTER input rather than the width of the Working Window.NUMROWSNUMLAYERSLAYERWIDTH256<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


SizeNUMLAYERS (Number of Layers)Syntax:Function Type:Description:PointNUMLAYERS ()Returns number of layers in object.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXINTEGERINTEGERINTEGERINTEGERCOLOR INTEGER Return value is 3STRINGINTEGERObject Types:Notes:See Also:All input object types supported. Output object type is SCALAR.Returns 1 for SCALAR, TABLE, or MATRIX of any type other than COLOR. Returns 3 forCOLOR objects. Returns the number of layers for RASTER object.NUMCOLSNUMROWS<strong>Reference</strong> <strong>Manual</strong>257


SizeNUMROWS (Number of Rows)Syntax:Function Type:Description:PointNUMROWS ()Returns the number of rows in an object.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERINTEGERINTEGERINTEGERINTEGERObject Types:Notes:See Also:All input object types supported, see Notes for RASTER type. Output object type is SCALAR.Always returns 1 for SCALAR. Returns the number of rows for TABLE and MATRIX.Returns the height of the Working Window for RASTER input, which may not be the same asheight of the associated file layer. Earlier versions of this function returned the tile size forRASTER input rather than the height of the Working WindowNUMCOLSNUMLAYERSLAYERHEIGHT258<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StackStackSTACK DIVERSITY (Stack Diversity)STACK MAJORITY (Stack Majority)STACK MAX (Stack Maximum)STACK MEAN (Stack Mean)STACK MEDIAN (Stack Median)STACK MIN (Stack Minimum)STACK MINORITY (Stack Minority)STACK SD (Stack Standard Deviation)STACK STANDARD DEVIATION (Stack Standard Deviation)STACK SUM (Stack Sum)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>259


StackSTACK DIVERSITY (Stack Diversity)Syntax:STACK DIVERSITY ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the number of different values for that pixelamong the layers of the input.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERnot supportednot supportednot supportednot supportedObject Types:See Also:Input must be RASTER with at least two layers. Result is single layer raster.DIVERSITYFOCAL DIVERSITYGLOBAL DIVERSITY260<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StackSTACK MAJORITY (Stack Majority)Syntax:STACK MAJORITY ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the most commonly occurring value for thatpixel among the layers of the input.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERnot supportednot supportednot supportednot supportedObject Types:See Also:Input must be RASTER with at least two layers. Result is single layer raster.MAJORITYFOCAL MAJORITYGLOBAL MAJORITY<strong>Reference</strong> <strong>Manual</strong>261


StackSTACK MAX (Stack Maximum)Syntax:STACK MAX ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the maximum value for that pixel among thelayers of the input.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportednot supportednot supportedObject Types:See Also:Input must be RASTER with at least two layers. Result is single layer raster.MAXFOCAL MAXGLOBAL MAX262<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StackSTACK MEAN (Stack Mean)Syntax:STACK MEAN ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the mean value for that pixel among thelayers of the input.Data Types:Input Output CommentsBINARYnot supportedINTEGER FLOAT converted to FLOATFLOATCOMPLEXCOLORSTRINGFLOATCOMPLEXnot supportednot supportedObject Types:See Also:Input must be RASTER with at least two layers. Result is single layer raster.MEANFOCAL MEANGLOBAL MEAN<strong>Reference</strong> <strong>Manual</strong>263


StackSTACK MEDIAN (Stack Median)Syntax:STACK MEDIAN ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the median value for that pixel among thelayers of the input.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportednot supportednot supportedObject Types:Notes:See Also:Input must be RASTER with at least two layers. Result is single layer raster.The median is the number in the middle of a set of values. If there is an even number of inputlayers, then MEDIAN will return the next higher value in the set of values.MEDIANFOCAL MEDIANGLOBAL MEDIAN264<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StackSTACK MIN (Stack Minimum)Syntax:STACK MIN ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the minimum value for that pixel among thelayers of the input.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportednot supportednot supportedObject Types:See Also:Input must be RASTER with at least two layers. Result is single layer raster.MINFOCAL MINGLOBAL MIN<strong>Reference</strong> <strong>Manual</strong>265


StackSTACK MINORITY (Stack Minority)Syntax:STACK MINORITY ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the least commonly occurring value for thatpixel among the layers of the input.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERnot supportednot supportednot supportednot supportedObject Types:See Also:Input must be RASTER with at least two layers. Result is single layer raster.MINORITYFOCAL MINORITYGLOBAL MINORITY266<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StackSTACK SD (Stack Standard Deviation)Syntax:STACK SD ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the standard deviation of the values for thatpixel from all the layers of the input.Data Types:Input Output CommentsBINARYnot supportedINTEGER FLOAT converted to FLOATFLOATCOMPLEXCOLORSTRINGFLOATFLOATnot supportednot supportedObject Types:Notes:See Also:Input must be RASTER with at least two layers. Result is single layer raster.Identical to:STACK STANDARD DEVIATION ()SDFOCAL SDGLOBAL SD<strong>Reference</strong> <strong>Manual</strong>267


StackSTACK STANDARD DEVIATIONSyntax:STACK STANDARD DEVIATION ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the standard deviation of the values for thatpixel from all the layers of the input. The standard deviation is a measure of how widely valuesare dispersed from the average value (mean).Data Types:Input Output CommentsBINARYnot supportedINTEGER FLOAT converted to FLOATFLOATCOMPLEXCOLORSTRINGFLOATFLOATnot supportednot supportedObject Types:Notes:Input must be RASTER with at least two layers. Result is single layer raster.Identical to:STACK SD ()Standard deviation uses the following formula:n x 2 ⎛∑x⎞∑–2⎝ ⎠----------------------------------------nn ( – 1)See Also:SDFOCAL STANDARD DEVIATIONGLOBAL STANDARD DEVIATION268<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StackSTACK SUM (Stack Sum)Syntax:STACK SUM ()Function Type: PointDescription:Returns a single layer each of whose pixels contain the sum of the values for that pixel over allthe layers of the input.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATCOMPLEXnot supportednot supportedObject Types:See Also:Input must be RASTER with at least two layers. Result is single layer raster.+ (Addition)FOCAL SUMGLOBAL SUM<strong>Reference</strong> <strong>Manual</strong>269


Stack270<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statistical (Local)Statistical (Local)DENSITY (Local Density)DIVERSITY (Local Diversity)MAJORITY (Local Majority)MAX (Local Maximum)MEAN (Local Mean)MEDIAN (Local Median)MIN (Local Minimum)MINORITY (Local Minority)RANK (Local Rank)SD (Local Standard Deviation)STANDARD DEVIATION (Local Standard Deviation)SUM (Local Sum)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>271


Statistical (Local)DENSITY (Local Density)Syntax: DENSITY (, , , ...)Function Type:Description:PointReturns the number of occurrences of value of among input values. This functionrequires at least two inputs.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERnot supportednot supportednot supportednot supportedObject Types:See Also:All object types, standard rules.FOCAL DENSITY272<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statistical (Local)DIVERSITY (Local Diversity)Syntax: DIVERSITY (, , , ...)Function Type:Description:PointReturns the number of different values among inputs. This function requires at least two inputs.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERnot supportednot supportednot supportednot supportedObject Types:See Also:All object types, standard rules.FOCAL DIVERSITYGLOBAL DIVERSITYSTACK DIVERSITY<strong>Reference</strong> <strong>Manual</strong>273


Statistical (Local)MAJORITY (Local Majority)Syntax: MAJORITY (, , , ...)Function Type:Description:PointReturns the most commonly occurring value among the given input values. This functionrequires at least two inputs.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERnot supportednot supportednot supportednot supportedObject Types:All object types, standard rules.Example: MAJORITY (10, 7, 7, 29.9, 2) equals 7See Also:FOCAL MAJORITYGLOBAL MAJORITYSTACK MAJORITY274<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statistical (Local)MAX (Local Maximum)Syntax: MAX (, , , ...)Function Type:Description:PointReturns the maximum value in the list of input arguments. This function requires at least twoinputs.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supportedObject Types:All object types, standard rules.Example: MAX (10, 7, 9, 27, 2) equals 27See Also:FOCAL MAXGLOBAL MAXSTACK MAX<strong>Reference</strong> <strong>Manual</strong>275


Statistical (Local)MEAN (Local Mean)Syntax: MEAN (, , , ...)Function Type:Description:PointReturns the mean of input values. This function requires at least two inputs.Data Types:Input Output CommentsBINARYnot supportedINTEGER FLOAT converted to FLOATFLOATCOMPLEXCOLORSTRINGFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.FOCAL MEANGLOBAL MEANSTACK MEAN276<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statistical (Local)MEDIAN (Local Median)Syntax: MEDIAN (, , , ...)Function Type:Description:PointReturns the median of the given input values. This function requires at least two inputs.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supportedObject Types:All object types, standard rules.Example: MEDIAN (1, 2, 3, 4, 5) equals 3MEDIAN (1, 2, 3, 4, 5, 6) equals 4Notes:See Also:The median is the number in the middle of a set of numbers. If there is an even set of numbers,then MEDIAN will return the next higher number in the set of numbers.FOCAL MEDIANGLOBAL MEDIANSTACK MEDIAN<strong>Reference</strong> <strong>Manual</strong>277


Statistical (Local)MIN (Local Minimum)Syntax: MIN (, , , ...)Function Type:Description:PointReturns the minimum value of the given input arguments. This function requires at least twoinputs.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportedCOLORnot supportedObject Types:All object types, standard rules.Example: MIN (10, 7, 9, 27, 2) equals 2See Also:FOCAL MINGLOBAL MINSTACK MIN278<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statistical (Local)MINORITY (Local Minority)Syntax: MINORITY (, , , ...)Function Type:Description:PointReturns the least commonly occurring value among the given input values. This functionrequires at least two inputs.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERnot supportednot supportednot supportednot supportedObject Types:All object types, standard rules.Example: MINORITY (1, 1, 3, 4, 4, 5, 5) equals 3See Also:FOCAL MINORITYGLOBAL MINORITYSTACK MINORITY<strong>Reference</strong> <strong>Manual</strong>279


Statistical (Local)RANK (Local Rank)Syntax: RANK (, , , ...)Function Type:Description:PointReturns the number of inputs whose value is less than the value of . This functionrequires at least two inputs.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERINTEGERINTEGERnot supportedundefinednot supportedObject Types:All object types, standard rules.Example: RANK (5, 3, 6, 2, 1, 7) equals 3See Also:FOCAL RANK280<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statistical (Local)SD (Local Standard Deviation)Syntax: SD (, , , ...)Function Type:Description:PointReturns the standard deviation value of input arguments. This function requires at least twoinputs.Data Types:Input Output CommentsBINARYnot supportedINTEGER FLOAT converted to FLOATFLOATCOMPLEXCOLORSTRINGFLOATFLOATCOLORnot supportedObject Types:Notes:See Also:All object types, standard rules.Identical to:STANDARD DEVIATION (, , , ...)STANDARD DEVIATIONFOCAL SDGLOBAL SDSTACK SD<strong>Reference</strong> <strong>Manual</strong>281


Statistical (Local)STANDARD DEVIATION (Local Standard Deviation)Syntax: STANDARD DEVIATION (, , , ...)Function Type:Description:PointReturns the standard deviation value of input arguments. The standard deviation is a measure ofhow widely values are dispersed from the average value (mean). This function requires at leasttwo inputs.Data Types:Input Output CommentsBINARYnot supportedINTEGER FLOAT converted to FLOATFLOATCOMPLEXCOLORSTRINGFLOATFLOATCOLORnot supportedObject Types:All object types, standard rules.Example: STANDARD DEVIATION (1395, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303,1299) equals 34.44544801405389Notes:Identical to:SD (, , , ...)Standard deviation uses the following formula:n x 2 ⎛∑x⎞∑–2⎝ ⎠----------------------------------------nn ( – 1)See Also:SDFOCAL STANDARD DEVIATIONGLOBAL STANDARD DEVIATIONSTACK STANDARD DEVIATION282<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Statistical (Local)SUM (Local Sum)Syntax: SUM (, , , ...)Function Type:Description:PointReturns the sum of all input arguments. This function requires at least two inputs.Data Types:Input Output CommentsBINARY BINARY Equivalent to logical OR of inputsINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: SUM (3, 2) equals 5See Also:+ (Addition)FOCAL SUMGLOBAL SUMSTACK SUM<strong>Reference</strong> <strong>Manual</strong>283


Statistical (Local)284<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StringString// (Concatenation)CAT (Concatenate Strings)LENGTH (Length of String)LOWERCASE (Lowercase Conversion)MATCHES (String Wildcard Match)UPPERCASE (Uppercase Conversion)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>285


StringCAT (Concatenate Strings)Syntaxes:Function Type:Description:CAT (, ) // PointConcatenate to the end of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedSTRINGObject Types:Notes:See Also:All object types, standard rules.Equivalent to: // LENGTH286<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StringLENGTH (Length of String)Syntax:Function Type:Description:PointLENGTH ()Find the number of characters in a string.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedINTEGERObject Types:See Also:All object types, standard rules.CAT<strong>Reference</strong> <strong>Manual</strong>287


StringLOWERCASE (Lowercase Conversion)Syntax:Function Type:Description:PointLOWERCASE ()Convert the characters in a string to lowercase.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedSTRINGObject Types:See Also:All object types, standard rules.UPPERCASE288<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


StringMATCHES (String Wildcard Match)Syntax:Function Type:Description:Point MATCHES True if matches the wildcard test string in .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedBINARYObject Types:Notes:See Also:All object types, standard rules.A "*" in may match any number of characters (including zero) in . A "?" in will match a single character in .EQ=~ (Case Insensitive String Equality)<strong>Reference</strong> <strong>Manual</strong>289


StringUPPERCASE (Uppercase Conversion)Syntax:Function Type:Description:PointUPPERCASE ()Convert the characters in a string to uppercase.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportednot supportednot supportednot supportednot supportedSTRINGObject Types:See Also:All object types, standard rules.LOWERCASE290<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


SurfaceSurfaceASPECT (Aspect)DEGREE SLOPE (Degree Slope)PERCENT SLOPE (Percent Slope)RELIEFFor more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>291


SurfaceASPECT (Aspect)Syntax:Function Type:Description:ASPECT ()NeighborhoodComputes aspect in degrees based on a 3 x 3 neighborhood around each pixel. isassumed to contain elevation values.Output value 0 is due north with degrees increasing clockwise. Output value 90 is due east, 180due south, and 270 due west. Output value 361 is flat.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:Notes:See Also: is a RASTER. Output is a RASTER with same number of layers as .See the description of the Aspect model in the on-line Graphical Models <strong>Reference</strong> Guide foralgorithmic details.PERCENT SLOPEDEGREE SLOPERELIEF292<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


SurfaceDEGREE SLOPE (Degree Slope)Syntax:Function Type:Description:Data Types:orDEGREE SLOPE (, )DEGREE SLOPE (, , )NeighborhoodComputes the slope in degrees based on a 3 x 3 neighborhood around each pixel. isassumed to contain elevation values.Either or and determine the relationship between the units ofelevation in the input and the ground unit pixel size in the Working Window., if present, must be a STRING constant containing the name of the units of elevation. should be "meters," "feet," "km," "yards," etc. A complete list of supported units iscontained in the file /etc/units.dat. If is used, the WorkingWindow must be georeferenced, and the units of elevation must be compatible with the pixelsize units, i.e., they must both be distance units or both be angle units. and , if present, are numeric scalars which specify the X and Y pixel size,respectively, in the same units used for elevation in . The Working Window does nothave to be georeferenced when and are used. is a STRING constant. and are numeric scalars. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:Notes:See Also: is a RASTER; is a STRING constant. and areSCALAR.Output is a RASTER with same number of layers as .See the description of the Slope - Degrees model in the on-line Graphical Models <strong>Reference</strong>Guide for algorithmic details.PERCENT SLOPERELIEF<strong>Reference</strong> <strong>Manual</strong>293


SurfacePERCENT SLOPE (Percent Slope)Syntax:Function Type:Description:Data Types:orPERCENT SLOPE (, )PERCENT SLOPE (, , )NeighborhoodComputes the slope as a percentage based on a 3 x 3 neighborhood around each pixel. is assumed to contain elevation values.Either or and determine the relationship between the units ofelevation in the input and the ground unit pixel size in the Working Window., if present, must be a STRING constant containing the name of the units of elevation. should be "meters," "feet," "km," "yards," etc. A complete list of supported units iscontained in the file /etc/units.dat. If is used, the WorkingWindow must be georeferenced, and the units of elevation must be compatible with the pixelsize units, i.e., they must both be distance units, or both be angle units. and , if present, are numeric scalars which specify the x and y pixel size,respectively, in the same units used for elevation in . The Working Window does nothave to be georeferenced when and are used. is a STRING constant. and are numeric scalars. The type of determines the output type.Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:Notes:See Also: is a RASTER; is a STRING constant. and areSCALAR.Output is a RASTER with same number of layers as .See the description of the Slope - Percent model in the on-line Graphical Models <strong>Reference</strong>Guide for algorithmic details.DEGREE SLOPERELIEF294<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


SurfaceRELIEF (Shaded Relief)Syntax:Function Type:Description:Data Types:orRELIEF (, , , , )RELIEF(, , , , ,)NeighborhoodComputes shaded relief based on a 3 x 3 neighborhood around each pixel. is assumedto contain elevation values.Either or and determine the relationship between the units ofelevation in the input and the ground unit pixel size in the Working Window., if present, must be a STRING constant containing the name of the units of elevation. should be "meters," "feet," "km," "yards," etc. A complete list of supported units iscontained in the file /etc/units.dat. If is used, the WorkingWindow must be georeferenced, and the units of elevation must be compatible with the pixelsize units, i.e., they must both be distance units, or both be angle units. and , if present, are numeric scalars which specify the X and Y pixel size,respectively, in the same units used for elevation in . The Working Window does nothave to be georeferenced when and are used. is a STRING constant. , , , , and are numeric scalars. The type of determines the output type:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supportedObject Types:See Also: is a RASTER; is a STRING constant. , ,, , and are SCALAR.Output is a RASTER with same number of layers as .ASPECTPERCENT SLOPEDEGREE SLOPE<strong>Reference</strong> <strong>Manual</strong>295


Surface296<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


TrigonometricTrigonometricACOS (Arccosine)ACOSH (Hyperbolic Arccosine)ASIN (Arcsine)ASINH (Hyperbolic Arcsine)ATAN (Arctangent)COS (Cosine)COSH (Hyperbolic Cosine)SIN (Sine)SINH (Hyperbolic Sine)TAN (Tangent)TANH (Hyperbolic Tangent)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>297


TrigonometricACOS (Arccosine)Syntax:Function Type:Description:PointACOS ()Computes the arccosine of . The arccosine is the angle whose cosine is . Thereturn angle is given in radians. To convert radians to degrees, use the following formula:radians x 180/π = degreesData Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:Example:See Also:All object types, standard rules.ACOS (-0.5) equals 2.094 (or 2 π/3 radians)ACOS (-0.5) x 180/π equals 120 degreesASINCOSACOSH298<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


TrigonometricACOSH (Hyperbolic Arccosine)Syntax:Function Type:Description:PointACOSH ()Computes the hyperbolic arccosine of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: ACOSH (1) equals 0See Also:COSHACOSASINH<strong>Reference</strong> <strong>Manual</strong>299


TrigonometricASIN (Arcsine)Syntax:Function Type:Description:PointASIN ()Computes the arcsine of . The arcsine is the angle whose sine is . The returnedvalue is in radians. To convert radians to degrees, use the following formula:radians x 180/π = degreesData Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.SINASINH300<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


TrigonometricASINH (Hyperbolic Arcsine)Syntax:Function Type:Description:PointASINH ()Computes the hyperbolic arcsine of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:See Also:All object types, standard rules.SINHASIN<strong>Reference</strong> <strong>Manual</strong>301


TrigonometricATAN (Arctangent)Syntax:Function Type:Description:PointATAN ()Computes the arctangent of . The arctangent is the angle whose tangent is . Theresult is in radians. To convert radians to degrees, use the following formula:radians x 180/π = degreesData Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:Example:See Also:All object types, standard rules.ATAN (1) equals 0.785 (π/4 radians)ATAN (1) x 180/π equals 45 degreesTAN302<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


TrigonometricCOS (Cosine)Syntax:Function Type:Description:PointCOS ()Computes the cosine of . Enter in radians. To convert degrees to radians, usethe following formula:degrees x π/180 = radiansData Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: COS (1.047197551196598) equals 0.5COS (60 x π/180) equals 0.5, the cosine of 60 degreesSee Also:SINACOSCOSH<strong>Reference</strong> <strong>Manual</strong>303


TrigonometricCOSH (Hyperbolic Cosine)Syntax:Function Type:Description:PointCOSH ()Computes the hyperbolic cosine of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: COSH (4) equals 27.308233Notes:The formula for hyperbolic cosine is:cosh( x)=e-----------------x +2e – xSee Also:COSACOSHSINHEXP304<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


TrigonometricSIN (Sine)Syntax:Function Type:Description:PointSIN ()Computes the sine of . Enter in radians. To convert degrees to radians, use thefollowing formula:degrees x π/180 = radiansData Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: SIN (0.5236) equals 0.5Notes: The sine of π is 0.See Also:SINHASIN<strong>Reference</strong> <strong>Manual</strong>305


TrigonometricSINH (Hyperbolic Sine)Syntax:Function Type:Description:PointSINH ()Computes the hyperbolic sine of . You can use the hyperbolic sine function toapproximate a cumulative probability distribution.Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: SINH (1) equals 1.175201194SINH (-1) equals -1.175201194Notes:The formula for the hyperbolic sine is:sinh( x)=e xe – x–-----------------2See Also:SINASINHCOSHEXP306<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


TrigonometricTAN (Tangent)Syntax:Function Type:Description:PointTAN ()Computes the tangent of . Enter in radians. To convert degrees to radians, usethe following formula:degrees x π/180 = radiansData Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: TAN (0.7853981634) equals 1.TAN (45 x π/180) equals 1See Also:ATANTANHSINHCOSHEXP<strong>Reference</strong> <strong>Manual</strong>307


TrigonometricTANH (Hyperbolic Tangent)Syntax:Function Type:Description:PointTANH ()Computes the hyperbolic tangent of .Data Types:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATCOMPLEXCOLORnot supportedObject Types:All object types, standard rules.Example: TANH (-2) equals -0.96402758TANH (0) equals 0Notes:The formula for hyperbolic tangent is:tanh( x)=e xe xe – xe – x-----------------–+See Also:TAN308<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZonalSUMMARY (Summary)ZONAL DIVERSITY (Zonal Diversity)ZONAL MAJORITY (Zonal Majority)ZONAL MAJORITY COUNT (Zonal Majority Count)ZONAL MAJORITY FRACTION (Zonal Majority Fraction)ZONAL MAX (Zonal Maximum from Summary)ZONAL MAX (Zonal Maximum from Two Rasters)ZONAL MEAN (Zonal Mean from Summary)ZONAL MEAN (Zonal Mean from Two Rasters)ZONAL MEDIAN (Zonal Median)ZONAL MIN (Zonal Minimum from Summary)ZONAL MIN (Zonal Minimum from Two Rasters)ZONAL RANGE (Zonal Range from Summary)ZONAL RANGE (Zonal Range from Two Rasters)ZONAL SD (Zonal Standard Deviation from Summary)ZONAL SD (Zonal Standard Deviation from Two Rasters)ZONAL STANDARD DEVIATION (Zonal Standard Deviation from Summary)ZONAL STANDARD DEVIATION (Zonal Standard Deviation from Two Rasters)For more information see Standard Rules.<strong>Reference</strong> <strong>Manual</strong>309


ZonalSUMMARY (Cross Tabulation)Syntax:Function Type:Description:Data Types:ZonalSUMMARY (, )Returns a MATRIX containing a cross tabulation of the two input rasters. In the returned matrix,position [i, j] (i.e., row i, column j) contains the number of pixels which have value i in and value j in . The values in are referredto as “zones,” and the values in as “classes.” and must contain only unsigned integer values.Input Output CommentsBINARY INTEGER converted to INTEGERINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERnot supportednot supportednot supportednot supportedObject Types: and are RASTER. Output is a MATRIX with (GLOBALMAX () + 1) rows and (GLOBAL MAX () + 1) columns; thenumber of zones is the number of rows and the number of classes is the number of columns.310<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL DIVERSITY (Zonal Diversity)Syntax:Function Type:Description:Data Types:ororPointZONAL DIVERSITY ()ZONAL DIVERSITY (, )ZONAL DIVERSITY (, )The input should be the output of the SUMMARY function. This function computesthe number of different values in each zone. The rows of represent the zones, and thecolumns represent the classes input to the SUMMARY function. This function returns aTABLE containing the number of different classes contained in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is also INTEGER:Input Output CommentsBINARY INTEGER inputs converted toINTEGERINTEGERINTEGERFLOAT INTEGER inputs converted toINTEGERCOMPLEX INTEGER inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:See Also:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.SUMMARYDIVERSITYFOCAL DIVERSITYGLOBAL DIVERSITY<strong>Reference</strong> <strong>Manual</strong>311


ZonalSTACK DIVERSITY312<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL MAJORITY (Zonal Majority)Syntax:Function Type:Description:Data Types:ororPointZONAL MAJORITY ()ZONAL MAJORITY (, )ZONAL MAJORITY (, )The input should be the output of the SUMMARY function. This function computesthe most commonly occurring value in each zone. The rows of represent the zones,and the columns represent the classes input to the SUMMARY function. This function returnsa TABLE containing the most commonly occurring class value contained in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is also INTEGER:Input Output CommentsBINARY INTEGER inputs converted toINTEGERINTEGERINTEGERFLOAT INTEGER inputs converted toINTEGERCOMPLEX INTEGER inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:See Also:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.SUMMARYMAJORITYFOCAL MAJORITYGLOBAL MAJORITY<strong>Reference</strong> <strong>Manual</strong>313


ZonalSTACK MAJORITY314<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL MAJORITY COUNT (Zonal Majority Count)Syntax:Function Type:Description:Data Types:ororPointZONAL MAJORITY COUNT ()ZONAL MAJORITY COUNT (, )ZONAL MAJORITY COUNT (, )The input should be the output of the SUMMARY function. This function computesthe number of pixels in the most commonly occurring value in each zone. The rows of represent the zones, and the columns represent the classes input to the SUMMARYfunction. This function returns a TABLE containing the number of pixels in the most commonlyoccurring class in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is also INTEGER:Input Output CommentsBINARY INTEGER inputs converted toINTEGERINTEGERINTEGERFLOAT INTEGER inputs converted toINTEGERCOMPLEX INTEGER inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:See Also:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.SUMMARYZONAL MAJORITY<strong>Reference</strong> <strong>Manual</strong>315


ZonalZONAL MAJORITY FRACTION316<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL MAJORITY FRACTION (Zonal Majority Fraction)Syntax:Function Type:Description:Data Types:ororPointZONAL MAJORITY FRACTION ()ZONAL MAJORITY FRACTION (, )ZONAL MAJORITY FRACTION (, )The input should be the output of the SUMMARY function. This function computesthe fraction of the total zone which overlaps the majority class in each zone. The rows of represent the zones, and the columns represent the classes input to the SUMMARYfunction. This function returns a TABLE containing the fraction of the total zone whichoverlaps the majority class in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is FLOAT; output values range from 0.0 to 1.0.Input Output CommentsBINARY FLOAT inputs converted toINTEGERINTEGERFLOATFLOAT FLOAT inputs converted toINTEGERCOMPLEX FLOAT inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:See Also:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.SUMMARYZONAL MAJORITY<strong>Reference</strong> <strong>Manual</strong>317


ZonalZONAL MAJORITY COUNT318<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL MAX (Zonal Maximum from Summary)Syntax:Function Type:Description:Data Types:ororPointZONAL MAX ()ZONAL MAX (, )ZONAL MAX (, )The input should be the output of the SUMMARY function. This function computesthe maximum class value in each zone. The rows of represent the zones, and thecolumns represent the classes input to the SUMMARY function. This function returns aTABLE containing the maximum class value in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is also INTEGER:Input Output CommentsBINARY INTEGER inputs converted toINTEGERINTEGERINTEGERFLOAT INTEGER inputs converted toINTEGERCOMPLEX INTEGER inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.See Also:SUMMARY MAX FOCAL MAX GLOBAL MAXSTACK MAXZONAL MAX (from rasters)<strong>Reference</strong> <strong>Manual</strong>319


ZonalZONAL MAX (Zonal Maximum from Two Rasters)Syntax:Function Type:Description:Data Types:ororZonalZONAL MAX (, )ZONAL MAX (, , )ZONAL MAX (, , )This function finds the maximum value in which overlays each zone of. This function returns a TABLE containing one row per zone. Row i of thereturned table contains the maximum value from of all pixels which havevalue i in . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. may be any numeric type, and is converted to INTEGER. may be any numeric type. The output type is the same as the type of:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportednot supportednot supported is one of the keywords USEALL or IGNORE.Object Types: and are RASTER. The result is a TABLE. The number ofrows in the output TABLE is (GLOBAL MAX () + 1), i.e., the number ofzones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.See Also:SUMMARY MAX FOCAL MAX GLOBAL MAXSTACK MAXZONAL MAX (from summary)320<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL MEAN (Zonal Mean from Summary)Syntax:Function Type:Description:Data Types:ororPointZONAL MEAN ()ZONAL MEAN (, )ZONAL MEAN (, )The input should be the output of the SUMMARY function. This function computesthe mean class value in each zone. The rows of represent the zones, and the columnsrepresent the classes input to the SUMMARY function. This function returns a TABLEcontaining the mean class value in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is FLOAT:Input Output CommentsBINARY FLOAT inputs converted toINTEGERINTEGERFLOATFLOAT FLOAT inputs converted toINTEGERCOMPLEX FLOAT inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.See Also:SUMMARY MEAN FOCAL MEAN GLOBAL MEANSTACK MEANZONAL MEAN (from rasters)<strong>Reference</strong> <strong>Manual</strong>321


ZonalZONAL MEAN (Zonal Mean from Two Rasters)Syntax:Function Type:Description:Data Types:ororZonalZONAL MEAN (, )ZONAL MEAN (, , )ZONAL MEAN (, , )This function finds the mean of all values in which overlay each zone of. This function returns a TABLE containing one row per zone. Row i of thereturned table contains the mean value from of all pixels which have value iin . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. may be any numeric type, and is converted to INTEGER. may be any numeric type. may be INTEGER orFLOAT. The output type is FLOAT.Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supported is one of the keywords USEALL or IGNORE.Object Types: and are RASTER. The result is a TABLE. The number ofrows in the output TABLE is (GLOBAL MAX () + 1), i.e., the number ofzones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.See Also:SUMMARY MEAN FOCAL MEAN GLOBAL MEANSTACK MEANZONAL MEAN (from summary)322<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL MEDIAN (Zonal Median)Syntax:Function Type:Description:Data Types:ororPointZONAL MEDIAN ()ZONAL MEDIAN (, )ZONAL MEDIAN (, )The input should be the output of the SUMMARY function. This function computesthe statistical median class value in each zone. The rows of represent the zones, andthe columns represent the classes input to the SUMMARY function. This function returns aTABLE containing the statistical median class value in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is also INTEGER:Input Output CommentsBINARY INTEGER inputs converted toINTEGERINTEGERINTEGERFLOAT INTEGER inputs converted toINTEGERCOMPLEX INTEGER inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:See Also:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.SUMMARYMEDIANFOCAL MEDIANSTACK MEDIAN<strong>Reference</strong> <strong>Manual</strong>323


ZonalGLOBAL MEDIAN324<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL MIN (Zonal Minimum from Summary)Syntax:Function Type:Description:Data Types:ororPointZONAL MIN ()ZONAL MIN (, )ZONAL MIN (, )The input should be the output of the SUMMARY function. This function computesthe minimum class value in each zone. The rows of represent the zones, and thecolumns represent the classes input to the SUMMARY function. This function returns aTABLE containing the minimum class value in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER.The output is also INTEGER:Input Output CommentsBINARY INTEGER inputs converted toINTEGERINTEGERINTEGERFLOAT INTEGER inputs converted toINTEGERCOMPLEX INTEGER inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.See Also:SUMMARY MIN FOCAL MIN GLOBAL MINSTACK MINZONAL MIN (from rasters)<strong>Reference</strong> <strong>Manual</strong>325


ZonalZONAL MIN (Zonal Minimum from Two Rasters)Syntax:Function Type:Description:Data Types:ororZonalZONAL MIN (, )ZONAL MIN (, , )ZONAL MIN (, , )This function finds the minimum value in which overlays each zone of. This function returns a TABLE containing one row per zone. Row i of thereturned table contains the minimum value from of all pixels which havevalue i in . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. may be any numeric type, and is converted to INTEGER. may be any numeric type. The output type is the same as the type of:Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGBINARYINTEGERFLOATnot supportednot supportednot supported is one of the keywords USEALL or IGNORE.Object Types: and are RASTER. The result is a TABLE. The number ofrows in the output TABLE is (GLOBAL MAX () + 1), i.e., the number ofzones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.See Also:SUMMARY MIN FOCAL MIN GLOBAL MINSTACK MINZONAL MIN (from summary)326<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL RANGE (Zonal Range from Summary)Syntax:Function Type:Description:Data Types:ororPointZONAL RANGE ()ZONAL RANGE (, )ZONAL RANGE (, )The input should be the output of the SUMMARY function. This function computesthe range between the minimum and maximum class values in each zone. The rows of represent the zones, and the columns represent the classes input to the SUMMARYfunction. This function returns a TABLE containing the range between the minimum andmaximum class values in each zone. Range is computed as:MIN - MAX + 1 is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is also INTEGER:Input Output CommentsBINARY INTEGER inputs converted toINTEGERINTEGERINTEGERFLOAT INTEGER inputs converted toINTEGERCOMPLEX INTEGER inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:See Also:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.SUMMARYZONAL RANGE (from rasters)<strong>Reference</strong> <strong>Manual</strong>327


ZonalZONAL RANGE (Zonal Range from Two Rasters)Syntax:Function Type:Description:Data Types:ororZonalZONAL RANGE (, )ZONAL RANGE (, , )ZONAL RANGE (, , )This function finds the range of values in which overlay each zone of. This function returns a TABLE containing one row per zone. Row i of thereturned table contains the range of values from of all pixels which have valuei in . If is INTEGER or BINARY, the range is computed as:MAX - MIN + 1If is FLOAT, the range is computed as:MAX - MIN is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. may be any numeric type, and is converted to INTEGER. may be any numeric type. The output type depends on the type of:Input Output CommentsBINARY INTEGER converted to INTEGERINTEGERFLOATCOMPLEXCOLORSTRINGINTEGERFLOATnot supportednot supportednot supported is one of the keywords USEALL or IGNORE.Object Types: and are RASTER. The result is a TABLE. The number ofrows in the output TABLE is (GLOBAL MAX () + 1), i.e., the number ofzones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.See Also: SUMMARY ZONAL RANGE (from summary328<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL SD (Zonal Standard Deviation from Summary)Syntax:Function Type:Description:Data Types:ororPointZONAL SD ()ZONAL SD (, )ZONAL SD (, )The input should be the output of the SUMMARY function. This function computesthe standard deviation of the class values in each zone. The rows of represent thezones, and the columns represent the classes input to the SUMMARY function. This functionreturns a TABLE containing the standard deviation of the class values in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is FLOAT:Input Output CommentsBINARY FLOAT inputs converted toINTEGERINTEGERFLOATFLOAT FLOAT inputs converted toINTEGERCOMPLEX FLOAT inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.<strong>Reference</strong> <strong>Manual</strong>329


ZonalNotes:See Also:Equivalent to:ZONAL STANDARD DEVIATION ()ZONAL STANDARD DEVIATION (, )ZONAL STANDARD DEVIATION (, )SUMMARYZONAL STANDARD DEVIATION (from summary)ZONAL SDSDFOCAL SDGLOBAL SDSTACK SD330<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalZONAL SD (Zonal Standard Deviation from Two Rasters)Syntax:Function Type:Description:Data Types:ororZonalZONAL SD (, )ZONAL SD (, , )ZONAL SD (, , )This function finds the standard deviation of all values in which overlay eachzone of . This function returns a TABLE containing one row per zone. Row iof the returned table contains the standard deviation from of all pixels whichhave value i in . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. may be any numeric type, and is converted to INTEGER. may be any numeric type. may be INTEGER orFLOAT. The output type is FLOAT.Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:See Also: and are RASTER. The result is a TABLE. The number ofrows in the output TABLE is (GLOBAL MAX () + 1), i.e., the number ofzones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.SUMMARYZONAL STANDARD DEVIATION (from summary)SDFOCAL SDGLOBAL SDSTACK SD<strong>Reference</strong> <strong>Manual</strong>331


ZonalZONAL STANDARD DEVIATION (from Summary)Syntax:Function Type:Description:Data Types:ororPointZONAL STANDARD DEVIATION ()ZONAL STANDARD DEVIATION (, )ZONAL STANDARD DEVIATION (, )The input should be the output of the SUMMARY function. This function computesthe standard deviation of the class values in each zone. The rows of represent thezones, and the columns represent the classes input to the SUMMARY function. This functionreturns a TABLE containing the standard deviation of the class values in each zone. is either USEALL or IGNORE. USEALL indicates to use all input classesin the computation, IGNORE indicates to ignore a background class. specifies the background class to be ignored. If is not present, zero isused as the background class. and may be any numeric type, and are converted toINTEGER. The output is FLOAT:Input Output CommentsBINARY FLOAT inputs converted toINTEGERINTEGERFLOATFLOAT FLOAT inputs converted toINTEGERCOMPLEX FLOAT inputs converted toINTEGERCOLORSTRINGnot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:The result is TABLE. The number of rows in the output TABLE is the same as the number ofrows in , which is the number of zones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.332<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalNotes:See Also:Equivalent to:ZONAL SD ()ZONAL SD (, )ZONAL SD (, )SUMMARYZONAL SD (from rasters)ZONAL STANDARD DEVIATION (from rasters)SDFOCAL SDGLOBAL SDSTACK SD<strong>Reference</strong> <strong>Manual</strong>333


ZonalZONAL STANDARD DEVIATION (from Two Rasters)Syntax:Function Type:Description:Data Types:ororZonalZONAL STANDARD DEVIATION (, )ZONAL STANDARD DEVIATION (, ,)ZONAL STANDARD DEVIATION (, , )This function finds the standard deviation of all values in which overlay eachzone of . This function returns a TABLE containing one row per zone. Row iof the returned table contains the standard deviation from of all pixels whichhave value i in . is either USEALL or IGNORE. USEALL indicates to use all input valuesin the computation, IGNORE indicates to ignore a background value. specifies the background value to be ignored. If is not present, zero isused as the background value. may be any numeric type, and is converted to INTEGER. may be any numeric type. may be INTEGER orFLOAT. The output type is FLOAT.Input Output CommentsBINARYINTEGERFLOATCOMPLEXCOLORSTRINGnot supportedFLOATFLOATnot supportednot supportednot supported is one of the keywords USEALL or IGNORE.Object Types:See Also: and are RASTER. The result is a TABLE. The number ofrows in the output TABLE is (GLOBAL MAX () + 1), i.e., the number ofzones. is one of the keywords USEALL or IGNORE. mustbe SCALAR.SUMMARYZONAL SD (from summary)ZONAL STANDARD DEVIATION (from summary)SD334<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


ZonalFOCAL STANDARD DEVIATIONGLOBAL STANDARD DEVIATIONSTACK STANDARD DEVIATION<strong>Reference</strong> <strong>Manual</strong>335


Zonal336<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


Appendix AIndexesThis document provides an Index of Symbols as well as the standard alphabetic Index ofKeywords.Index of SymbolsSymbolUsage! Factorial!= Inequality!~ Case Insensitive String Inequality&&&Bitwise AndLogical And* Multiplication** Raise to Power+ Addition- SubtractionNegation/ Division// Concatenation. Map Raster Through Descriptor Column:: Read Descriptor Column or Color TableSee TABLE Declarations, Descriptors and Color Tables< Less Than Greater Than>= Greater Than or Equal^Bitwise Exclusive Or| Bitwise Or<strong>Reference</strong> <strong>Manual</strong>337


SymbolUsage|| Logical Or~ Bitwise NotIndex of KeywordsThe following keywords are interpreted to have special meaning by the <strong>Modeler</strong>, and shouldnot be used as variable names:.KeywordABSACOSACOSHANDANGLEAOIUsageAbsolute ValueArccosineHyperbolic ArccosineLogical AndAngleSee SET AOI statementSee Raster Declarations, Area Of Interest SpecificationSee Vector Declarations, Area Of Interest SpecificationASASINASINHASPECTATANATHEMATICBILINEARSee VIEW statementArcsineHyperbolic ArcsineAspectArctangentSee RASTER Declarations, Layer Type ParametersSee RASTER Declarations, Interpolation ParametersSee SET DEFAULT INTERPOLATION statementBINBINARYSee RASTER Declarations, Bin Function SpecificationData Type SpecifierConvert to BINARYBINSBITSee RASTER Declarations, Bin Function SpecificationSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementBOUNDARYC128BoundarySee RASTER Declarations, Data Type ParametersSee SET DEFAULT statement338<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


KeywordC64UsageSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementCATCATEGORICALCEILCELLAREACELLSIZECELLUNITSCELLXCELLYCIRCCLUMPCOLORConcatenate StringsSee RASTER Declarations, Layer Type ParametersCeilingArea of Grid CellsSee SET CELLSIZE statementCell Size UnitsX Cell SizeY Cell SizeTest if Inside Unit CircleClump (Contiguity Analysis)Data Type SpecifierCreate Color ScalarCOLORTABLESee TABLE Declarations, Descriptors and Color TablesSee:(Read Descriptor Column or Color Table)COMPLEXData Type SpecifierConvert to COMPLEXCOMPLEX_DOUBLESee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementCOMPLEX_SINGLESee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementCOMPONENTSCONDITIONALCONJCONTINUOUSCONVOLUTIONSee PRINCIPAL COMPONENTSConditionalComplex ConjugateSee RASTER Declarations, Layer Type ParametersSee RASTER Declarations, Interpolation ParametersSee SET DEFAULT INTERPOLATION statementCONVOLVECORRELATIONCOSCOSHConvolutionCorrelation from Covariance Matrix or RasterCosineHyperbolic Cosine<strong>Reference</strong> <strong>Manual</strong>339


KeywordCOVARIANCECUBICUsageCovariance MatrixSee RASTER Declarations, Interpolation ParametersSee SET DEFAULT INTERPOLATION statementDEBUGDEFAULTDEGREEDELETEDELETE_IF_EXISTINGDELROWSDELTADENSITYFor Internal Use OnlyBinary Constant, Equals 1 or TRUESee DEGREE SLOPEReserved for Future UseSee RASTER Declarations, Existence ParametersDelete Rows from Sieved Descriptor ColumnDeltaLocal DensitySee FOCAL DENSITYDESCRIPTORDEVIATIONSee TABLE Declarations, Descriptors and Color TablesSee STANDARD DEVIATIONSee FOCAL STANDARD DEVIATIONSee GLOBAL STANDARD DEVIATIONSee STACK STANDARD DEVIATIONSee ZONAL STANDARD DEVIATIONDIRECTSee RASTER Declarations, Bin Function SpecificationSee DIRECT LOOKUPDISTDIVERSITYDistanceLocal DiversitySee FOCAL DIVERSITYSee GLOBAL DIVERSITYSee STACK DIVERSITYSee ZONAL DIVERSITYDOUBLESee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementEDGEEIGENMATRIXEIGENVALUESEITHERSee Raster Declarations, Edge Extension SpecificationCompute Matrix of EigenvectorsCompute Table of EigenvaluesSee EITHER...IF...OR....OTHERWISE340<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


KeywordELSEEQEVENEXPF32UsageSee Flow Control, Conditional BranchingEqualityTest if EvenExponentialSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementF64See RASTER Declarations, Data Type ParametersSee SET DEFAULT statementFALSE Binary Constant, Equals 0FILESee RASTER Declarations, Using FilesSee RASTER Declarations, Window SpecificationSee SET WINDOW statementFILLFLOATSee Raster Declarations, Edge Extension SpecificationData Type SpecifierConvert to FLOATFLOAT_DOUBLESee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementFLOAT_SINGLESee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementFLOORFOCALFORFROMGAMMAGEGLOBALGTHISTMATCHHISTOEQHISTOGRAMHUEFloorUsed in Neighborhood Functions FOCAL MAX, FOCAL SUM, etc.Reserved for Future UseSee RASTER Declarations, Bin Function SpecificationGammaGreater Than or EqualUsed in Neighborhood Functions GLOBAL MAX, GLOBAL SUM,etc.Greater ThanHistogram MatchingHistogram EqualizationHistogramGet Hue from RGB<strong>Reference</strong> <strong>Manual</strong>341


KeywordIFUsageSee EITHER...IF...OR....OTHERWISESee Flow Control, Conditional BranchingIGNORESee SET DEFAULT STATISTICS statementSee RASTER Declarations, Statistics ParametersSee GLOBAL functionsSee COVARIANCE, HISTOEQ, HISTOGRAM, PRINCIPALCOMPONENTS, RASTERMATCH, and STRETCHIHSTOBLUIHSTOGRNIHSTOREDIHSTORGBIMAGINDEXINPUTINTEGERGet Blue from Intensity, Hue and SaturationGet Green from Intensity, Hue and SaturationGet Red from Intensity, Hue and SaturationGet Red, Green and Blue from Intensity, Hue and SaturationImaginary PartIndex (Find Matching Item on List)See RASTER Declarations, Access ParametersData Type SpecifierConvert to INTEGERINTENSINTERPOLATIONGet Intensity from RGBSee RASTER Declarations, Interpolation ParametersSee SET DEFAULT INTERPOLATION statementINTERSECTIONINVISALLTRUEISNONZEROLAYERHEIGHTLAYERWIDTHLELENGTHLINEARLINEARCOMBLOGSee SET WINDOW statementMultiplicative InverseTest for All Non-zeroTest for Non-zeroHeight of Raster LayerWidth of Raster LayerLess Than or EqualLength of StringSee RASTER Declarations, Bin Function SpecificationLinear CombinationNatural LogarithmSee RASTER Declarations, Bin Function SpecificationLOG10Common Logarithm342<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


KeywordLOOKUPUsageMap Input Values Through Lookup TableSee DIRECT LOOKUPLOWERCASELTMAJORITYLowercase ConversionLess ThanLocal MajoritySee FOCAL MAJORITYSee GLOBAL MAJORITYSee STACK MAJORITYSee ZONAL MAJORITYSee ZONAL MAJORITY COUNTSee ZONAL MAJORITY FRACTIONMAPSee RASTER Declarations, Window SpecificationSee SET WINDOW statementMAPXMAPYMATCHESMATDIVMATINVMATMULMATRIXCreate Raster Containing X Map CoordinatesCreate Raster Containing Y Map CoordinatesString Wildcard MatchMatrix DivisionMatrix InverseMatrix MultiplicationObject Type SpecifierCreate Matrix from List of ScalarsSee MATRIX SERIESMATRIXTOTABLEMATTRANSMAXConvert 1 Column Matrix to TableMatrix TransposeLocal MaximumSee FOCAL MAXSee GLOBAL MAXSee STACK MAXSee ZONAL MAX<strong>Reference</strong> <strong>Manual</strong>343


KeywordMEANUsageLocal MeanSee FOCAL MEANSee GLOBAL MEANSee STACK MEANSee ZONAL MEANMEDIANLocal MedianSee FOCAL MEDIANSee GLOBAL MEDIANSee STACK MEDIANSee ZONAL MEDIANMINLocal MinimumSee FOCAL MINSee GLOBAL MINSee STACK MINSee ZONAL MINMINORITYLocal MinoritySee FOCAL MINORITYSee GLOBAL MINORITYSee STACK MINORITYMODNENEARESTModulusInequalitySee RASTER Declarations, Interpolation ParametersSee SET DEFAULT INTERPOLATION statementNEIGHBORSee RASTER Declarations, Interpolation ParametersSee SET DEFAULT INTERPOLATION statementNEWNONESee RASTER Declarations, Existence ParametersSee SET AOI statementSee Raster Declarations, Area Of Interest SpecificationNOTNUMCOLSNUMLAYERSLogical NOTNumber of ColumnsNumber of Layers344<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


KeywordNUMROWSODDOLDORUsageNumber of RowsTest if OddSee RASTER Declarations, Existence ParametersLogical ORSee EITHER...IF...OR....OTHERWISEORIGINOTHERWISEOUTPUTPERCENTPIPICKPIXELSee SET DEFAULT ORIGIN statementSee EITHER...IF...OR....OTHERWISESee RASTER Declarations, Access ParametersSee PERCENT SLOPEFloat ConstantPick (Get nth Item on List)See RASTER Declarations, Window SpecificationSee SET WINDOW statementPIXELXPIXELYPOWERPRINCIPALPRINTTREEQUITRANDOMRANKCreate Raster Containing Column NumberCreate Raster Containing Row NumberRaise to PowerSee PRINCIPAL COMPONENTSFor Internal Use OnlyQuit StatementGenerate random data.Local RankSee FOCAL RANKRASTERRASTERMATCHREADREALRECTREFLECTRELIEFRESETRGBTOIHSROUNDObject Type SpecifierRaster MatchingREAD statementReal PartRectangleSee Raster Declarations, Edge Extension SpecificationShaded ReliefFor Internal Use OnlyGet Intensity, Hue and Saturation from Red, Green and BlueRound<strong>Reference</strong> <strong>Manual</strong>345


KeywordS16UsageSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementS32See RASTER Declarations, Data Type ParametersSee SET DEFAULT statementS8See RASTER Declarations, Data Type ParametersSee SET DEFAULT statementSATURSCALARSDGet Saturation from RGBObject Type SpecifierLocal Standard DeviationSee FOCAL SDSee GLOBAL SDSee STACK SDSee ZONAL SDSEARCHSEEDSERIESSearch (Proximity Analysis)See SET RANDOM SEEDSee MATRIX SERIESSee TABLE SERIESSETSee Setting WindowsSee Other SET statementsSHOWSIEVETABLESIGNSIGNEDSHOW statementGet Sieve Lookup TableSignSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementSIGNED_16_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementSIGNED_32_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementSIGNED_8_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementSINSine346<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


KeywordSINCSINGLEUsageSincSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementSINHSLOPEHyperbolic SineSee DEGREE SLOPESee PERCENT SLOPESQRTSTACKSTACKLAYERSSTANDARDSquare RootConvert FLOAT TABLE to COLOR SCALARStack Raster LayersSee STANDARD DEVIATIONSee FOCAL STANDARD DEVIATIONSee GLOBAL STANDARD DEVIATIONSee STACK STANDARD DEVIATIONSee ZONAL STANDARD DEVIATIONSTATISTICSSTEPSTRETCHSTRINGSUMSee SET DEFAULT STATISTICS statementStepStretch raster dataData Type SpecifierLocal SumSee FOCAL SUMSee GLOBAL SUMSee STACK SUMSUMMARYTABLESummary - Cross TabulationObject Type SpecifierCreate Table from List of ScalarsSee TABLE SERIESTABLETOMATRIXTANTANHTHEMATICTILESIZETOConvert Table to 1 Column MatrixTangentHyperbolic TangentSee RASTER Declarations, Layer Type ParametersSee SET TILESIZE statementSee RASTER Declarations, Bin Function Specification<strong>Reference</strong> <strong>Manual</strong>347


KeywordTRIUsageTriangleTRUE Binary Constant, Equals 1TRUNCU1TruncateSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementU16See RASTER Declarations, Data Type ParametersSee SET DEFAULT statementU2See RASTER Declarations, Data Type ParametersSee SET DEFAULT statementU32See RASTER Declarations, Data Type ParametersSee SET DEFAULT statementU4See RASTER Declarations, Data Type ParametersSee SET DEFAULT statementU8See RASTER Declarations, Data Type ParametersSee SET DEFAULT statementUNIONUNLESSUNSIGNEDSee SET WINDOW statementSee Flow Control, Conditional BranchingSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementUNSIGNED_1_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementUNSIGNED_16_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementUNSIGNED_2_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementUNSIGNED_32_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementUNSIGNED_4_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementUNSIGNED_8_BITSee RASTER Declarations, Data Type ParametersSee SET DEFAULT statementUNSTACKConvert COLOR SCALAR to FLOAT TABLE348<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>


KeywordUNTILUPPERCASEUSEALLUsageSee Flow Control, LoopingUppercase ConversionSee SET DEFAULT STATISTICS statementSee RASTER Declarations, Statistics ParametersSee GLOBAL functionsSee COVARIANCE, HISTOEQ, HISTOGRAM, PRINCIPALCOMPONENTS, RASTERMATCH, and STRETCHUSEFILEUSINGVIEWWHILEWHOLEWINDOWReserved for future useSee VIEW statementObsolete. No longer supportedSee Flow Control, LoopingTest if Whole NumberSee SET WINDOW statementSee RASTER Declarations, Window SpecificationSee VECTOR Declarations, Window SpecificationWRITEZONAL RANGEWRITE statementZonal Range from Summary or from two Rasters<strong>Reference</strong> <strong>Manual</strong>349


350<strong>ERDAS</strong> <strong>Spatial</strong> <strong>Modeler</strong> <strong>Language</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!