Examples

This topic provides links to examples in this documentation.

Examples By Category

Introductory Examples

 

Tables and Queries Examples

 

Queries Examples

 

Data Sources Examples

 

Selection Examples

 

Drawings Examples

 

Images Examples

 

Format Examples

 

Transform Images Examples

 

Transform Examples

 

Projections Examples

 

Programming Examples

 

Interoperability Examples

 

Complete List of Examples

Introductory Examples

 

Example: Project Pane Tutorial - In this example we take an extended tour of the Project pane, engaging in a variety of simple but typical moves that are illustrated step by step.

 

Example: Layers Tutorial - We take a tour of the Layers panel in the Contents pane, learning how to manage layer display order, select layers, turn several layers on and off at the same time, alter opacity settings for one or more layers and how to change background color.

 

Example: Import a Shapefile - ESRI shapefiles are a very popular format for publishing GIS and other spatial data.  Unfortunately, shapefiles often will not specify what projection should be used.  This example shows how to deal with that quickly and easily.

 

Example: Closing without Saving - An example that shows how File - Close without saving the project can affect local tables and components differently from those saved already into a data source, such as an .mdb file database.

 

Example: Spectacular Images and Data from Web Servers - A must see topic providing a gallery of views illustrating how Manifold can use web servers such as imageservers and other free resources to provide a seemingly endless selection of spectacular background maps, satellite images and GIS data with nearly zero effort.

 

Example: An Imageserver Tutorial - An extensive tutorial showing step by step how to add new data sources that are imageservers, how to show them as layers in a map, how to create a new drawing that matches the projection of the map and how to ttech_tina_sm.pngrace over what is seen in an imageserver layer to create an area object in the drawing.

 

Example: Edit a Shapefile In Place - How to edit a shapefile "in place," that is, leaving the data in the shapefile and only linking it into a project and not importing it into the project.

 

Example: Style Panel Quickstart - A tutorial introduction to using the Style panel in the Contents pane to apply color, symbology, size and rotation to areas, lines and points in drawings.

 

Tech Tip:  Don't miss the web server and imageserver examples.   Few things are as easy, as useful and as fun in Manifold as taking advantage of web servers and image servers.

 

 

Tables and Queries Examples

 

Example: Editing Records in a Table - How to edit the contents of an existing record using mouse and keyboard.

 

Example: Adding Records to a Table - How to add a new record to a table using mouse and keyboard.

 

Example: Create a Table and Add a Record - Create a table with required fields and then add a record with value for those fields.  Creates the OGR-required table to prepare a Manifold project for use by OGR as detailed in the Example: Connect to Radian from QGIS topic.

 

Example: Add a Field to a Table and Fill It - We add a field to a table and simultaneously for all records fill the field with a specified value.   We do that in two examples, first a very simple one and second, a more elaborate example that also shows restriction to a selection as well as use of the Transform dialog.

 

Example: Add a Computed Field to a Table - In this example we add a field to a table.  We first set the values for a field dynamically with a computed field using the Add Computed Field option in the New Field dialog.   We then illustrate what happens when we fill a field statically with values using the Add Field option.  Last, we show what the Add Component choice does in the New Field dialog.

 

Example: Create a Table with a Constraint - Create a simple table that includes a simple constraint upon one of its fields.  

 

Adding an Index to a Table - A basic topic on adding an index using the built-in capabilities of the mfd_id field.

 

Example: Add a UUID-based Index to a Table - Create a new computed field that is filled with UUID values on creation and then create an index on that field.   This technique creates an indexed field that has guaranteed unique values for all records and thus the indexed field and record values may be used in other projects.

 

Example: Add a Spatial Index to a Table - A typical use of an index is to provide a spatial index on a geom field in a table, so the geom data can be visualized in a drawing.  This example shows how to add a spatial index using a geom field in a table.

 

Example: Create a Geocoded Table from a Drawing - A partner example to Example: Create a Drawing from a Geocoded Table   A geocoded table has records with a latitude and longitude for each record.   This example starts with a table for a drawing of points where the geom field in the table contains geometry information for each point.   We extract the Y and X locations for each point  from the geom field to create latitude and longitude fields in the table for each record.

 

