File - Create - New Image

The File - Create - New Image dialog allows us to:

 

 

The New Image dialog that creates an image from an existing table, query or database view automatically can add a spatial index to a table which does not have a spatial index, provided the table is not read-only and allows altering the table schema.

 

When creating a new image from a table that is resident in an external DBMS that supports autogenerated identity fields, the New Image dialog automatically creates an autogenerated identity field within the table.  See the Schema topic for a discussion of autogenerated identity fields.

 

Although most often images in our projects will result from importing or linking files or data sources which automatically create images, we can also create new images if we like, usually from existing tables for images or queries created from those tables.   In theory, we can create a new image from scratch by creating a new, blank image and then populating that image's table with data.   As a practical matter that is not a realistic approach for most users given the complexity of correctly populating that table.  

 

To create a new, blank image from scratch:

 

  1. Choose File - Create - New Image, or use the context menu in the Project pane.

  2. Specify a Name for the new image.

  3. Specify desired Tile characteristics, such as data type and tile size.

  4. Specify desired X and Y fields and their type.

  5. Check the Create spatial index box.

  6. Specify Bounds for the image that will ultimately be populated.

  7. Choose a coordinate system if the default is not desired.

  8. Press Create Image.

 

By default, new images are created using the EPSG:3857 Pseudo-Mercator coordinate system, as used by almost all modern web mapping data sources.

 

To create a new image based on an existing table:

 

  1. Right-click on the table in the Project pane.

  2. Choose Create - New Image.

  3. Choose the Tile field to use if there is more than one in the table.  Choose the data type in the tile and the tile size if not the default shown.

  4. Choose the X and Y fields to use for tile arrangement.

  5. Check the box to create a spatial index if one does not yet exist.

  6. Enter the correct Bounds value.   Unless the image consists of a single tile (single record), the default value of Bounds will be wrong and will need to be changed.

  7. Assign the correct coordinate system if the coordinate system is reported in red text.

  8. Press Create Image.

  9. Open the image, and choose View - Messages to update intermediate levels if necessary.

  10. In the Style pane, specify the desired style.   

 

Just like creating drawings from queries, we can also create images from queries, if the query reports a schema and the results table for that query includes tile data.   

 

To create a new image based on a query:

 

  1. Right-click on the query in the Project pane.

  2. Choose Create - New Image.

  3. Choose the Tile field to use if there is more than one in the table.  Choose the data type in the tile and the tile size if not the default shown.

  4. Choose the X and Y fields to use for tile arrangement.

  5. Enter the correct Bounds value.   Unless the image consists of a single tile (single record), the default value of Bounds will be wrong and will need to be changed.

  6. Assign the correct coordinate system if the coordinate system is reported in red text.

  7. Press Create Image.

  8. Images created from queries will appear only when used as a layer in a map that contains at least one other layer.  

  9. To update the image after any changes in source table data, choose View - Refresh.

  10. Open the image, and choose View - Messages to update intermediate levels if necessary.

  11. In the Style pane, specify the desired style.   

 

We can create an image  from a query if the query's results table contains a tile field.   The query must also report a schema if we right click on the query in the Project pane and choose Schema.  The source table for the X, Y and Tile fields reported in the result table should have a spatial index on those fields.   If the query text is changed, we must run the query at least once after changing the text, so that any future refreshes of the image will use the new query text.

 

We can also create an image from a database view that provides a result table matching the above criteria.

 

Given that we must know the Bounds of the data in the table to be able to create an image from that table, as a practical matter for now we will usually create images for tables where already there is at least one image created on that table.  We can then simply copy the Rect value from that image's properties and paste that into the Bounds box in the New Image dialog.   Likewise, for now we will usually create images for queries where the query does not change the bounds of the table for which an image already exists.

 

 

Message Icons - If we double-click open an image and a red message icon appears in the window's lower tab, we should choose View - Messages from the main menu to read the message.  Blank images showing a message icon usually indicate a need to build or update indexes or intermediate levels, which Manifold will offer to do for us.

File - Create - New Image

 

In the main menu choose File - Create - New Image or right-click an empty spot in the Project pane and choose Create - New Image.    Creating a new image from scratch is not recommended, as at the present time it requires expert level skills.   Instead, it is much easier to modify an existing image.

 

Name

Name for the image.  "Image" by default.  Specify a more informative name as desired.

Based on

<new table> by default when launched from File - Create - New Image, or when right clicking on an empty location in the Project pane and choosing Create - New Image.  Creates a new table named by adding "Table" to whatever is the specified Name for the image.    The combo box is also loaded with the names of tables and queries in the project should we wish to create the image based on an existing table or query.

Tile

Specify the name of the tile field to be created within the new image.   "Tile" by default.

<data type>

An option box that appears next to the Tile box.  Choose the desired data type of the tile field:  uint8 by default, a typical data type for single channel palette images.  Three channel images might use uint8x3.  

<tile size>

An option box that appears next to the Tile box.  Specify the tile size in pixels.  128 x 128 by default.  

X

Name of X tile coordinate field, with data type adjacent.

Y

Name of Y tile coordinate field, with data type adjacent.

Create spatial index

Leave this checked.   Automatically creates a spatial index for the tile field in the new table that will be created.

Bounds

Coordinates of the bounding rectangle for the image in the specified coordinate system.

Coord system

The coordinate system to be utilized within the tile field.   The default is the same Pseudo-Mercator coordinate system that is used by almost all web servers.  

