Programming Examples

Every Manifold License Supports Programming

Create New Applications and Customize Manifold

Making an add-in

This page provides links to downloads for programming examples. Downloads on this page are not supported by technical support.

Manifold IMS Programming Examples

Please see the Live IMS Examples page for examples of IMS running on manifold.net servers, with links to complete source code for examples. Programming IMS is programming Manifold, so these examples provide useful insight into programming Manifold System.

Manifold Image Servers and Geocoding Servers

See the Image Servers and Geocoding Servers page for links to source code for image servers and geocoding servers for use within Manifold and the Manifold Toolbar. Don't miss the incredible usefulness of image servers, one of the most popular features in Manifold System.

Add-Ins

Programming

Add-ins enable Manifold users to extend the capabilities of Manifold System by adding new commans to the Custom toolbar or to the Tools - Add-Ins menu. Add-ins can also control which Manifold toolbars are shown, hidden or disabled when the system starts up. Two examples show how to use add-ins:

CreateLayout.zip - This add-in demonstrates how to create a layout and populate it with a page for each defined view. A sample file to try out is included. The example shows how to create a layout and populate it with entries based on the content of the currently opened component. The example illustrates:

  • How to obtain the currently opened component.
  • How to enumerate views defined within the component.
  • How to create a layout.
  • How to create layout entries (elements) and alter their properties.

Screenshots.zip - Shows how to make quick screenshots of the active component (analogous to the output of the Make Image command in "entire component" mode). This example adds three new commands, to make screenshots at 400x300, 800x600 and 2400x1800 resolutions. The example illustrates:

  • How to obtain the currently opened component.
  • How to screenshot the component into a new image of desired size.
  • How to place a component into a folder, creating one if necessary.
R8 Object Model

Scripting Examples

Scripting examples show various techniques in the context of real tasks. Although some may be used as utilities, the main intention is to present examples of programming techniques and use of Manifold facilities. See the Comments component in each project for notes.

In addition to general scripting examples, the ScriptTableNwindActive example listed below illustrates the use of Active Columns using JavaScript and VBScript.