Example: Street Address Geocoding -  Geocode a table of street addresses using the Google geocoder.

 

SQL Example: Create a Table with a Constraint via a Query -  A simple example using SQL to create a table with a constraint.

 

SQL Example: Force an Anomaly in Constraints - Constraints are only evaluated when we insert or update records.   If a constraint refers to external data, such as the values in a different table, we can force an anomalous condition where the table with the constraint may contain data that no longer meets the requirements of the constraint.

 

SQL Example: Using the mfd_id Field and mfd_id_x Index - A sequence of SQL examples of working with the mfd_id field and mfd_id_x index.   

 

 

Queries Examples

 

Example: Create and Run a Query -  See how the different parts of a command window operate when creating and running SQL queries.   Includes use of the Log tab as well as the ?expression and !fullfetch commands.

 

Example: Export the Results of a Query - How to export the results table of a query for use in other applications.

 

Example: Refer to a Table within a Data Source -  Within a query, how to refer to a table that is in a data source.

 

Example: Switching between Manifold and Native Query Engines - How to use the !manifold and !native commands to switch a query in the Command window from use the Manifold query engine to whatever query engine is provided by a data source.

 

Example: Automatically Generating CREATE Queries - How to use the Command window to automatically generate SQL in the form of CREATE queries that create a desired component.

 

SQL Example: GeomOverlayAdjacent Function - Using the GeomOverlayAdjacent function, an example that shows how this function and similar functions such as GeomOverlayContained, GeomOverlayContaining, GeomOverlayIntersecting and GeomOverlayTouching operate.

 

SQL Example: GeomOverlayTopologyUnion Function - A continuation of the SQL Example: GeomOverlayAdjacent Function example, using the GeomOverlayTopologyUnion function, an example that shows how this function and similar functions such as GeomOverlayTopologyIdentity, GeomOverlayTopologyIntersect and GeomOverlayTopologyUpdate operate.

 

 

Data Sources Examples

 

Example: Closing without Saving - An example that shows how File - Close without saving the project can affect local tables and components differently from those saved already into a data source, such as an .mdb file database.

 

Example: Create a New Data Source from a Manifold Image Server - Manifold image server modules are snippets of code which use the Manifold Image Server Interface (ISI) to automatically fetch image tiles from popular image servers like Virtual Earth, Wikimapia, Yahoo!, Google Maps, Yandex and many others. Image servers can provide street maps, overhead satellite imagery, combinations of streets and satellite imagery and other data as well.  Using Manifold Image Servers is one of the most popular Manifold features.

 

Example: Create a New Data Source from a MAP File - Create a new data source from an existing Manifold .map project file.   This is the classic way to nest projects, one calling another, to create libraries of data and projects.   Access to nested projects has effectively zero performance loss and the links within projects take up effectively zero space so we can create huge constellations of data at our fingertips.

 

Example: Create a Data Source within an Existing Data Source - When a data source is writable, for example, if the data source is a Manifold .map file, we can work within that data source as if it were at the top level of our project.   For example, we can create a new data source that is nested within the existing data source.   This example shows how.

 

Example: Create and Use New Data Source using an MDB Database - This example Illustrates the step-by-step creation of a new data source using an .mdb file database, followed by use of SQL.  Although now deprecated in favor of the more current Access Database Engine formats, .mdb files are ubiquitous in the Microsoft world, one of the more popular file formats in which file databases are encountered.  

 

Example: Modify GPKG Geometry with SQL then Add Drawing - This topic provides a "Hello, World" example that shows a simple, but typical, task involving spatial data.  We will take a country-sized data set in GeoPackage (GPKG) format and change all areas in the data to the boundary lines for those areas and then save those boundary lines as a new table.  We add a spatial index to the table and create a new drawing to visualize the new table.

 