Coordinate system picker button.  Used to specify the coordinate system to be used by the new image.   Choose one of the Favorite Coordinate Systems from the list that appears or choose More... to launch the Coordinate System dialog that allows choice of a seemingly infinite range of possibilities.   See the Projections Tutorial for tips on choosing a projection, and the Projections Album for illustrations of many named projections, such as the Orthographic.

Create Image

Create the new image and table.

Edit Query

Launch the Command Window loaded with a query that creates the image and table using the given settings.  A great way to learn how to use SQL to create data sources.

Cancel

 Exit the dialog without doing anything.

 

Create - New Image (From a Table)

 

Right-click a table in the Project pane and choose Create - New Image.

 

Name

Name for the image. Based on the table name by default.  Specify a different name as desired.

Based on

The table to use for the new image.   By default, the table that was right-clicked.     The combo box is also loaded with the names of tables and queries in the project should we wish to create the image based on some other existing table or query.

Tile

Choose the tile field to be used by  the new image.  Loaded by default with the first tile field found in the table, with any other tile fields in the table also available in the combo box.  

<data type>

An option box that appears next to the Tile box.  Choose the desired data type of the tile field: loaded by default with whatever is the data type of the tile field loaded into the Tile box.  

<tile size>

An option box that appears next to the Tile box.  Specify the tile size in pixels. Loaded by default with whatever is the tile size of the tile field loaded into the Tile box.  

X

Choose X tile coordinate field, with data type adjacent.  Loaded with the first X field found.

Y

Choose Y tile coordinate field, with data type adjacent.  Loaded with the first Y field found.

Create spatial index

Appears if no spatial index found; otherwise the spatial index in the table will appear.     Automatically creates a spatial index for the tile field in the new table that will be created.

Bounds

Coordinates of the bounding rectangle for the image in the specified coordinate system.  If an existing image has already been created from this table, use the value for the Rect property of that image.

Coord system

The coordinate system to be utilized within the tile field.   When the coordinate system appears in red text that warns us the correct coordinate system must be assigned.

Coordinate system picker.   Used to assign the initial coordinate system if it appears in red text, or if to repair it if the coordinate system appears in black text but we know the coordinate system assigned is incorrect.   See the Assign Initial Coordinate System topic.

Create Image

Create the new image.

Edit Query

Launch the Command Window loaded with a query that creates the image using the given settings.

Cancel

 Exit the dialog without doing anything.

 

Create - New Image (From a Query)

 

Right-click a query in the Project pane and choose Create - New Image.

 

 

Name

Name for the image. Based on the query name by default.  Specify a different name as desired.

Based on

The query to use for the new image.   By default, the query that was right-clicked.     The combo box is also loaded with the names of tables and queries in the project should we wish to create the image based on some other existing table or query.

Tile

Choose the tile field to be used by  the new image.  Loaded by default with the first tile field found in the query schema, with any other tile fields in the schema also available in the combo box.  

<data type>

An option box that appears next to the Tile box.  Choose the desired data type of the tile field: loaded by default with whatever is the data type of the tile field loaded into the Tile box.  

<tile size>

An option box that appears next to the Tile box.  Specify the tile size in pixels. Loaded by default with whatever is the tile size of the tile field loaded into the Tile box.  

X

Choose X tile coordinate field, with data type adjacent.  Loaded with the first X field found.

Y

Choose Y tile coordinate field, with data type adjacent.  Loaded with the first Y field found.

Bounds

Coordinates of the bounding rectangle for the image in the specified coordinate system.  If an existing image has already been created from a table with the same bounds as the query results table, use the value for the Rect property of that image.

Coord system

The coordinate system to be utilized within the tile field.   When the coordinate system appears in red text that warns us the correct coordinate system must be assigned.

Coordinate system picker.   Used to assign the initial coordinate system if it appears in red text, or if to repair it if the coordinate system appears in black text but we know the coordinate system assigned is incorrect.   See the Assign Initial Coordinate System topic.

Create Image

Create the new image.

Edit Query

Launch the Command Window loaded with a query that creates the image using the given settings.

Cancel

 Exit the dialog without doing anything.

 

Notes

No tiles in the table?  - The Based on box in the New Image dialog is loaded with the names of table in the project, including the names of tables which do not have a tile field.  Why is that, given that without a tile field in the table an image cannot function?   This choice allows us to create an image component with properties stating it will use the specified table, the expectation being that we will be adding a tile field to the table, perhaps through SQL or programmatic means, and adding the requisite FieldTile and other properties to the image which points at the tile field that was added.

 

Message Icons - If we double-click open an image and a red message icon appears in the window's lower tab, we should choose View - Messages from the main menu to read the message.  Blank images showing a message icon usually indicate a need to build or update indexes or intermediate levels, which Manifold will offer to do for us.

See Also

Tables

 

Images

 

Indexes

 

Add an Index to a Table

 

Queries

 

Projections

 

Intermediate Levels

 

Images and Channels

 

Palette Images

 

Style: Images

 

Style: Autocontrast

 

Style: Palettes

 

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 Style pane to change the contrast of an image.

 

Example: Using the Assign Channels Button - The Assign Channels button in the Style pane for images allows us to assign channels to the standard three Red, Green, and Blue display outputs using frequently-desired arrangements.   The button provides a short cut way to assign all channels at once instead of doing each channel individually.

 

Example: Assign Channels - How to use the Style pane for images to assign channels to display outputs such as R, G, B or A.  This topic shows examples of channel combinations and the visual results.

 

Example: Set Image Transparency using Alpha - The A row in the Style pane 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 Style pane 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 Style pane 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 an image 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.