IMapTableDescription Interface

Provides access to the available properties of a table description object.

Members

Name Description
Read/write property DefinitionExpression The definition expression for the table.
Read/write property ID The table ID. This is a unique ID for the layer, and is used to identify the table in a number of method calls.
Read/write property SourceID The id of the data source to connect to.

IMapTableDescription.DefinitionExpression Property

The definition expression for the table.

Public Property DefinitionExpression As String
public string DefinitionExpression {get; set;}

Remarks

A DefinitionExpression can be set on a layer or a table in order to limit layer features or rows available for display or query. This only applies for the request and does not replace the definition query set in the source map.

When UseStandardizedQueries is True:

  • the DefintionExpression of a LayerDescription retrieved from IMapServerInfo.DefaultMapDescription is always empty regardless of whether a definition expression is set on the layer in the source map. Use IMapTableInfo3::DefinitionExpression, to find out what is the definition expression set, if there is any, to the layer in the source map.
  • an expression set in the LayerDescription will be appened to the one set for the layer in the source map.
  • you can only use StandardizedQueries. This means you will always format a query on a date field the same way or if you want to find all features where the value in a string field contains a specified keyword, you can use the same function name regardless of the underlying database type. Queries containing anything specific to the underlying database, for example, a function that is only supported by the database but is not part of the StandardizedQueries specification will fail.

When UseStandardizedQueries is False:

  • a layer can have a default definition expression that is set for that layer in the source map.
  • an expression set in the LayerDescription will override the one set for the layer in the source map.
  • the query must conform to the underlying database's syntax and use functions supported by that database.

Let's look at some examples. You have a layer in your map that represents sales regions. The layer includes fields: REGIONS, SALES and MANAGER.

Example #1: In the source map the layer has a definition query, "REGION = North". No DefintionExpression is specified in LayerDescription. Only those features where REGION = North will be displayed in your map.

Example #2: In the source map the layer has a definition query, "REGION = �North�". You apply a DefinitionExpression in LayerDescription as "SALES > 1000". The LayerDescription DefinitionExpression overrides the definition query set in the source map. Only those features where SALES > 1000 will be displayed in your map.

If you wish to use the DefinitionExpression as a way of getting a subset of the features already filtered by the definition query in the map you will need to save the original expression and then add it to the new expression to form one compound expression, �REGION = �North� AND SALES > 1000�. This will display map features that are belong to the North region and have sales over 1000.

Example #3: In the source map the layer has no definition query. You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Only those features where SALES > 1000 will be displayed in your map.

The following MapServer methods will honor DefinitionExpression: Find, Identify, QueryData, QueryRowIDs, QueryRowCount, QueryFeatureCount2, QueryFeatureIds2, QueryFeatureData2 and QueryHyperlinks2.

Although the DefinitionExpression set in the LayerDescription will override any any definition query set in the source map, there are MapServer methods that only honor the expression set in the source document. Any expression set in DefinitionExpression in the LayerDescription will be ignored. These mothods include: QueryFeatureCount, QueryFeatureIds, and QueryFeatureData. MapDescription, which contains the LayerDescriptions, are not a parameter for these methods.

DefinitionExpression does not affect spatial extents.

IMapTableDescription.ID Property

The table ID. This is a unique ID for the layer, and is used to identify the table in a number of method calls.

Public Property ID As Integer
public int ID {get; set;}

Remarks

An identifier that uniquely identifies a layer or a table within a map

IMapTableDescription.SourceID Property

The id of the data source to connect to.

Public Property SourceID As String
public string SourceID {get; set;}

Remarks

SourceID is used for map service interaction with the GPServer. It is a unique job id assigned to a geoprocessing service each time it runs on the server. This property can be used to find out which geoprocessing job has created this layer.

It is important to note that LayerID, SourceID and the index of layers (see MapLayerInfos) in map document are not the same.

Please note that this is currently not implemented for StandaloneTable.

Classes that implement IMapTableDescription

Classes Description
LayerDescription The Layer Description coclass contains settings of a layer in a map.
StandaloneTableDescription The StandaloneTable Description coclass contains settings of a standalone table in a map.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.