Example: Convert an ESRI File Geodatabase into a .map Project - How to convert data in ESRI's current file geodatabase format into a  Manifold .map project in a single step.  We convert ESRI's example NapervilleGas GDB geodatabase, all 857 files, into a single, unified Manifold .map project.

 

Example: Convert an ESRI Personal Geodatabase into a .map Project - How to convert data in ESRI's legacy personal geodatabase format into a  Manifold .map project in a single step.

 

 

Selection Examples

 

Example: Select a Range of Records in a Table - We can select or deselect a range of records between any two records in a table window using fast and easy mouse commands.

 

Example: Mouse Selection in a Drawing Window - Using the mouse to select objects in a drawing window.   This could be a drawing layer in a map or simply in a drawing window.

 

Example: Combining Selections using the Select Panel - How to use selections to solve a one-off problem casually that would be more difficult to solve rigorously with SQL.   The objective in the example's scenario is to visit a point of tourist interest while travelling.    We will use the Transform panel as well as the Select panel.

 

SQL Example: Using Selection Query Functions - How to manipulate selections within a query.

 

Example: Using the Select Panel Template Tab -  A sequence of actions using Select panel templates.

 

Example: Using the Select Panel Saved Tab - How to save selections and then use them later.

 

 

Drawings Examples

 

Example: Draw Lines, Areas and Points - Simple example of using basic mouse moves to add points, lines and areas to a drawing.

 

Example: Drawings use Geom Fields in Tables  - An essential discussion on how drawings are created from geom fields in tables, including how the drawing knows which coordinate system to use.

 

Example: Multiple Drawings from the Same Table - Illustrates how easy it is to create multiple drawings that use the same table and same geometry by copying and pasting an existing drawing.  Each new drawing takes no additional storage space in the project, but can be formatted differently.   

 

Example: Two Drawings from the Same Table - Take a table with a geom field that is visualized by a drawing.  Add a second geom field to the table and create an rtree index on that field so it can be visualized by a drawing.   Copy the first drawing, paste it and adjust the pasted copy so it uses the second geom field. Demonstrate how to use the Transform panel to show "live" modifications in the second drawing compared to the first drawing.

 

Example: Create a Drawing from a Geocoded Table - A partner example to Example: Create a Geocoded Table from a Drawing   A geocoded table has records with a latitude and longitude for each record.   This example starts with a table containing a list of cities with a latitude and longitude field for the location of each city.   We create a geom from the latitude and longitude fields using a template in the Transform dialog and then we create a drawing that shows the cities as points.  This example shows all the infrastructure steps involved.

 

Example: Create a Drawing from Read-Only Geocoded CSV File - A detailed example using a mix of dialogs and SQL to create a drawing that shows data from an external, read-only geocoded CSV file that is linked into the project.  

 

Example: Format a Drawing using the Style Panel - In this example we provide a first, step by step look at how to format areas in a drawing using the Style panel.  We can specify the same formatting for all areas or use a field to automatically set formatting, a process usually known as thematic formatting.

 

Example: Format the Size of City Points by Population - A common GIS task is to format the size of points in a drawing based on some value.  For example, the size of points that represent cities might be formatted based on the value of the city's population, with cities that have larger populations being marked by larger point icons.  This is an example of thematic formatting and is easy to do using the Style dialog.

 

Example: Add, Delete and Edit Thematic Formatting Intervals - This topic provides a step by step example of adding, deleting and editing intervals in the Style dialog that are used for thematic formatting.

 

Example: Style Properties in the mfd_meta Table - Style properties for drawings such as colors for areas are stored in human readable JSON values as properties in the mfd_meta system table.   This example shows how we can copy formatting from one drawing to another by simply copying values between records in the mfd_meta table.

 

Example: Formatting Tricks - The visualization capabilities of Manifold using Style can be exploited to provide many visual effects.   This topic provides some examples of how to use Style in unexpected ways to create a range of more elaborate effects.

 

Example: How Not to Format a Drawing -  When using Style to format a drawing it is a really bad idea to use the same color for objects that is used for the background color.    It can also be a bad idea to use transparent color.   This topic illustrates why.

 