To download the sources for these scripts, please click here to download the scripts700.zip file (2,621 KB) - These examples were originally created for use in Release 7.00 and have been verified to work fine in Release 8.00 as well.

  • ScriptCopyCreate - (Copy Objects, Create Record) A very small example containing two scripts: copy objects from one drawing to another and create a record in a table.
  • ScriptCentroids - (Create Centroids) Creates centroids and weighted centroids for sets of cities in each country in a drawing.
  • ScriptQuartiles - (Assign data values to quartiles) Given a numeric column in a table, create a new integer column that for each given value assigns a number from 1 to 4 stating the quartile in which that value occurs. A simple example.
  • ScriptCopyObjects - (Copy objects to new drawing) Copy selected objects in the active drawing to a new drawing.
  • ScriptSpatialOperations - (Spatial operations) Three scripts demonstrating various spatial operations on a map of Europe. “Create Circle around Each City” creates a circular area around each city object taking the radius of the area from a table column. “Transfer Country Name to Each City” mimics the internal workings of spatial overlays and adds a country name to each city using the name of the country it is in. “Transfer Country Name to Each City using Query” does the same but uses a service query instead of the obvious two loops (and thus, runs much faster).
  • ScriptBSpline - (Create b-splines from selected points) Two scripts: Join points selected within the active drawing window with a closed b-spline, or an open 3-spline that runs through all points. The order of points on a spline is determined by their IDs.
  • ScriptBSpline2 - (Smooth selected lines using b-splines) A script to "splinerize" selected lines. Replaces selected lines with b-splines to provide a smoother line. A great way to convert unsmooth lines into smoothly curved lines. Manifold also includes a Spline transform in the transform toolbar.
  • ScriptTextFormats - (Import / Export Drawings in Text Formats) Manifold System Release 4.50 included utilities for reading data from simple ASCII formats. These scripts provide examples of that functionality implemented with scripting. Scripts import/export drawings to an ASCII format, and can import networks (drawings of lines and points) from an ASCII format.
  • ScriptNDVI - (Compute NDVI from AVHRR images) Computes NDVI (Normalized Difference Vegetation Index) using Band 1 and Band 2 and puts result into NDVI. Displays computation progress in status bar. Missing values are handled properly. Band 1 and and 2 are parts of an AVHRR import. Display Options for all three surfaces are set to render height with shading and autocontrast options turned off. See http://earthobservatory.nasa.gov/Library/MeasuringVegetation/ for info on NDVI.
  • ScriptTransferSelection - (Transfer Selections / Select Pixels within 50 Meters) Contains two scripts, one of which transfers a selection from a drawing to an image (a script version of the Transfer Selection command in map windows). The second script performs a more complicated task by selecting pixels that are within 50 meters of selected drawing objects. Both scripts track their progress in the status bar.
  • ScriptAzimuthLines - (Create Lines by Azimuth and Distance Pairs) Creates lines using set of azimuth (bearing) and distance pairs stored in a table.
  • ScriptCoordinateSystems - (Report and change coordinate systems (projections) Two scripts, one of which reports the number of objects and the coordinate system of each drawing. The other projects a sample drawing into a customized version of the Mercator projection.
  • ScriptForms - (Basic Form Controls) Demonstrates the use of several basic controls: textbox, list and buttons. Uses VBScript.
  • ScriptHello - ("Hello, World!") The classic "Hello, World!" first program implemented in JavaScript, VBScript, PerlScript and PythonScript.
  • ScriptImpoftFolder - (Mass Import) Imports all MapInfo MIF/MID files within a user-specified folder and all of its subfolders.
  • ScriptRandomPoints - (Create Random Points) Creates a drawing of points using records taken from a data table. Point locations are random.
  • ScriptSequentialLines - (Join Points into a Line) Joins points selected within the active drawing window with a line.
  • ScriptSurfaces - (Surface selection examples) Three scripts: Select pixels between given heights; Compute average height and select pixels below that height. Compute slope of each pixel and select pixels with values of slope less than 25%. All three scripts track operation progress within the status bar.
  • ScriptTableGeneric - (Table selection examples) Two scripts working with tables and Active Columns: Select all records with a value in the Active Column equal to that in the active cell. Check if an Active Column is a Date type and if so select all records whose year and month are the same as the active cell.
  • ScriptTableNwind - (Table manipulation examples) Uses excerpts from the Nwind.mdb sample database in five scripts: Add a relation between tables, remove relations and rank columns (Decision Support System), Create a sales by city report table, select products based on a category from a different table, use a rank column to find a young but experienced employee.
  • ScriptTableNwindActive - (Active Column examples) Six tables using excerpts from Nwind.mdb to illustrate the use of Active Columns using JavaScript and VBScript: Determine language from country; Find full name, age and years on the job of employees; Compute unit prices from base price and discount; Compute the shipping delay of an order; Find the average price and category name of products using a lookup in other tables; Find the number of supplied products per supplier a table lookup.
  • ScriptTableNwindForms - (Forms and tables) Two forms using several tables at once from Nwind.mdb that illustrate the use of forms with tables: Category Viewer - Walks through categories displaying a list of products for current category. Employee Viewer - Walks through employees displaying properties of current employee.

Programming Examples are Not Supported

The downloads on this page are not supported. Not supporting these downloads makes it possible to provide them for free. If you do not understand the preceding sentence please use this form to ask questions or to send comments. It's your world.


Buy Now via the Online Store

Buy Manifold products on the Online Store. The store is open 24 hours / seven days a week / every day of the year. Orders are processed immediately with serial number email sent out in seconds. Use Manifold products today!

 Click to begin shopping


Suggestions

Suggestions to improve Manifold are always welcome. Please see the Suggestions page for tips on making effective suggestions.


No other GIS comes close to Manifold for applications development.

Click to watch the user-contributed video: How forms in Manifold System GIS allow creating applications like this in an hour or two.

About Manifold

Manifold is a deep technology company creating advanced, parallel algorithms, next-level technology, and computation know-how that powers faster performance and smarter operations.

License Manifold® technology to power your company's products, or take advantage of Manifold's off-the-shelf commercial products. Jump decades ahead of your competition.

Manifold® brand products deliver quality, performance and value in the world's most sophisticated, most modern, and most powerful spatial products for GIS, ETL, DBMS, and Data Science. Total integration ensures ease of use, amazing speed, and unbeatably low cost of ownership. Tell your friends!

Questions? Contact sales@manifold.net. We're happy to help!