Example: Style Overrides - Working with style overrides to individually style areas, to use or not use style overrides, to find all records using style overrides and to clear style overrides.

 

Example: Trace an Area in a Map over an Image Background - In a map with a drawing layer above an image layer (served dynamically by an imageserver), create an area object in the drawing by tracing over the outlines of something seen in the image layer below.

 

Example: Create a Line using the Record Panel - Step by step creation and modification of a line in a drawing using the Contents - Record panel's Coordinates tab.

 

Example: Create a Line using Curved Segments - Creating a line made up from curvilinear geometry using the New Object Dialog.

 

Example: Create an Area with a Hole - Using the New Object Dialog, create an area in a drawing where the area includes one or more holes.  This is similar to how we create areas that have islands as part of the area.   

 

Example: Create an Area with Holes and Islands - Using the New Object Dialog, create an area in a drawing where the area includes holes and also islands.

 

Example: Create a Multipoint - How to create multipoints using the New Object Dialog.  This topic provides two examples:  First we create a multipoint and then next we create a multipoint having two branches.  The purpose of this topic is to help teach the implementation of geometry in Manifold and other typical spatial packages using a somewhat unusual and rarely met object type, the multipoint, which combines what appear to be many separate points into a single multipoint object.

 

Example: Edit Coordinates While Creating an Object - When creating an object in a map using a tool such as Create Area, right in the middle of the process we can edit coordinates in the Contents - Record panel's Coordinates tab.   This example shows the step by step process.

 

Example: Edit Attributes and Move a Point - We look at the attributes for a point in a drawing layer and edit one of the attributes using a more expanded Edit dialog.  We then move the point to a new location. Easy!

 

Example: Edit Attributes, Larger Text, IME for Asian Languages - A tour showing how to edit attributes in a drawing using the Record panel Values tab and the expanded Edit dialog, including advanced Unicode facilities and use of the built in Input Method Editor (IME) to input text in Japanese language.

 

 

Images Examples

 

Example: How Images use Tiles from Tables - An example showing how an image is made up from data stored in a table in tiles.

 

Example: Create Two Images From One Table - More than one image can show data from the same table, including from the same tile field.

 

Example: An Image using Computed Fields in a Table - How an image can be created from tiles where the data for the tiles is taken from a field that is computed on the fly.

 

Example: Change the Contrast of an Image - In this example we use the Edit - Style dialog to change the contrast of an image.

 

Example: Use the BGR Button to Assign Channels - The BGR button in the Edit - Style dialog for images allows us to assign channels in the data to B, G and R outputs that create the displayed image, using BGR, RGB or Grayscale ordering.

 

Example: Assign Channels using Source - The Source control in the Style dialog for images assigns channels to display outputs such as R, G, B or A.  .  This topic shows examples of using Source and the visual results.

 

Example: Set Image Transparency using Alpha - The A row in the Style dialog allows us to specify what transparency we want to apply to the image, either by applying the same value for A for all pixels or by using one of the other channels to also control the A value.

 

Example: Autocontrast and Hill Shading Images using Style - This example shows how the Edit - Style dialog can hill shade an image using the values of pixels as heights and generating shadows as if the Sun were located at the specified azimuth and altitude.   This capability is used most frequently with raster images to give an impression of three dimensionality in cases where the values of pixels represent terrain elevations.

 

Example: Style Applied to an Image Server Image - Because the Edit - Style dialog simply changes the way an image is displayed and not the data, it can operate on read-only data served by various web servers such as WMS REST servers.    In this example we look at every detail of creating a data source using a WMS REST  server and then manipulating the appearance of the display with Style.  We will connect to a WMS server that provides LiDAR data in various forms, including as terrain elevation.

 

SQL Example: Re-tile an Image using a Different Tile Size - Starting with an image that uses a tile size of 128 x 128 pixels this SQL example creates a copy of the image using 500 x 500 pixel tiles.

 

Format Examples

 

Example: Import an ESRI ADF File and Apply Style and Hillshading - In this example we import an ESRI ADF format file that provides a raster terrain elevation data set for the region near Yosemite National Park in the United States.   The data set imports as an image.  We then use Style to style the image and to provide hillshading.

 

Example: Import BIL and Combine 3 Bands - A very technical example in which we import a BIL file that produces three images, each using one band from the BIL.  We then create an image that uses the three bands for R, G and B.

 

Example: Import CTG Grid Cell File and Style - A companion topic to the Example: Import GIRAS vector LULC File and Style topic.  We import a CTG LULC Grid Cell file containing raster data showing land use and land cover and then we use Style to provide a more understandable display.

 

Example: Import DDF SDTS DEM Raster File - We import a raster data terrain elevation surface from USGS SDTS format using DDF files.

 

Example: Import DDF SDTS DLG Vector File - We import a vector data roads drawing from USGS SDTS format using DDF files.   We use the Select panel to quickly reduce the data to line objects only, excluding points and area objects.

 

Example: Import E00 and Rearrange - An intricate example showing how to use Manifold tools to adapt legacy data imported from E00 format into useful, modern form.

 

Example: Import or Link ECW -  Step by step examples showing how to link an image from an ECW file into a project and also how to import an image from an ECW file into a project.

 

Example: Import GIRAS vector LULC File and Style - A companion topic to the Example: Import CTG Grid Cell File and Style topic.   We import a USGS land use file in GIRAS vector format and then we use Style to provide a more understandable display.

 

Example: Link GPKG and Save Style - A companion topic to the GPKG topic.   How to link a GPKG, open a drawing, Style it and then save so the stying is retained within the GPKG file.

 

Example: Import Multiple MapInfo TAB Images - MapInfo TAB format can store images as well as vector drawings.  This example shows how multiple images at the same time can be imported from TAB formt.

 

 

Transform Images Examples

 

Example: Transform Elevation Image to Flatten Bathymetry to Zero - Using the Transform dialog with an image, which contains a single data channel for terrain elevation data for land together bathymetry data for oceans, we use the Expression tab of the Transform dialog to reset all pixel values less than zero to zero.   This takes all below-zero elevations and sets them to zero, in effect removing bathymetry effects so that ocean areas are represented with zero elevation.  

 

Example: Zoom In to See Transform Previews for Big Images - A short example showing how previews for the Transform Dialog will appear in large images only when zoomed in far enough so computation of the preview does not cause objectionable delays.

 

Example: Parallel Speed Increase in an Image Transform - A short example illustrating how checking the Allow parallel execution option (on by default) increases speed by a factor of four in a simple use of the Transform dialog to modify an image.

 

 

Transform Examples

 

Example: Copy one Column into Another Column with Transform - How to use the Transform dialog to copy the contents of one column in a table into another column, but only for selected records.  Uses the Products table from the Nwind example data set.  

 

Example: Transform Field Values using an Expression in the Transform Panel - How the Expressions tab of the Transform panel may be used to change the values of fields.  

 

Example: Overlay Contained -  A frequent use of overlays is to sum the values of many points that fall within an area and to transfer that sum to a new field for an area.  In this example we take a drawing that has cities in the US with a population value for each city.  We use Overlay Contained  to sum the population of each city within a state and to transfer that sum to a total population for the state.

 

Example: Overlay Containing - One of the most common uses of overlays is to transfer fields from areas to points that are contained in those areas.    Tasks such as transferring a census block group number or zip code number from a drawing of areas to points that fall within each area are extremely common.   In this example we transfer the name of a French region  to the points that represent cities which fall within each region.

 

Example: Overlay Topology Intersect - In this example we use the Overlay Topology, Intersect template in the Transform dialog to trim a drawing of points so that all points which do not fall within areas in a second drawing are deleted.   The drawing of points we trim will become the US cities drawing that is used in the Example: Overlay Contained topic.

 

Example: Transfer Options and Merge Areas - Using the Merge Areas Transform dialog template, an exploration of the difference between using Copy and Sum for transfer options.

 

Example: Union Areas - Combine multiple area objects into a single area.   A drawing of French regions shows some regions as more than one area.  We would like each region to be one area so the table of regions has one record per region.

 

SQL Example: Learning to Union Areas in SQL from Edit Query - We learn how to write an SQL query that does a custom Union Areas operation by cutting and pasting from what the Edit Query button automatically generates.

 

Example: Construct JSON String using Select and Transform - Use the Select panel and Transform dialog to manually construct a JSON string using values from other fields in a table. Shows how we can manipulate text to build desired contents in a field.

 

Example: Edit a Drawing with Transform Templates - In this example we open a drawing and edit objects in the drawing using Transform panel templates.  Includes examples of using the Add Component button and also the Edit Query button.

 

Example: Use a Transform Expression to Create Buffers in a Drawing - Use the Expression tab of the Transform panel to create three different sizes of buffers for different lines in a drawing and then automatically create a query which does the same thing.  Includes examples of using the Add Component button and also the Edit Query button.

 

Example: Clip Areas with a Transform Expression - Use the Expression tab of the Transform panel to clip areas in a drawing to fit within horizontal bounds.   Includes examples of using the Add Component button and also the Edit Query button.

 

Example: Smooth Lines with a Transform Expression - Use the Expression tab of the Transform panel to make lines smoother in a drawing so that longer lines are smoothed more.  Includes examples of using the Edit Query button to show how different queries are created automatically depending on if we want to update a field or to add a new component.

 

Example: Transform Templates, Expressions and Queries - We learn to use a function by clicking on a template in the Transform dialog, seeing what it does in a preview, looking at the query Manifold creates and then trying out the function in the Expression tab.

 

 

Projections Examples

 

Example: Assign Initial Coordinate System - Use the Contents pane to manually assign an initial coordinate system when importing from a format that does not specify the coordinate system.

 

Example: Change Projection of an Image - Use the Change Coordinate System command to change the projection of an image, raster data showing terrain elevations in a region of Florida, from Latitude / Longitude to Orthographic centered on Florida.

 

Example: Adding a Favorite Coordinate System -  Step by step example showing how to add a frequently used coordinate system to the Favorites system.

 

Example: Detecting and Correcting a Wrong Projection - A lengthy example exploring projection dialogs and a classic projection problem.  We save a drawing into projected shapefiles and then show on import how a projection can be quickly and easily checked and corrected if it is wrong.   

 

 

Programming Examples

 

Example: Run JavaScript in the Command Window - How to run a simple V8 JavaScript script in the Command window.

 

 

Interoperability Examples

 

Example: Create an ODBC Data Source with Windows - How to create an ODBC data source (a DSN) using dialogs built into Windows 10.

 

Example: Connect to Manifold from Release 8  - Step by step procedure to connect from Manifold System Release 8 to a Manifold .map file using Manifold's ODBC driver.

 

Example: Connect to an ESRI GDB File Geodatabase - Connect Manifold to an ESRI GDB file geodatabase, display the contents, make a selection in the GDB and overlay in a map.

 

Example: Connect to an ESRI GDB usng GDAL/OGR  -  Instead of using Manifold's built-in ability to connect to modern ESRI GDB file geodatabases, use the Manifold GDAL/OGR dataport to take advantage of the GDAL library's ability to connect to deprecated GDB formats.

 

Example: Connect Through Manifold ODBC to a Third Party  - With Release 8, use an ODBC connection to a Manifold .map to connect through the .map project to a third party, external data source, an ESRI GDB file geodatabase.  We use Manifold facilities as an intermediary to give Release 8 capabilities it does not have on its own, to link into data stored within an ESRI file geodatabase.

 

Example: Connect LibreOffice Through Manifold to an ESRI GDB - A companion example topic to the Example: Connect Through Manifold ODBC to a Third Party  topic.  Shows how to connect LibreOffice Base, the database part of LIbreOffice, through Manifold to link an ESRI GDB file geodatabase table into LibreOffice.

 

Example: Connect to Manifold from QGIS - Step by step procedure to connect from QGIS 2.8.9 to a Manifold .map file using Manifold's ODBC driver.