com.esri.arcgis.carto
Class MapServer

java.lang.Object
  extended by com.esri.arcgis.carto.MapServer
All Implemented Interfaces:
IMapServer, IMapServer2, IMapServer3, IMapServerData, IMapServerDataAccess, IMapServerInit, IMapServerInit2, IMapServerLayout, IMapServerObjects, IMapServerObjects2, IMapServerObjects3, ITiledMapServer, ITiledMapServer2, ITiledMapServer3, com.esri.arcgis.interop.RemoteObjRef, IServerObject, IServerObjectConfigurationManager, IServerObjectConfigurationManager2, IServerObjectExtensionManager, ILogSupport, IObjectActivate, IObjectConstruct, IObjectUpdate, IObjectValidate, IRequestHandler, IRequestHandler2, ISupportErrorInfo, Serializable

public class MapServer
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IMapServer, ITiledMapServer2, ITiledMapServer3, IObjectConstruct, IRequestHandler, IRequestHandler2, IMapServerObjects, IMapServerObjects2, IMapServerObjects3, IMapServerData, IMapServerLayout, IMapServerInit, IMapServerInit2, IObjectActivate, IObjectUpdate, ILogSupport, ISupportErrorInfo, IServerObject, IServerObjectExtensionManager, IMapServer2, IMapServer3, IServerObjectConfigurationManager, IServerObjectConfigurationManager2, IObjectValidate, IMapServerDataAccess

The MapServer component provides programmatic access to the contents of a map document on disk, and creates images of the map contents based on user requests. Designed for use in building map-based web services and web applications.

Remarks

MapServer is a coarse-grained ArcObject. This object allows users to display and query ArcGIS map documents in either desktop, LAN/WAN, or internet development environments. In the desktop environment you can use MapServer, as well as other coarse-grained objects as a "short-cut" for ArcObjects development. Operations that took many lines of code may now just take a few. In a server environment, MapServer objects can be accessed via Distributed COM (DCOM) over a TCP/IP connection (Intranet) or via SOAP/XML over an HTTP connection (Internet).

The MapServer coclass contains several interfaces with basic functions for displaying (IMapServer and IMapServerLayout) and querying (IMapServer and IMapServerData) an ArcGIS map document (.msd, .mxd or .pmf).

In addition to MapServer, a number of MapServer objects are defined to represent input and output parameters for methods on MapServer interfaces. For example, the IMapServer method ExportMapImage requires two inputs: a description of the map to be exported and a description of the output parameters. These inputs are captured in the MapDescription and ImageDescription objects.

Though the methods and properties available through MapServer and its associated objects offer important mapping functionality, they cannot possibly encapsulate all that ArcObjects offers. In many cases you may want to use other, finer-grained, ArcObjects in conjunction with MapServer. You can do this using the IMapServerObjects interface. Through this interface you can access ILayer, IMap and IPageLayout. For example, you can make changes to the map, such as adding a new layer, using IMap.

It is very important to distinguish between temporary and permanent changes to the MapServer object. A temporary change would include changes to the MapDescription or LayerDescription using IMapDescription and ILayerDescription. For example, you might change the geographic extent of a map (MapArea) or change the visibility of a layer (Visible). These changes can be temporary and valid for the duration of the call. Once the call has ended the MapServer object returns to it's default state.

Permanent changes to the MapServer object can be done in two ways. The first is by changing MapServer properties using such interfaces as IMapDescription and ILayerDescription and then calling the IMapServerObjects method ApplyMapDescription. This will update the state of the fine-grained ArcObjects. Another way to change the MapServer object is to access the underlaying fine-grained ArcObjects directly using the methods on IMapServerObjects, make a change such as adding a new layer or changing a layer's rendering, and then calling RefreshServerObjects. This refreshes the MapServer object with the current state held by the fine-grained ArcObjects.

You should use non-pooled objects when permently changing the state of fine-grained ArcObjects.

Please note that optimized MapServer based on msd does not allow access to the fine grained objects and only works in stateless manner. You cannot make permanent change requests to an optimized MapServer object, all changes are temporary and valid only for the duration of the call.

Only certain symbols are supported when working with the MapServer WSDL or accessing a MapServer object through an AGSServerConnection (LAN or internet). These include ISimpleMarkerSymbol, ICharacterMarker, IPictureMarker, ISimpleLineSymbol, ISimpleFillSymbol and IPictureFill. ESRI recommends against the use of SimpleFillSymbols with a Style other than esriSFSSolid. Usage of other Style options may produce unexpected results in a standard map service. The optimized MapServer does not support usage of Styles other than esriSFSSolid - use other fill symbol types such as ILineSymbol instead.

A MapServer service can have an associated tiled map cache. ArcGIS map services can use a tile cache to significantly improve performance while delivering maps. A map service that fulfills requests with pre-created tiles from a cache instead of dynamically rendering part of the map is called a cached map service. The map cache is a directory that contains image tiles for map extents at specific scale levels.

Applications that work with a cached map service can directly access tiles from the tile cache. Such applications include ArcGIS Desktop, the ArcGIS Server Web ADF Applications and ArcGIS Javascript applications.

Service publishers create the cache for a map service using geoprocessing tools in ArcCatalog or via scripting.

There are two types of caches. A map service can have either a single fused cache or a multi-layer cache. A single fused cache contains image tiles that are created by fusing all the layers in a map document into a single image representing the tile. A multi-layer cache contains individual layer caches each of which contains image tiles that are created by rendering a specific layer in the map document. Please note that an optimized MapServer service does not support multi-layer cache.

Clients behave differently with these two cache types. All client applications have the ability to fetch and use tiles from a map service with a fused map cache. In ArcMap, fused caches appear as group layers with feature selection disabled, label selection that cannot be adjusted, and visibility that cannot be controlled by turning sub-layers ON and OFF.

Only the ArcGIS Desktop client has the ability to fetch and use (fuse) tiles from a service that has a multi layer cache. All other clients treat a service with a multi layer cache as though it were not cached – they delegate the job of generating map images to the service which does make use of the tiles in the individual layer caches. Multi-layer caches appear in a client as collections of layers with controllable visibility, labeling, and feature selection enabled.

For optimal performance, use fused caches. Applications built with fused caches do not use the parent map service, but instead pull the images directly from the cachevirtual directory or by using a tile handler web service running on the server. Use ICacheDescription to get information on the cached service.

Working with MapServer and a cached map service can be different than working with a map service without a cache. Though you will be able to query against a cached map service just as you would a non-cached map service, you will see differences when working with cached map service's MapDescription and the LayerDescription of any map layer belonging to a cache.

If the map service has a fused cache custom graphics, including the rendering of selected features, cannot be applied to the MapDescription. In addition, any changes made to the LayerDescription of any of the map layers, such as applying a definition expression, applying a selection buffer, toggling the visibility of labels or changing the visibility of the layer itself are ignored. When the map service has a Multi-layer cache changes to the MapDescription are honored. You will be able to render custom graphics and selection features, including features belonging to cached layers. However, you will not be able to apply a definition expression to or toggle the value of the ScaleSymbol property of individual layers that are cached. These will be ignored. Finally, applying a new spatial reference on cached map services though IMapDescription will not work. The cached layers will not draw. You will need to use ITileCacheInfo to change the spatial reference.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.system.IRequestHandler
IID, IID46a0e2ea_3b64_4a46_bd78_88a1660f35bb, xxDummy
 
Fields inherited from interface com.esri.arcgis.system.IObjectActivate
IID, IIDe3b78022_143e_4e61_9099_ed319ec061e7, xxDummy
 
Constructor Summary
MapServer()
          Constructs a MapServer using ArcGIS Engine.
MapServer(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
MapServer theMapServer = (MapServer) obj;
 
Method Summary
 void activate()
          Activates the object.
 void applyMapDescription(IMapDescription mapDescription, IImageDisplay mapDisplay)
          Applies the current state of the map description to the map server object.
 void beforeStart(IServerObjectAdmin pAdmin, IPropertySet props)
          Is called before the configuration is started.
 void beforeStop(IServerObjectAdmin pAdmin, IPropertySet props)
          Is called before the configuration is stopped.
 double computeDistance(String mapName, IPoint fromPoint, IPoint toPoint, int units)
          Computes the distance between two points on the specified map.
 double computeScale(IMapDescription mapDesc, IImageDisplay mapDisplay)
          Computes the scale of the specified map, at the given map extent, for an image with the given size.
 void connect(String filePath)
          Initializes the map server with an mxd or pmf file stored at the specified path.
 void construct(IPropertySet props)
          Two phase object construction.
 void deactivate()
          Deactivates the object.
 boolean equals(Object o)
          Compare this object with another
 ILayoutImage exportLayout(IPageDescription pageDesc, IImageDescription imageDesc)
          Generates an image of the layout, based on the given page description object, and writes the image to a specified file on disk.
 IImageResult exportLegend(ILegend legend, IMapDescription mapDesc, IImageDisplay pMapDisplay, IColor backgroundColor, IImageDescription imageDesc)
          Exports a legend to an image file.
 IMapImage exportMapImage(IMapDescription mapDesc, IImageDescription imageDesc)
          Generates an image of the map, based on the given map description, and writes the image to a specified file on disk.
 IImageResult exportNorthArrow(INorthArrow arrow, IMapDescription mapDesc, IColor backgroundColor, IImageDescription imageDesc)
          Exports a north arrow to an image file.
 IImageResult exportScaleBar(IScaleBar scalebar, IMapDescription mapDesc, IImageDisplay pMapDisplay, IColor backgroundColor, IImageDescription imageDesc)
          Exports a scale bar to an image file.
 IMapServerFindResults find(IMapDescription mapDesc, IImageDisplay mapImage, String searchString, boolean contains, String searchFields, int option, ILongArray layerIds)
          Returns a collection of Map Server Find Result objects that contain the given search string.
 IServerObjectExtension findExtensionByCLSID(String cLSID)
          Returns a server object extension found using a string representation of its class ID.
 IServerObjectExtension findExtensionByTypeName(String name)
          Returns a server object extension found using its type name.
 void fromMapPoints(IMapDescription mapDescription, IImageDisplay mapDisplay, IPointCollection mapPoints, ILongArray[] screenXValues, ILongArray[] screenYValues)
          Converts a map coordinate to a screen location.
 void fromPagePoints(IEnvelope pageExtent, IImageDisplay pageDisplay, IPointCollection pagePoints, ILongArray[] screenXValues, ILongArray[] screenYValues)
          Converts a page coordinate to a screen location.
 ICacheControlInfo getCacheControlInfo(String mapName)
          Gets the cache description information for a given map.
 ICacheDescriptionInfo getCacheDescriptionInfo(String mapName)
          Gets the cache description information for a given map.
 String getCacheName(String mapName, int layerID)
          Gets the cache name for a given layer within a map.
 ICacheStorageInfo getCacheStorageInfo(String mapName)
          Gets the cache storage information.
static String getClsid()
          getClsid.
 String getConfigurationName()
          Name of the server object configuration that defines the server object.
 Object getDataSource(String mapName, int layerID)
          Get Data Source
 ILayerDrawingDescriptions getDefaultLayerDrawingDescriptions(String mapName, ILongArray pLayerIDs, IServerSymbolOutputOptions outputOptions)
          Get Layer Drawing Description
 String getDefaultMapName()
          Name of the document's active map (data frame).
 IPageDescription getDefaultPageDescription()
          The default page settings.
 Object getDisplayDataSource(String mapName, int layerOrTableID)
          Get Display Data Source
 IPropertySet getDocumentInfo()
          A set of name-value pairs for properties set for the map document (mxd only).
 IFeature getFeature(String mapName, int layerID, int featureId)
          Returns a feature, given the feature ID and layer.
 String getFeatureValue(String mapName, int layerID, IFeature feature, String fieldName)
          Returns the value of a given feature as a string.
 String getFilePath()
          The map document path.
 ILayer getLayer(String mapName, int layerID)
          The layer specified by the map name and layer ID.
 int getLayerID(String mapName, ILayer pLayer)
          The layer specified by the map name and layer ID.
 byte[] getLayerTile(String mapName, int layerID, int level, int row, int column)
          Gets a tile for a given tile location from a given layer.
 byte[] getLayerTileEx(String mapName, int layerID, int level, int row, int column, int cacheFormat)
          Gets a tile for a given tile location from a given layer.
 IMapServerLegendInfos getLegendInfo(String mapName, ILongArray layerIds, IMapServerLegendPatch patch, IImageType imgType)
          Returns a collection of Map Server Legend Info objects for the specified layers.
 IMap getMap(String mapName)
          The map corresponding to the specified map name.
 int getMapCount()
          The number of maps (data frames) in the document.
 String getMapName(int index)
          Name of the map (data frame) as indicated by the index.
 IMapTableSubtypeInfos getMapTableSubtypeInfos(String mapName, ILongArray pTableIDs)
          Returns the MapTableSubtypeInfos in the current map.
 byte[] getMapTile(String mapName, int level, int row, int column)
          Gets a tile for a given tile location from a given map.
 byte[] getMapTileEx(String mapName, int level, int row, int column, int cacheFormat)
          Gets a tile for a given tile location from a given map.
 int getMaxBufferCount()
          The maximum number of records buffered on the server for display.
 int getMaxImageHeight()
          The maximum height in pixels of an image request.
 int getMaxImageWidth()
          The maximum width in pixels of an image request.
 int getMaxRecordCount()
          The maximum number of records returned for query results (Identify, Find, QueryFeatureData, and QueryHyperlinks).
 IPageLayout getPageLayout()
          The page layout object for the current map document.
 String getPhysicalCacheDirectory()
          The physical directory for cache files.
 String getPhysicalOutputDirectory()
          The physical directory for output files.
 IMapServerInfo getServerInfo(String mapName)
          Returns information about a map (data frame).
 IPropertySet getServiceConfigurationInfo()
          A set of name-value pairs for properties set for the MapServer Service Configuration Restrictions.
 String getSOMCacheDirectory()
          The parent directory for cache files.
 String getSOMVirtualCacheDirectory()
          The parent virtual directory for cache files.
 ISQLSyntaxInfo getSQLSyntaxInfo(String mapName, int layerID)
          Returns the SQL syntax information for the specified layer.
 ITable getStandaloneTable(String mapName, int standaloneTableID)
          The table specified by the map name and table ID.
 int getStandaloneTableID(String mapName, ITable pTable)
          The layer specified by the map name and standalone table ID.
 int getSupportedImageReturnTypes()
          The supported image return types for the map server.
 Picture getThumbnail()
          The thumbnail stored in the map document.
 ITileCacheInfo getTileCacheInfo(String mapName)
          Gets the cache configuration for a given map.
 ITileImageInfo getTileImageInfo(String mapName)
          Gets the cache tile image information for a given map.
 String getTypeName()
          Type of the server object (MapServer or GeocodeServer).
 String getVirtualCacheDirectory()
          The virtual directory for cache files.
 String getVirtualCacheDirectory(String mapName, int layerID)
          Gets the virtual cache directory for a given layer within a map.
 String getVirtualOutputDirectory()
          The virtual directory for output files.
 byte[] handleBinaryRequest(byte[] request)
          Handles a binary request.
 byte[] handleBinaryRequest2(String capabilities, byte[] request)
          Handles a binary request with explicit capabilities.
 String handleStringRequest(String capabilities, String request)
          Handles a SOAP string request.
 int hashCode()
          the hashcode for this object
 boolean hasLayerCache(String mapName, int layerID)
          Indicates if a given layer has a single tile cache.
 boolean hasSingleFusedMapCache(String mapName)
          Indicates if a given map has a single fused map tile cache.
 IMapServerIdentifyResults identify(IMapDescription mapDesc, IImageDisplay mapImage, IGeometry searchShape, int tolerance, int option, ILongArray layerIds)
          Returns a collection of Map Server Identify Result objects at the given location.
 void initLogging(ILog log)
          Initializes an object with a log.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isFixedScaleMap(String mapName)
          Indicates if a given map is a fixed scale map.
 IPropertySet onAdd(IPropertySet pProps)
          Is called when the configuration is added.
 void onRemove()
          Is called when the configuration is removed.
 void onRemoveEx(IServerObjectAdmin pAdmin, IPropertySet props)
          Is called when the configuration is removed.
 void onStart(IServerObjectAdmin pAdmin, IPropertySet pProps)
          Is called when the configuration is started.
 void onStop(IServerObjectAdmin pAdmin, IPropertySet pProps)
          Is called when the configuration is stopped.
 IAttachmentDataArray queryAttachmentData(String mapName, int tableID, ILongArray attachmentIDs, int transportType)
          Returns the attachment data for the given features/ rows.
 IAttachmentInfoArray queryAttachmentInfos(String mapName, int tableID, ILongArray rowIDs)
          Returns the attachment info that describe the attachments for the given features/ rows.
 IQueryResult queryData(String mapName, IMapTableDescription pMapTableDescription, IQueryFilter filter, IQueryResultOptions options)
          Returns a record set of rows that meet the query filter selection criteria for the specified table.
 int queryFeatureCount(String mapName, int layerID, IQueryFilter filter)
          Returns the count of the features that meet the query filter selection criteria for the specified layer.
 int queryFeatureCount2(String mapName, ILayerDescription pLayerDescription, IQueryFilter filter)
          Returns the count of the features that meet the query filter selection criteria for the specified layer.
 IRecordSet queryFeatureData(String mapName, int layerID, IQueryFilter filter)
          Returns a record set of features that meet the query filter selection criteria for the specified layer.
 IQueryResult queryFeatureData2(String mapName, ILayerDescription pLayerDesciscription, IQueryFilter filter, IQueryResultOptions options)
          Returns a record set of features that meet the query filter selection criteria for the specified layer.
 IFIDSet queryFeatureIDs(String mapName, int layerID, IQueryFilter filter)
          Returns the IDs of the features that meet the query filter selection criteria for the specified layer.
 IFIDSet queryFeatureIDs2(String mapName, ILayerDescription pLayerDesciscription, IQueryFilter filter)
          Returns the IDs of the features that meet the query filter selection criteria for the specified layer.
 IStringArray queryHTMLPopups(String mapName, int tableID, ILongArray pRowIDs)
          Returns the html as text that can be used in popups.
 IMapServerHyperlinks queryHyperlinks(IMapDescription mapDesc, IImageDisplay mapImage, ILongArray layerIds)
          Returns a collection of Map Server Hyperlink objects for the specified layers.
 IImageResults queryRasterValue(String mapName, int sourceTableID, ILongArray rowIDs, String fieldName, IImageType rasterValueType)
          Returns the Raster content that meet the selection criteria for the specified table.
 IQueryResult queryRelatedRecords(String mapName, int sourceTable, IFIDSet pFIDs, IRelateDescription relateDescription)
          Returns the IDs of the rows that meet the query filter selection criteria for the specified table.
 int queryRowCount(String mapName, IMapTableDescription pTableDescription, IQueryFilter pFilter)
          Returns the count of the rows that meet the query filter selection criteria for the specified table.
 ILongArray queryRowIDs(String mapName, IMapTableDescription pTableDescription, IQueryFilter pFilter)
          Returns the IDs of the rows that meet the query filter selection criteria for the specified table.
 void refreshServerObjects()
          Updates the server info based on the current state of the underlying fine-grained objects.
 void setMaxBufferCount(int count)
          The maximum number of records buffered on the server for display.
 void setMaxImageHeight(int height)
          The maximum height in pixels of an image request.
 void setMaxImageWidth(int width)
          The maximum width in pixels of an image request.
 void setMaxRecordCount(int count)
          The maximum number of records returned for query results (Identify, Find, QueryFeatureData, and QueryHyperlinks).
 void setPhysicalCacheDirectory(String pCacheDir)
          The physical directory for cache files.
 void setPhysicalOutputDirectory(String dirPath)
          The physical directory for output files.
 void setSOMCacheDirectory(String pCacheDir)
          The parent directory for cache files.
 void setVirtualCacheDirectory(String pVirtualCacheDir)
          The virtual directory for cache files.
 void setVirtualOutputDirectory(String dirPath)
          The virtual directory for output files.
 void startWithData(IDataset pDataset)
          An alternative to calling Connect().
 void stop()
          Clears out all of the map objects in memory.
 IPointCollection toMapPoints(IMapDescription mapDescription, IImageDisplay mapDisplay, ILongArray screenXValues, ILongArray screenYValues)
          Converts a screen location to a map coordinate.
 IPointCollection toPagePoints(IEnvelope pageExtent, IImageDisplay pageDisplay, ILongArray screenXValues, ILongArray screenYValues)
          Converts a screen location to a page coordinate.
 void update(IPropertySet props)
          Updates object's properties.
 void validate(IPropertySet props)
          Validates an object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

MapServer

public MapServer()
          throws IOException,
                 UnknownHostException
Constructs a MapServer using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

MapServer

public MapServer(Object obj)
          throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
MapServer theMapServer = (MapServer) obj;

Construct a MapServer using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to MapServer.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getDocumentInfo

public IPropertySet getDocumentInfo()
                             throws IOException,
                                    AutomationException
A set of name-value pairs for properties set for the map document (mxd only). These properties are string values set in the map document's Map Properties dialog and include: Title, Subject, Author, Category, Keywords and Comments.

Remarks

Optimized MapServer also returns two additional properties – AntialiasingMode and TextAntialiasingMode. Return values for AntialiasingMode are Fastest, Fast, Normal, Best or None, TextAntialiasingMode returns None, Normal or Force.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getDocumentInfo in interface IMapServer
Specified by:
getDocumentInfo in interface IMapServer2
Specified by:
getDocumentInfo in interface IMapServer3
Returns:
A reference to a com.esri.arcgis.system.IPropertySet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapCount

public int getMapCount()
                throws IOException,
                       AutomationException
The number of maps (data frames) in the document.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMapCount in interface IMapServer
Specified by:
getMapCount in interface IMapServer2
Specified by:
getMapCount in interface IMapServer3
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapName

public String getMapName(int index)
                  throws IOException,
                         AutomationException
Name of the map (data frame) as indicated by the index. The first beginning with 0.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMapName in interface IMapServer
Specified by:
getMapName in interface IMapServer2
Specified by:
getMapName in interface IMapServer3
Parameters:
index - The index (in)
Returns:
The mapName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDefaultMapName

public String getDefaultMapName()
                         throws IOException,
                                AutomationException
Name of the document's active map (data frame).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getDefaultMapName in interface IMapServer
Specified by:
getDefaultMapName in interface IMapServer2
Specified by:
getDefaultMapName in interface IMapServer3
Returns:
The mapName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerInfo

public IMapServerInfo getServerInfo(String mapName)
                             throws IOException,
                                    AutomationException
Returns information about a map (data frame).

Remarks

This method returns a MapServerInfo object. Using IMapServerInfo2 you can retrieve information regarding the present state of the MapServer object. If two (or more) data frames have the same name, Map Server adds a distinctive number at the end of the second name. E.g. Layers and Layers2.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getServerInfo in interface IMapServer
Specified by:
getServerInfo in interface IMapServer2
Specified by:
getServerInfo in interface IMapServer3
Parameters:
mapName - The mapName (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapServerInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exportMapImage

public IMapImage exportMapImage(IMapDescription mapDesc,
                                IImageDescription imageDesc)
                         throws IOException,
                                AutomationException
Generates an image of the map, based on the given map description, and writes the image to a specified file on disk. Supported file types are: 'bmp', 'jpg', 'tif', 'png'/'png8', 'png24', 'emf', 'ps', 'pdf', 'ai', 'gif', and 'svg'/'svgz'.

Remarks

Use ExportMapImage to retrieve a file (image or vector format) of the map.

The input parameter MapDescription contains properties describing the map (also known as the data frame). These include the map's Name, the MapArea, the SpatialReference , as well as collections of LayerDescription objects. Size, resolution and file format are determined by the ImageDescription, which includes ImageDisplay and ImageType objects.

ExportMapImage returns a MapImage object. MapExtent, MapScale and an array of VisibleLayers can be retrieved from the MapImage.

You can export the map to either a vector or an image type. This is specified by the ReturnType property of IImageType.

Setting the size and resolution of the output

Size and resolution are set in the ImageDisplay. Both Height and Width are required. The Height and Width properties of IImageResult are read-only and are not used to make changes. In order to control the size of an exported image, IMapServerInit2 contains two properties: MaxImageHeight and MaxImageWidth. The default value for these properties is 1024 pixels.

You should be careful when specifying a DeviceResolution to the ImageDisplay. This is merely used by the map service to determine map scale on the server, it does not define the resolution of the map image. Changing the DeviceResolution may lead to unintended changes in the map scale. For example, you export a map image to JPG. You specify an image of 400 pixels by 600 pixels with the DeviceResolution set at 96. The relative MapScale of the resulting image is around 54,000,000. Next, you increase the DeviceResolution to 300 while keeping the size constant. The MapScale of this result is about 205,000,000. The result may not be want you wanted if the map contains layers or labels that are scale-dependent. In order to to maintain the MapScale at around 1:54,000,000 you would need to export a larger image.

If you are exporting to PDF you will need to keep in mind that PDF exits in page space. Setting the Height and Width sets the dimensions of the PDF page. For example, you export a map image to PDF where the ImageDisplay Height is 400 and the Width is 500. The DeviceResolution is 100. The resulting PDF is 4 inches by 5 inches. Holding the Height and Width settings constant, as you increase the DeviceResolution the actual size of the PDF will get smaller. As you decrease the DeviceResolution the size of the PDF gets larger. This will also affect MapScale. If you wish the MapScale to stay constant you will need to increase (or decrease) the ImageDisplay Height and Width values as you increase (or decrease) the DeviceResolution.

DeviceResolution also affects the symbols is rendered. For example, two map images were generated using the same size (250x250), same extent but a different DeviceResolution. The first map image was created with a DeviceResolution of 96 and the second one with 200. You will notice the symbols size differences between those two images. Symbology size is defined using points (1 point = 1/72 inch) in the source map. To determine symbology size in a map, DeviceResolution is used to convert from points to pixels with the following equation:

Symbol Size in Points * (DeviceResolution/Number of Points in 1 inch)

In the map image with 96 DeviceResolution, a symbol size of 1 point will use 1.33 pixels (rounded down to 1 pixel) to render. In the map image with 200 DeviceResolution, a symbol size of 1 point will use 2.78 (rounded up to 3 pixels) to render. As a result, the symbology appears larger in the map image created using a DeviceResolution of 200.

Image quality and image type of optimized MapServer

Miscellaneous

Exporting a map from a cached service does not generate map dynamically, instead it creates map using pre-cooked cache tiles.

Exporting a map is different than exporting a layout. Page space is an important component of ExportLayout. It exists for all map documents and the map services the documents are based on. This page space provides the default size of the exported layout (for best results you should use this default). Page space does not exist in ExportMapImage. Therefore, you will see differences in results when adjusting the Height, Width or DeviceResolution for a ExportMapImage as compared to making similar adjustments for ExportLayout.

Use IMapServerGeoTransformation when the image output from a map service is to be displayed in a coordinate system where the underlying geographic coordinate system is different than the underlying geographic coordinate system of the DefaultMapDescription.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
exportMapImage in interface IMapServer
Specified by:
exportMapImage in interface IMapServer2
Specified by:
exportMapImage in interface IMapServer3
Parameters:
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)
imageDesc - A reference to a com.esri.arcgis.carto.IImageDescription (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapImage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

find

public IMapServerFindResults find(IMapDescription mapDesc,
                                  IImageDisplay mapImage,
                                  String searchString,
                                  boolean contains,
                                  String searchFields,
                                  int option,
                                  ILongArray layerIds)
                           throws IOException,
                                  AutomationException
Returns a collection of Map Server Find Result objects that contain the given search string. If LayerIDs is Nothing/Null or empty, all layers are searched.

Remarks

Find performs a search based on a string value. This search can be conducted on a single field of a single layer, on many fields of a single layer or on many fields on many layers. Find returns a collection of objects that implement IMapServerFindResult.

Find requires a number of input parameters. These include: a MapDescription, an ImageDisplay, the search string, a Boolean value on whether the search string is an exact match (False) or not (True), a comma delimited list of string values for the names of the fields you want to search, the esriFindOption, and an array of layer Ids to be searched.

Please note that Find only works with layer and does not work with StandaloneTable. It also does not honor any time setting of a layer.

MapDescription

The MapDescription contains all the LayerDescriptions in the map. These LayerDescriptions include a DefinitionExpression property. A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be set in the source map document as a definition query, or can be set using the DefinitionExpression property. The DefinitionExpression set in the LayerDescription will override any any definition query set in the source map. MapServer Find results should honor any definition query or DefinitionExpression set on the layer.

ImageDisplay

This is needed to determine whether layers are visible or not based on the current map scale.

Search Fields

If the searchFields parameter is blank all fields will be searched.

esriFindOption

The esriFindOption parameter includes: esriFindAllLayers and esriFindVisibleLayers. If esriFindAllLayers is being used all layers are valid. If esriFindVisibleLayers is used, the search will be conducted only on layers that are visible in the map display. Layer visibility depends on whether the layer is on or off (the Visible property on ILayerDescription3) or whether the layer is on, but not visible due to scale dependencies (the MinScale and MaxScale properties on IMapLayerInfo2). The mapImage parameter is needed to determine whether the layer is not visible based on scale dependencies. This parameter can be Nothing/Null if esriFindAllLayers is used.

The parameters esriFindOption and LayerIDs behave like a boolean AND. There is no precedence. For example: if esriFindOption is esriFindVisibleLayers and pLayerIDs is Nothing/Null or empty, all the visible layers are searched. If esriFindOption is esriFindVisibleLayers and pLayerIDs contains only the first layer, the first layer is searched only if it is visible.

Results

Find always honors field visibility, and by default it respects field aliases and field formatting set in the source map document. If you want to use field names instead of field aliases, set ReturnFieldNamesInResults to True. When you want to have value in original data type (i.e. as Double instead of formatted string) so that you can do some computation (e.g. change the numeric or date to your locale settings), set FormatValuesInResults to False. It is important to note that these properties are only honored when the layer being searched implements IFeatureLayer (e.g. FeatureLayer). If the feature being queried has more than one field with the same alias (e.g. when joined), only one will be passed back to the client and the rest will be dropped from the result.

Geometry is always returned in the same spatial reference system as the DefaultMapDescription, even though the source data of a layer may be in a different coordinate system. The value of the Shape field in the result is a string showing the type of the geometry. To get the geometry associated with the result, use the IMapServerFindResult::FeatureShape property.

In some cases, for performance reasons, you may want limit or adjust the geometry being returned in the find result. Use ILayerResultOptions to manage this. If IncludeGeometry is set to False, FeatureShape returns nothing. This should increase performance in cases where feature geometry is large. When ILayerResultOptions is not used, FeatureShape returns geometry. If the Shape field is invisible in the source map, FeatureShape may still contain geometry depending on how IncludeGeometry is set by the user. You can also choose to densify or generalize the geometry returned in FeatureShape using GeometryResultOptions. Densification is used to better support clients that do not support Arcs (e.g. Bezier, Circular etc.). Generalization reduces the amount of geography being sent across the network and should lead to better performance. If LayerResultOptions are not specified for the LayerDescription, query results will include the original geometry.

Miscellaneous

There are two key differences between Find and the other query methods such as QueryData, QueryRowIDs, QueryFeatureData etc. The first is that Find can work on multiple layers while the query methods work with a single layer. The second is that Find only works with a search string. The query methods use a queryFilter as a parameter. This allows the query to be based on either an attribute filter (SQL expression) or a spatial filter.

In order to control the amount of information MapServer needs to process for a query, a maximum number of records can be set. This value is contained in the MaxRecordCount property on IMapServerInit2. The default value for this property is 1,000. If 1,100 features match a given query only the first 1,000 results will be returned. You will be unable to access the remaining 100 records. To be able to access these records the MaxRecordCount would need to be increased to 1,100. MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
find in interface IMapServer
Specified by:
find in interface IMapServer2
Specified by:
find in interface IMapServer3
Parameters:
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)
mapImage - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
searchString - The searchString (in)
contains - The contains (in)
searchFields - The searchFields (in)
option - A com.esri.arcgis.carto.esriFindOption constant (in)
layerIds - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapServerFindResults
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

identify

public IMapServerIdentifyResults identify(IMapDescription mapDesc,
                                          IImageDisplay mapImage,
                                          IGeometry searchShape,
                                          int tolerance,
                                          int option,
                                          ILongArray layerIds)
                                   throws IOException,
                                          AutomationException
Returns a collection of Map Server Identify Result objects at the given location. If LayerIDs is Nothing/Null or empty, all layers are searched.

Remarks

Identify returns map features and their attribute values based on a search location. This can be conducted on an individual layer, the top-most layer, all layers, or just on all the visible layers. This method returns a collection of objects that implement IMapServerIdentifyResult.

Identify requires a number of input parameters. These include: a MapDescription, an ImageDisplay, a search shape, a tolerance, the esriIdentifyOption, and an array of layer Ids to be identified. Please note that it does not work with StandaloneTable.

Time aware layer

Identify recognizes time settings of a layer. When a layer's UseTime is true and MapDescription's TimeValue is set, Identify only searches features that fall within the time frame.

Layer with HTMLPopup

Identify can return results additionally in rich html format. When a layer's HTMLPopupType is not esriServerHTMLPopupTypeNone, you can use one of identify two htmlpopup options to get identify result in html format the way it is authored.

MapDescription

The MapDescription contains all the LayerDescriptions in the map. These LayerDescriptions include a DefinitionExpression property. A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be set in the source map document as a definition query, or can be set using the DefinitionExpression property. The DefinitionExpression set in the LayerDescription will override any any definition query set in the source map. MapServer Identify results should honor any definition query or DefinitionExpression set on the layer.

ImageDisplay

This is needed to determine whether layers are visible or not based on the current map scale.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

Tolerance

Tolerance is the distance in which features are searched. The unit is in pixel. It is only used for when SearchShape is a point.

esriIdentifyOption

The esriIdentifyOption parameter includes: esriIdentifyAllLayers, esriIdentifyVisibleLayers and esriIdentifyTopmost. If esriIdentifyAllLayers is being used all features for all layers in the map that fall within the tolerance value of the searchShape will be returned. If esriIdentifyVisibleLayers is used then only features from visible layers are returned. Layer visibility depends on whether the layer is on or off (the Visible property on ILayerDescription3) or whether the layer is on, but not visible due to scale dependencies (the MinScale and MaxScale properties on IMapLayerInfo2). The mapImage parameter is needed to determine whether the layer is not visible based on scale dependencies. The esriIdentifyOption esriIdentifyTopmost refers to the visible layer that is topmost in the map drawing order at the location specified by searchShape.

Layer IDs

The parameters esriIdentifyOption and LayerIDs behave like a boolean AND. There is no precedence. For example: if esriIdentifyOption is esriIdentifyVisibleLayers and pLayerIDs is Nothing/Null or empty, all the visible layers are searched. If esriIdentifyOption is esriIdentifyVisibleLayers and pLayerIDs contains only the first layer, the first layer is searched only if it is visible.

Results

Identify always honors field visibility, and by default it respects field aliases and field formatting set in the source map document. If you want to use field names instead of field aliases, set ReturnFieldNamesInResults to True. When you want to have value in original data type (i.e. as Double instead of formatted string) so that you can do some computation (e.g. change the numeric or date to your locale settings), set FormatValuesInResults to False. It is important to note that these properties are only honored when the layer being identified implements IFeatureLayer (e.g. FeatureLayer).

Geometry is always returned in the same spatial reference system as the DefaultMapDescription, even though the source data of a layer may be in a different coordinate system. The value of the Shape field in the IMapServerIdentifyResult::PropetySet or in related IMapServerRow::PropertySet is a string showing the type of the geometry. To get the geometry associated with the result, use the IMapServerIdentifyResult::Shape property instead. Identify does not return geometry associated with any related feature. If the feature being identified has more than one field with the same name, only one will be passed back to the client and the rest will be dropped from the result.

In some cases, for performance reason, you may want limit or adjust the geometry being returned in the identify result. Use ILayerResultOptions to manage this. If IncludeGeometry is set to False, Shape property returns nothing. This should increase performance in cases where feature geometry is large. When ILayerResultOptions is not used, the Shape property returns geometry. If the Shape field is invisible in the source map, the Shape property may still contain geometry depending on how IncludeGeometry is set by the user. You can also choose to densify or generalize the returned geometry by using GeometryResultOptions. Densification is used to better support clients that do not support Arcs (e.g. Bezier, Circular etc.). Generalization reduces the amount of geography being sent across the network and should lead to better performance.

Miscellaneous

In order to control the amount of information MapServer needs to process for a query, a maximum number of records can be set. This value is contained in the MaxRecordCount property on IMapServerInit2. The default value for this property is 1000. If 1,100 features match a given query only the first 1,000 results will be returned. You will be unable to access the remaining 100 records. To be able to access these records the MaxRecordCount would need to be increased to 1,100. MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

If the layer being identified has a relationship to other tables, the IMapServerRelationship and IMapServerRow interfaces provide access to properties of the relationship and related tables. The number of rows returned is not limited by MaxRecordCount.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
identify in interface IMapServer
Specified by:
identify in interface IMapServer2
Specified by:
identify in interface IMapServer3
Parameters:
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)
mapImage - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
searchShape - A reference to a com.esri.arcgis.geometry.IGeometry (in)
tolerance - The tolerance (in)
option - A com.esri.arcgis.carto.esriIdentifyOption constant (in)
layerIds - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapServerIdentifyResults
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryFeatureCount

public int queryFeatureCount(String mapName,
                             int layerID,
                             IQueryFilter filter)
                      throws IOException,
                             AutomationException
Returns the count of the features that meet the query filter selection criteria for the specified layer.

Remarks

QueryFeatureCount returns the number of map features that match the parameters of a given query filter.

QueryFeatureCount requires a number of input parameters. These include: a MapName, LayerID, and a QueryFilter. The QueryFilter can be an attribute query (SQL espression), a spatial query, or a combination of both.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression) a spatial filter, or a combination of both. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the sytax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

Miscellaneous

MaxRecordCount does not affect QueryFeatureCount or QueryFeatureCount2.

There are two key differences between Find and QueryFeatureCount. The first is that Find can work on multiple layers while the query methods work with a single layer. The second is that Find only works with a search string. The query methods use a queryFilter as a parameter. This allows the query to be based on either an attribute filter (SQL expression) or a spatial filter.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryFeatureCount in interface IMapServer
Specified by:
queryFeatureCount in interface IMapServer2
Specified by:
queryFeatureCount in interface IMapServer3
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryFeatureIDs

public IFIDSet queryFeatureIDs(String mapName,
                               int layerID,
                               IQueryFilter filter)
                        throws IOException,
                               AutomationException
Returns the IDs of the features that meet the query filter selection criteria for the specified layer.

Remarks

QueryFeatureIDs returns the IDs (FIDSet) of map features that match the parameters of a given query filter.

QueryFeatureIDs requires a number of input parameters. These include: a MapName, LayerID, and a QueryFilter. The QueryFilter can be an attribute query (SQL espression), a spatial query, or a combination of both.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression) a spatial filter, or a combination of both. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the sytax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

Miscellaneous

MaxRecordCount does not affect QueryFeatureIDs or QueryFeatureIDs2.

There are two key differences between Find and QueryFeatureIDs. The first is that Find can work on multiple layers while the query methods work with a single layer. The second is that Find only works with a search string. The query methods use a queryFilter as a parameter. This allows the query to be based on either an attribute filter (SQL expression) or a spatial filter.

The results of this function can be used with LayerDescription::SelectionFeatures to display the selection in the exported image.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryFeatureIDs in interface IMapServer
Specified by:
queryFeatureIDs in interface IMapServer2
Specified by:
queryFeatureIDs in interface IMapServer3
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFIDSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryFeatureData

public IRecordSet queryFeatureData(String mapName,
                                   int layerID,
                                   IQueryFilter filter)
                            throws IOException,
                                   AutomationException
Returns a record set of features that meet the query filter selection criteria for the specified layer.

Remarks

QueryFeatureData returns the records of map features that match the parameters of a given query filter. QueryFeatureData returns a RecordSet .

QueryFeatureData requires a number of input parameters. These include: a Name, LayerID, and a QueryFilter. The QueryFilter can be an attribute query (SQL espression), a spatial query, a combination of both or null.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression) a spatial filter, or a combination of both. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the sytax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

It can be set to null or Nothing to retrieve all data (which is also limited by MaxRecordCount)

If geometry is not desired in the output RecordSet, IQuerFilter’s SubFields must be defined without ‘Shape’ field. When SubFields is empty or includes ‘Shape’, IRecordSet will include the fields "shape_length" and "shape_area". If the desired spatial reference of the output geometry is different than the original one, OutputSpatialReference should be used. Otherwise geometry is returned in the same spatial reference system as the DefaultMapDescription by default. When SubFields is not defined or = “*”, it returns all visible fields. Invisible or invalid field names or field aliases must not be included in SubField’s string or it will return an error. Please note ObjectID field is always returned regardless of whether it is in the SubFields or not. Only expection is when DISTINCT is used.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

Results

QueryFeatureData honors field visibility set in the source map document. Field aliases, set in the source map document, are honored only when working with the MapServer WSDL or accessing a MapServer object through an AGSServerConnection (LAN or internet), but not honored for DCOM connection. However, the RecordSet does NOT honor any field formatting set in the source map.

Geometry is always returned in the same spatial reference system as the DefaultMapDescription, even though the source data of a layer may be in a different coordinate system, unless OutputSpatialReference is explicitly set to another coordinate system by the user (for SOAP/WSDL, both OutputSpatialReference & SpatialReferenceFieldName properties must be set). To get the coordinate system, IField::GeometryDef should be used.

In some cases, may be for performance reasons, you may want to limit or adjust the geometry being returned in the record set result. You cannot adjust returned geometry using QueryFeatureData. You will need to use QueryFeatureData2 in order to do this.

In order to control the amount of information MapServer needs to process for a query, a maximum number of records can be set. This value is contained in the MaxRecordCount property on IMapServerInit2. The default value for this property is 500. If 600 features match a given query only the first 500 results will be returned. You will be unable to access the remaining 100 records. To be able to access these records the MaxRecordCount would need to be increased to 600. MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

Miscellaneous

There are two key differences between Find and QueryFeatureData. The first is that Find can work on multiple layers while the query methods work with a single layer. The second is that Find only works with a search string. The query methods use a queryFilter as a parameter. This allows the query to be based on either an attribute filter (SQL expression) or a spatial filter.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryFeatureData in interface IMapServer
Specified by:
queryFeatureData in interface IMapServer2
Specified by:
queryFeatureData in interface IMapServer3
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IRecordSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryHyperlinks

public IMapServerHyperlinks queryHyperlinks(IMapDescription mapDesc,
                                            IImageDisplay mapImage,
                                            ILongArray layerIds)
                                     throws IOException,
                                            AutomationException
Returns a collection of Map Server Hyperlink objects for the specified layers. Only hyperlinks of visible layers are returned. If LayerIDs is Nothing/Null or empty, all layers are searched.

Remarks

QueryHyperlinks returns a collection of objects that implement IMapServerHyperlink.

QueryHyperlinks requires a number of input parameters. These include: a MapDescription, ImageDisplay, and LayerID.

MapDescription

The MapDescription contains all the LayerDescriptions in the map. These LayerDescriptions include a DefinitionExpression property. A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be set in the source map document as a definition query, or can be set using the DefinitionExpression property. The DefinitionExpression set in the LayerDescription will override any any definition query set in the source map. MapServer QueryHyperlinks results should honor any definition query or DefinitionExpression set on the layer.

ImageDisplay

This is needed to determine whether layers are visible or not based on the current map scale. Layer visibility depends on whether the layer is on or off (the Visible property on ILayerDescription3) or whether the layer is on, but not visible due to scale dependencies (the MinScale and MaxScale properties on IMapLayerInfo2).

Miscellaneous

In some cases, for performance reasons, you may want to adjust the geometry being returned in the QueryHyperlink result. Use ILayerResultOptions to manage this. You can choose to densify or generalize the returned geometry by using GeometryResultOptions. Densification is used to better support clients that do not support Arcs (e.g. Bezier, Circular etc.). Generalization reduces the amount of geography being sent across the network and should lead to better performance. Setting IncludeGeometry property has no effect, QueryHyperLinks always returns geometry.

Geometry is always returned in the same spatial reference system as the DefaultMapDescription, even though the source data of a layer may be in a different coordinate system.

In order to control the amount of information MapServer needs to process for a query, a maximum number of records can be set. This value is contained in the MaxRecordCount property on IMapServerInit2. The default value for this property is 500. If 600 features match a given query only the first 500 results will be returned. You will be unable to access the remaining 100 records. To be able to access these records the MaxRecordCount would need to be increased to 600. MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryHyperlinks in interface IMapServer
Specified by:
queryHyperlinks in interface IMapServer2
Specified by:
queryHyperlinks in interface IMapServer3
Parameters:
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)
mapImage - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
layerIds - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapServerHyperlinks
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

computeScale

public double computeScale(IMapDescription mapDesc,
                           IImageDisplay mapDisplay)
                    throws IOException,
                           AutomationException
Computes the scale of the specified map, at the given map extent, for an image with the given size.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
computeScale in interface IMapServer
Specified by:
computeScale in interface IMapServer2
Specified by:
computeScale in interface IMapServer3
Parameters:
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)
mapDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
Returns:
The scale
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

computeDistance

public double computeDistance(String mapName,
                              IPoint fromPoint,
                              IPoint toPoint,
                              int units)
                       throws IOException,
                              AutomationException
Computes the distance between two points on the specified map. The result is in the map units of the specified map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
computeDistance in interface IMapServer
Specified by:
computeDistance in interface IMapServer2
Specified by:
computeDistance in interface IMapServer3
Parameters:
mapName - The mapName (in)
fromPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
toPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
units - A com.esri.arcgis.system.esriUnits constant (in)
Returns:
The distance
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

toMapPoints

public IPointCollection toMapPoints(IMapDescription mapDescription,
                                    IImageDisplay mapDisplay,
                                    ILongArray screenXValues,
                                    ILongArray screenYValues)
                             throws IOException,
                                    AutomationException
Converts a screen location to a map coordinate.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
toMapPoints in interface IMapServer
Specified by:
toMapPoints in interface IMapServer2
Specified by:
toMapPoints in interface IMapServer3
Parameters:
mapDescription - A reference to a com.esri.arcgis.carto.IMapDescription (in)
mapDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
screenXValues - A reference to a com.esri.arcgis.system.ILongArray (in)
screenYValues - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.geometry.IPointCollection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

fromMapPoints

public void fromMapPoints(IMapDescription mapDescription,
                          IImageDisplay mapDisplay,
                          IPointCollection mapPoints,
                          ILongArray[] screenXValues,
                          ILongArray[] screenYValues)
                   throws IOException,
                          AutomationException
Converts a map coordinate to a screen location.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
fromMapPoints in interface IMapServer
Specified by:
fromMapPoints in interface IMapServer2
Specified by:
fromMapPoints in interface IMapServer3
Parameters:
mapDescription - A reference to a com.esri.arcgis.carto.IMapDescription (in)
mapDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
mapPoints - A reference to a com.esri.arcgis.geometry.IPointCollection (in)
screenXValues - A reference to a com.esri.arcgis.system.ILongArray (in/out: use single element array)
screenYValues - A reference to a com.esri.arcgis.system.ILongArray (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLegendInfo

public IMapServerLegendInfos getLegendInfo(String mapName,
                                           ILongArray layerIds,
                                           IMapServerLegendPatch patch,
                                           IImageType imgType)
                                    throws IOException,
                                           AutomationException
Returns a collection of Map Server Legend Info objects for the specified layers. If layerIDs is Nothing/Null or empty, legend information for all layers is returned.

Remarks

Use GetLegendInfo to retrieve individual legend elements including the symbol image, labels, descriptions and headings. A common use would be to populate a table of contents. Note that composite layers such as group layers and annotation layers do not contain legend elements. To export a single image of the legend use ExportLegend on IMapServerLayout.

The GetLegendInfo method returns a collection of MapServerLegendInfo objects. Legends are associated with renderers that belong to each layer in a map. Each layer has a separate renderer. Each renderer has one or more legend groups. Each legend group has one or more legend classes. Customizing the legend patch can be done using IMapServerLegendPatch . When passing in "Nothing" for this input parameter ("patch") the default legend patch is used.

MapServerLegendInfo doesn't contain information about whether the data frame and the layers in the TOC are expanded or collapsed in the original map document. You have to write your own code to find this out.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getLegendInfo in interface IMapServer
Specified by:
getLegendInfo in interface IMapServer2
Specified by:
getLegendInfo in interface IMapServer3
Parameters:
mapName - The mapName (in)
layerIds - A reference to a com.esri.arcgis.system.ILongArray (in)
patch - A reference to a com.esri.arcgis.carto.IMapServerLegendPatch (in)
imgType - A reference to a com.esri.arcgis.carto.IImageType (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapServerLegendInfos
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSQLSyntaxInfo

public ISQLSyntaxInfo getSQLSyntaxInfo(String mapName,
                                       int layerID)
                                throws IOException,
                                       AutomationException
Returns the SQL syntax information for the specified layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSQLSyntaxInfo in interface IMapServer
Specified by:
getSQLSyntaxInfo in interface IMapServer2
Specified by:
getSQLSyntaxInfo in interface IMapServer3
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
Returns:
A reference to a com.esri.arcgis.carto.ISQLSyntaxInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSupportedImageReturnTypes

public int getSupportedImageReturnTypes()
                                 throws IOException,
                                        AutomationException
The supported image return types for the map server. A value of esriImageReturnMimeData means that only MIME data is supported. Otherwise, either MIME data or URLs are supported.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getSupportedImageReturnTypes in interface IMapServer
Specified by:
getSupportedImageReturnTypes in interface IMapServer2
Specified by:
getSupportedImageReturnTypes in interface IMapServer3
Returns:
A com.esri.arcgis.carto.esriImageReturnType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapTileEx

public byte[] getMapTileEx(String mapName,
                           int level,
                           int row,
                           int column,
                           int cacheFormat)
                    throws IOException,
                           AutomationException
Gets a tile for a given tile location from a given map.

Remarks

This call gets the specified tile from a map service that has a single fused cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMapTileEx in interface ITiledMapServer2
Parameters:
mapName - The mapName (in)
level - The level (in)
row - The row (in)
column - The column (in)
cacheFormat - The cacheFormat (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayerTileEx

public byte[] getLayerTileEx(String mapName,
                             int layerID,
                             int level,
                             int row,
                             int column,
                             int cacheFormat)
                      throws IOException,
                             AutomationException
Gets a tile for a given tile location from a given layer.

Remarks

This call gets the specified tile from the specified layer for a map service that has a multi layer cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLayerTileEx in interface ITiledMapServer2
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
level - The level (in)
row - The row (in)
column - The column (in)
cacheFormat - The cacheFormat (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTileImageInfo

public ITileImageInfo getTileImageInfo(String mapName)
                                throws IOException,
                                       AutomationException
Gets the cache tile image information for a given map.

Remarks

GetTileIMageInfo returns information describing the image format for the cached tiles. TileImageInfo has two main properties Format and Compression quality. Format can have values (PNG8, PNG24, PNG32 and JPEG). If the selected format is JPEG, then the compression quality can have a value from 0 to 100. The value of format must be used in constructing the url to the tile.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getTileImageInfo in interface ITiledMapServer2
Parameters:
mapName - The mapName (in)
Returns:
A reference to a com.esri.arcgis.carto.ITileImageInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCacheDescriptionInfo

public ICacheDescriptionInfo getCacheDescriptionInfo(String mapName)
                                              throws IOException,
                                                     AutomationException
Gets the cache description information for a given map.

Remarks

GetCacheDescriptionInfo returns information on a cached map service in one call including its cache type, its tiling scheme (TileCacheInfo), image information (TileImageInfo) and control information (TileControlInfo). The cache description also includes an array of layer cache infos that can be used to determine if a specific layer has a cache in the case of map services that have a multi layer cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getCacheDescriptionInfo in interface ITiledMapServer2
Parameters:
mapName - The mapName (in)
Returns:
A reference to a com.esri.arcgis.carto.ICacheDescriptionInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCacheControlInfo

public ICacheControlInfo getCacheControlInfo(String mapName)
                                      throws IOException,
                                             AutomationException
Gets the cache description information for a given map.

Remarks

Returns cache control information that allows clients to discover information such as if client caching is allowed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getCacheControlInfo in interface ITiledMapServer2
Parameters:
mapName - The mapName (in)
Returns:
A reference to a com.esri.arcgis.carto.ICacheControlInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isFixedScaleMap

public boolean isFixedScaleMap(String mapName)
                        throws IOException,
                               AutomationException
Indicates if a given map is a fixed scale map.

Remarks

Use this method to determine if a map service is cached. The term fixed scale map service and cached map service are used synonymously in the API. A fixed scale map service works with a cache of images that represent pre-rendered tiles for either the entire map service or for individual layers in the map service.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isFixedScaleMap in interface ITiledMapServer
Parameters:
mapName - The mapName (in)
Returns:
The pIsFixedScaleMap
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

hasSingleFusedMapCache

public boolean hasSingleFusedMapCache(String mapName)
                               throws IOException,
                                      AutomationException
Indicates if a given map has a single fused map tile cache.

Remarks

Use this method to determine if a cached map service has a single fused map cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
hasSingleFusedMapCache in interface ITiledMapServer
Parameters:
mapName - The mapName (in)
Returns:
The pHasCache
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTileCacheInfo

public ITileCacheInfo getTileCacheInfo(String mapName)
                                throws IOException,
                                       AutomationException
Gets the cache configuration for a given map.

Remarks

The TileCacheInfo object contains information on the tiling scheme for the cache. The tiling scheme includes the tiling origin, spatial reference, tile size in pixels and information on the Levels of Detail at which the service is cached.

LODInfos enumerate a LODInfo object which describes a scale and resoluton.

Using the tiling scheme information in the TileCacheInfo object the client can calculate the tiles that cover any rectangular extent in map space and then retrieve tiles either directly from the virtual directory, or from the tile handler or by making GetMapTile or GetLayerTile requests against the map service.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getTileCacheInfo in interface ITiledMapServer
Parameters:
mapName - The mapName (in)
Returns:
A reference to a com.esri.arcgis.carto.ITileCacheInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapTile

public byte[] getMapTile(String mapName,
                         int level,
                         int row,
                         int column)
                  throws IOException,
                         AutomationException
Gets a tile for a given tile location from a given map.

Remarks

This call gets the specified tile from a map service that has a single fused cache. GetMapTile only returns a tile if the cache is generated using PNG format. When the cache format specified in the TileImageInfo is not PNG the client should use GetMapTileEx.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMapTile in interface ITiledMapServer
Parameters:
mapName - The mapName (in)
level - The level (in)
row - The row (in)
column - The column (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

hasLayerCache

public boolean hasLayerCache(String mapName,
                             int layerID)
                      throws IOException,
                             AutomationException
Indicates if a given layer has a single tile cache.

Remarks

Use this method to discover if a particular layer in a map service with a multi layer cache is cached or not. If IsFixedScaleMap is true and HasSingleFusedMapCache is false, then the map service has a multi layer cache that is made up of individual layer caches. Not all layers in such a map service need be cached.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
hasLayerCache in interface ITiledMapServer
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
Returns:
The pHasCache
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayerTile

public byte[] getLayerTile(String mapName,
                           int layerID,
                           int level,
                           int row,
                           int column)
                    throws IOException,
                           AutomationException
Gets a tile for a given tile location from a given layer.

Remarks

This call gets the specified tile from the specified layer for a map service that has a multi layer cache. GetLayerTile method only returns a tile if the cache is generated using PNG format. When the cache format specified in the TileImageInfo is not PNG the client should use GetLayerTileEx.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLayerTile in interface ITiledMapServer
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
level - The level (in)
row - The row (in)
column - The column (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getVirtualCacheDirectory

public String getVirtualCacheDirectory(String mapName,
                                       int layerID)
                                throws IOException,
                                       AutomationException
Gets the virtual cache directory for a given layer within a map.

Remarks

This call retrieves the virtual directory that hosts the cache tiles for this map service. Use -1 as the layerid in order to get the virtual cache directory for a map service that has a single fused cache. This is an optional property and may not always be present, for example, on a secure server or on an on demand server. If present then this is the preferred (most optimal) way for a client to retrieve tiles.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getVirtualCacheDirectory in interface ITiledMapServer
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
Returns:
The pURL
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCacheName

public String getCacheName(String mapName,
                           int layerID)
                    throws IOException,
                           AutomationException
Gets the cache name for a given layer within a map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getCacheName in interface ITiledMapServer
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
Returns:
The pURL
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCacheStorageInfo

public ICacheStorageInfo getCacheStorageInfo(String mapName)
                                      throws IOException,
                                             AutomationException
Gets the cache storage information.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getCacheStorageInfo in interface ITiledMapServer3
Parameters:
mapName - The mapName (in)
Returns:
A reference to a com.esri.arcgis.carto.ICacheStorageInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

construct

public void construct(IPropertySet props)
               throws IOException,
                      AutomationException
Two phase object construction.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
construct in interface IObjectConstruct
Parameters:
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleBinaryRequest

public byte[] handleBinaryRequest(byte[] request)
                           throws IOException,
                                  AutomationException
Handles a binary request.

Specified by:
handleBinaryRequest in interface IRequestHandler
Parameters:
request - An unsigned byte (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleStringRequest

public String handleStringRequest(String capabilities,
                                  String request)
                           throws IOException,
                                  AutomationException
Handles a SOAP string request.

Specified by:
handleStringRequest in interface IRequestHandler
Parameters:
capabilities - The capabilities (in)
request - The request (in)
Returns:
The response
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleBinaryRequest2

public byte[] handleBinaryRequest2(String capabilities,
                                   byte[] request)
                            throws IOException,
                                   AutomationException
Handles a binary request with explicit capabilities.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
handleBinaryRequest2 in interface IRequestHandler2
Parameters:
capabilities - The capabilities (in)
request - An unsigned byte (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMap

public IMap getMap(String mapName)
            throws IOException,
                   AutomationException
The map corresponding to the specified map name. Pass in a blank string for mapName to get the default map (active data frame).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMap in interface IMapServerObjects
Specified by:
getMap in interface IMapServerObjects2
Specified by:
getMap in interface IMapServerObjects3
Parameters:
mapName - The mapName (in)
Returns:
A reference to a com.esri.arcgis.carto.IMap
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayer

public ILayer getLayer(String mapName,
                       int layerID)
                throws IOException,
                       AutomationException
The layer specified by the map name and layer ID. If the mapName is blank, the default map (active data frame) will be assumed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLayer in interface IMapServerObjects
Specified by:
getLayer in interface IMapServerObjects2
Specified by:
getLayer in interface IMapServerObjects3
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
Returns:
A reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPageLayout

public IPageLayout getPageLayout()
                          throws IOException,
                                 AutomationException
The page layout object for the current map document.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPageLayout in interface IMapServerObjects
Specified by:
getPageLayout in interface IMapServerObjects2
Specified by:
getPageLayout in interface IMapServerObjects3
Returns:
A reference to a com.esri.arcgis.carto.IPageLayout
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getThumbnail

public Picture getThumbnail()
                     throws IOException,
                            AutomationException
The thumbnail stored in the map document.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getThumbnail in interface IMapServerObjects
Specified by:
getThumbnail in interface IMapServerObjects2
Specified by:
getThumbnail in interface IMapServerObjects3
Returns:
A reference to a com.esri.arcgis.support.ms.stdole.Picture (A com.esri.arcgis.support.ms.stdole.Picture COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

refreshServerObjects

public void refreshServerObjects()
                          throws IOException,
                                 AutomationException
Updates the server info based on the current state of the underlying fine-grained objects.

Remarks

Use RefreshServerObjects when you have made changes to the fine-grained ArcObjects and want to apply them to the MapServer object. Keep in mind that this will change the default state of the MapServer object. In order to get the updated MapDescription, you have to call GetServerInfo on IMapServer2 again.

Any custom graphics (IMapDescription2 or IPageDescription) set previous to the RefreshServerObjects call will be lost. You will need to repeat the code for the custom graphics.

RefreshServerObjects does not refresh the extent on IPageDescription . Therefore, if you have zoomed to a particular extent of the page layout using the fine-grained ArcObjects (IActiveView) and you want to apply this extent to the PageDescription, you have to do this manually.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
refreshServerObjects in interface IMapServerObjects
Specified by:
refreshServerObjects in interface IMapServerObjects2
Specified by:
refreshServerObjects in interface IMapServerObjects3
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

applyMapDescription

public void applyMapDescription(IMapDescription mapDescription,
                                IImageDisplay mapDisplay)
                         throws IOException,
                                AutomationException
Applies the current state of the map description to the map server object.

Remarks

Use ApplyMapDescription to apply changes made in IMapDescription2 to the map server object. ApplyMapDescription will not apply any custom graphics (IMapDescription2 or IPageDescription) to the map server object. See the following example on how to apply custom graphics to the map server object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
applyMapDescription in interface IMapServerObjects
Specified by:
applyMapDescription in interface IMapServerObjects2
Specified by:
applyMapDescription in interface IMapServerObjects3
Parameters:
mapDescription - A reference to a com.esri.arcgis.carto.IMapDescription (in)
mapDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayerID

public int getLayerID(String mapName,
                      ILayer pLayer)
               throws IOException,
                      AutomationException
The layer specified by the map name and layer ID. If the mapName is blank, the default map (active data frame) will be assumed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLayerID in interface IMapServerObjects2
Specified by:
getLayerID in interface IMapServerObjects3
Parameters:
mapName - The mapName (in)
pLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
Returns:
The iD
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStandaloneTableID

public int getStandaloneTableID(String mapName,
                                ITable pTable)
                         throws IOException,
                                AutomationException
The layer specified by the map name and standalone table ID. If the mapName is blank, the default map (active data frame) will be assumed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getStandaloneTableID in interface IMapServerObjects3
Parameters:
mapName - The mapName (in)
pTable - A reference to a com.esri.arcgis.geodatabase.ITable (in)
Returns:
The iD
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStandaloneTable

public ITable getStandaloneTable(String mapName,
                                 int standaloneTableID)
                          throws IOException,
                                 AutomationException
The table specified by the map name and table ID. If the mapName is blank, the default map (active data frame) will be assumed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getStandaloneTable in interface IMapServerObjects3
Parameters:
mapName - The mapName (in)
standaloneTableID - The standaloneTableID (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.ITable
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFeatureValue

public String getFeatureValue(String mapName,
                              int layerID,
                              IFeature feature,
                              String fieldName)
                       throws IOException,
                              AutomationException
Returns the value of a given feature as a string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFeatureValue in interface IMapServerData
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
feature - A reference to a com.esri.arcgis.geodatabase.IFeature (in)
fieldName - The fieldName (in)
Returns:
The fieldValue
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFeature

public IFeature getFeature(String mapName,
                           int layerID,
                           int featureId)
                    throws IOException,
                           AutomationException
Returns a feature, given the feature ID and layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFeature in interface IMapServerData
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
featureId - The featureId (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeature
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDefaultPageDescription

public IPageDescription getDefaultPageDescription()
                                           throws IOException,
                                                  AutomationException
The default page settings.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getDefaultPageDescription in interface IMapServerLayout
Returns:
A reference to a com.esri.arcgis.carto.IPageDescription
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exportLayout

public ILayoutImage exportLayout(IPageDescription pageDesc,
                                 IImageDescription imageDesc)
                          throws IOException,
                                 AutomationException
Generates an image of the layout, based on the given page description object, and writes the image to a specified file on disk. Supported file types are: 'bmp', 'jpg', 'tif', 'png'/'png8', 'png24', 'emf', 'ps', 'pdf', 'ai', 'gif', and 'svg'/'svgz'.

Remarks

Use ExportLayout to retrieve a file (image or vector format) of the map's layout.

PageDescription refers to properties describing the actual map layout. These include the Height and Width of the layout in page Units , the layout page extent in page units, map descriptions for each map frame in the layout and any CustomGraphics to be placed in the layout. Size, resolution and file format are determined by the ImageDescription, which includes ImageDisplay and ImageType .

ExportLayout returns a LayoutImage object. The page Extent of the layout, an array of MapImages (data frames), can be gleaned from this object. In addition, the geographic MapExtent, MapScale and an array of VisibleLayers for each data frame in the layout can be retrieved from the MapImage object.

Do not use IMapServerLayout to create new layouts or to create layouts "on-the-fly". You cannot change the actual page size of the map layout, reposition map elements on the layout nor can you add or remove layout elements such as titles, text, graphics, scale bars, north arrows and legends. However, you can define the size and resolution of the output. How these parameters are defnied can affect the results. These effects are outlined below. You can also choose to export a clipped portion of the page layout.

Let's look at an example. An existing map layout has a portrait page orientation with a height of 11 inches and a width of 8.5 inches. The absolute scale for the map is 1:30,000,000. There are some layers within the map that are scale dependent. This scale is based on the page size of the layout and the relative size of the map's data frame.

You can export the layout to either a vector or an image type. This is specified by the ReturnType property of IImageType.

Exporting to vector format (e.g. PDF)

If you are exporting to a vector format, such as PDF, and want to retain the original size of the layout as specified in the map document the dimensions need not be set. Not specifying a Height and Width for IImageDisplay2, or specifying 0 for both, will cause the export result to maintain the original size of the layout as specified in the source map document. The Height and Width properties of IImageResult are read-only and are not used to make changes.

The the best results it is recommended that you do not specify Height or Width in the ImageDisplay. Let the page size set in the source map determine the size of our output.

If you have a raster layer in your map, or the map has transparency, you may want to increase the DeviceResolution set in IImageDisplay for better results. The map scale and layer visibility should not be affected. The size of ExportLayout result should be adjusted using the height and width properties of the ImageDisplay. You can increase or decrease the relative size of the map layout. Remember, you are not changing the size of the layout of the source map. You are changing the size of the exported result.

For example, you wish to reduce the image of the 11 inch by 8.5 inch layout described above by half. The DeviceResolution is set at 96. You will need to specify a height of 528 and a width of 408. Please note that the map scale does not change. The absolute scale of the map will be incorrect, though the scale bar should be correct since its size changes relative to the change in output size. This effect is similar to shrinking a printed map using a photocopying machine. The result will be 5.5 inches by 4.25 inches PDF.

Once you specify the height and width the value of the DeviceResolution will have an impact on the result. Think of 96 as a baseline for the layout's page (1 inch = 96 pixels). Values different from 96 will require appropriate adjustments in height and width. Using the example above, if the DeviceResolution was 300, the height and width needed to reduce the resulting layout to a PDF of 5.5 inches by 4.25 inches would be 1650 pixels by 1275 pixels.

Changing the aspect ratio (height x width) of the ExportLayout output will not change the aspect ratio of the map layout. For example, again using the layout example above, a height of 816 and a width of 1056 pixels are specified. This will not change the orientation of the page layout from portrait to landscape. Instead, the original portrait orientation of the layout will be maintained and will be fitted into the 816 x 1056 space. This will result in white space on either side of the layout.

Exporting to image format (e.g. JPG)

You can change the size of results using the height and width properties of IImageDisplay. For example, you wish to reduce the image of the 11 by 8.5 layout described above by half. You specify a height of 528 and a width of 408 for the image result. Please note that the map scale does not change. Remember, it is the output size of the image result that is being adjusted. Therefore, the absolute scale of the map will be incorrect, though the scale bar should be correct since its size changes relative to the change in output size. This effect is similar to shrinking or enlarging a printed map using a photocopying machine. When specifying a height and width for a raster format, the value set for DeviceResolution will have no affect on the result.

If you do not specify height or width (or use 0) the size of the image file will be a function of the DeviceResolution and the size of the layout page (where 1 inch = 96 pixels). For example, you specify a DeviceResolution of 96 for the above layout the result will be an image of 1056 pixels by 816 pixels. Increasing the DeviceResolution will increase the size of the output. For example, setting the DeviceResolution to 300 will result in an image of 3300 pixels by 2550 pixels.

Changing the aspect ratio (height x width) of the ExportLayout output will not change the aspect ratio of the map layout. For example, again using the layout example above, a height of 816 and a width of 1056 pixels are specified. This will not change the orientation of the page layout from portrait to landscape. Instead, the original portrait orientation of the layout will be maintained and will be fitted into the 816 x 1056 space. This will result in white space on either side of the layout.

In order to control the size of an exported image, IMapServerInit2 contains two properties: MaxImageHeight and MaxImageWidth. The default value for these properties is 1024 pixels.

Miscellaneous

If you wish to export a portion of the page layout use Extent on IPageDescription. The extent is in the page units of the map document.

Page space is an important component of ExportLayout. It exists for all map documents and the map services the documents are based on. This page space provides the default size of the exported layout (for best results you should use this default). Page space does not figure in ExportMapImage. Therefore, you will see differences in results when adjusting the Height, Width or DeviceResolution for a ExportLayout as compared to making similar adjustments for ExportMapImage.

Another important thing to consider when authoring a layout to be used with IMapServerLayout is to uncheck the "Use Printer Paper Settings" checkbox on the Page and Print Setup dialog in ArcMap before saving the map. Otherwise, the page setup may be dependent on a printer unavailable to the server or users. This may result in a rescaling of the map and unexpected results.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
exportLayout in interface IMapServerLayout
Parameters:
pageDesc - A reference to a com.esri.arcgis.carto.IPageDescription (in)
imageDesc - A reference to a com.esri.arcgis.carto.IImageDescription (in)
Returns:
A reference to a com.esri.arcgis.carto.ILayoutImage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exportLegend

public IImageResult exportLegend(ILegend legend,
                                 IMapDescription mapDesc,
                                 IImageDisplay pMapDisplay,
                                 IColor backgroundColor,
                                 IImageDescription imageDesc)
                          throws IOException,
                                 AutomationException
Exports a legend to an image file. The client can create the legend object and set its desired properties appropriately. If legend is Nothing/Null, a default legend will be generated.

Remarks

Use ExportLegend to export a single image representing the map's legend. Use the input parameter ILegend to access the Legend object in order to customize the legend. If the MapDescription parameter is Nothing/Null the default map description is used. Use TransparentColor in IImageDisplay2 if you want the background to be transparent. Size, resolution and file format are determined by the ImageDescription object, which includes ImageDisplay and ImageType. ExportLegend results in an ImageResult object.

An ExportLegend result displays all visible layers in the map (default).

The default size of a legend is based on the number of layers, symbol size and length of label or description text. This size is likely to vary from map to map.

To best manage the size of the ExportLegend request keep either the width or the height set in ImageDisplay constant. This ImageDisplay object is part of the imageDesc parameter. Don't confuse this ImageDisplay object with the one that refers to the map (MapDisplay).

In order to ensure a constant size do not specify a height and width, or set a value of 0 for each, for the ImageDisplay. However, you can enter your own height or width values. For example, set the ImageDisplay width at 150 and set the height at 0. A setting of 0 will calculate a default value for best fit. The actual height value will adjust as the legend changes to accommodate changes in layer visibility. Depending on the symbols and text you have in youir legend, symbol and text size may not be constant as the number of legend items changes such as when you turn on or off map layers. Make sure to provide an adequate size to the legend to accomodate this. Otherwise, parts of the legend may be cut off or the legend may be illegible. You may need to experiment to find an adequate size. Remember, setting 0 for both the height and width will provide the most consistent and accurate results.

To achieve more control over the legend of a MapServer map use the ILegend input parameter or use GetLegendInfo on IMapServer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
exportLegend in interface IMapServerLayout
Parameters:
legend - A reference to a com.esri.arcgis.carto.ILegend (in)
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)
pMapDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
backgroundColor - A reference to a com.esri.arcgis.display.IColor (in)
imageDesc - A reference to a com.esri.arcgis.carto.IImageDescription (in)
Returns:
A reference to a com.esri.arcgis.carto.IImageResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exportScaleBar

public IImageResult exportScaleBar(IScaleBar scalebar,
                                   IMapDescription mapDesc,
                                   IImageDisplay pMapDisplay,
                                   IColor backgroundColor,
                                   IImageDescription imageDesc)
                            throws IOException,
                                   AutomationException
Exports a scale bar to an image file. The client can create the scaleBar object and set its desired properties appropriately. If scaleBar is Nothing/Null, a default scale bar will be generated.

Remarks

Use ExportScaleBar to retrieve the map's scale bar. To customize the scale bar pass in a ScaleBar object. If you pass in Nothing/Null for the input paramter ScaleBar, a default alternating scale bar is drawn. The scale is calculated according to the height and width of the the image (pMapDisplay). This ImageDisplay object refers to the map. Another ImageDisplay object will be used (as part of the imageDesc parameter) that refers to the Scale Bar image. A color background can be set for the ScaleBar swatch by using the backgroundColor parameter. If this is Nothing/Null a white background will be used. Use TransparentColor in IImageDisplay2 if you want the background to be transparent. Size, resolution and file format are determined by ImageDescription, which includes ImageDisplay and ImageType. ExportScaleBar returns an ImageResult object.

Use the height and width properties of IImageDisplay (as part of the imageDesc parameter) to set the proper size of the scalebar. Entering a 0 for either the height or the width for ExportScaleBar output results in an error.


Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
exportScaleBar in interface IMapServer2
Specified by:
exportScaleBar in interface IMapServer3
Specified by:
exportScaleBar in interface IMapServerLayout
Parameters:
scalebar - A reference to a com.esri.arcgis.carto.IScaleBar (in)
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)
pMapDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
backgroundColor - A reference to a com.esri.arcgis.display.IColor (in)
imageDesc - A reference to a com.esri.arcgis.carto.IImageDescription (in)
Returns:
A reference to a com.esri.arcgis.carto.IImageResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exportNorthArrow

public IImageResult exportNorthArrow(INorthArrow arrow,
                                     IMapDescription mapDesc,
                                     IColor backgroundColor,
                                     IImageDescription imageDesc)
                              throws IOException,
                                     AutomationException
Exports a north arrow to an image file. The client can create the arrow object and set its desired properties appropriately. If arrow is Nothing/Null, a default north arrow will be generated.

Remarks

Use ExportNorthArrow to export the map's north arrow. To customize the north arrow (e.g. size) or to change the type of north arrow marker pass in a NorthArrow object. If you pass in Nothing/Null for this input parameter, a standard north arrow is drawn. A color background can be set for the North Arrow swatch by using the backgroundColor parameter. If this is Nothing/Null a white background will be used. Use TransparentColor in IImageDisplay2 if you want the background to be transparent. Size, resolution and file format are determined by ImageDescription, which includes ImageDisplay and ImageType. ExportNorthArrow results in an ImageResult object.

The orientation of the NorthArrow is determined by the MapRotation property on IMapDescription.

ExportNorthArrow output does not require a size. A default size is calculated based on the size of the NorthArrowMarker symbol. Setting 0 for both the height and the width property of IImageDisplay for ExportNorthArrow output results in a default size that best fits the NorthArrowMarker symbol.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
exportNorthArrow in interface IMapServerLayout
Parameters:
arrow - A reference to a com.esri.arcgis.carto.INorthArrow (in)
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)
backgroundColor - A reference to a com.esri.arcgis.display.IColor (in)
imageDesc - A reference to a com.esri.arcgis.carto.IImageDescription (in)
Returns:
A reference to a com.esri.arcgis.carto.IImageResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

toPagePoints

public IPointCollection toPagePoints(IEnvelope pageExtent,
                                     IImageDisplay pageDisplay,
                                     ILongArray screenXValues,
                                     ILongArray screenYValues)
                              throws IOException,
                                     AutomationException
Converts a screen location to a page coordinate.

Remarks

Use ToPagePoints to convert pixel coordinates on the screen to page units coordinates on the layout.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
toPagePoints in interface IMapServerLayout
Parameters:
pageExtent - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
pageDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
screenXValues - A reference to a com.esri.arcgis.system.ILongArray (in)
screenYValues - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.geometry.IPointCollection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

fromPagePoints

public void fromPagePoints(IEnvelope pageExtent,
                           IImageDisplay pageDisplay,
                           IPointCollection pagePoints,
                           ILongArray[] screenXValues,
                           ILongArray[] screenYValues)
                    throws IOException,
                           AutomationException
Converts a page coordinate to a screen location.

Remarks

Use FromPagePoints to convert page unit coordinates on the layout to pixel coordinates on the screen.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
fromPagePoints in interface IMapServerLayout
Parameters:
pageExtent - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
pageDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
pagePoints - A reference to a com.esri.arcgis.geometry.IPointCollection (in)
screenXValues - A reference to a com.esri.arcgis.system.ILongArray (in/out: use single element array)
screenYValues - A reference to a com.esri.arcgis.system.ILongArray (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

connect

public void connect(String filePath)
             throws IOException,
                    AutomationException
Initializes the map server with an mxd or pmf file stored at the specified path. The path must be accessible to the server machine.

Remarks

Initializing a map server with an MSD file with this method is not supported.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
connect in interface IMapServerInit
Parameters:
filePath - The filePath (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startWithData

public void startWithData(IDataset pDataset)
                   throws IOException,
                          AutomationException
An alternative to calling Connect(). This method synthesizes a map document with a single layer based on the given IDataset object and initializes the map server for processing.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
startWithData in interface IMapServerInit
Parameters:
pDataset - A reference to a com.esri.arcgis.geodatabase.IDataset (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

stop

public void stop()
          throws IOException,
                 AutomationException
Clears out all of the map objects in memory. The client must call one of the Start methods again before attempting any other operations.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
stop in interface IMapServerInit
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPhysicalOutputDirectory

public void setPhysicalOutputDirectory(String dirPath)
                                throws IOException,
                                       AutomationException
The physical directory for output files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setPhysicalOutputDirectory in interface IMapServerInit
Parameters:
dirPath - The dirPath (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPhysicalOutputDirectory

public String getPhysicalOutputDirectory()
                                  throws IOException,
                                         AutomationException
The physical directory for output files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPhysicalOutputDirectory in interface IMapServerInit
Returns:
The dirPath
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setVirtualOutputDirectory

public void setVirtualOutputDirectory(String dirPath)
                               throws IOException,
                                      AutomationException
The virtual directory for output files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setVirtualOutputDirectory in interface IMapServerInit
Parameters:
dirPath - The dirPath (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getVirtualOutputDirectory

public String getVirtualOutputDirectory()
                                 throws IOException,
                                        AutomationException
The virtual directory for output files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getVirtualOutputDirectory in interface IMapServerInit
Returns:
The dirPath
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFilePath

public String getFilePath()
                   throws IOException,
                          AutomationException
The map document path.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFilePath in interface IMapServerInit
Returns:
The filePath
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMaxRecordCount

public int getMaxRecordCount()
                      throws IOException,
                             AutomationException
The maximum number of records returned for query results (Identify, Find, QueryFeatureData, and QueryHyperlinks).

Remarks

In order to control the amount of information MapServer needs to process for a query, a maximum number of records can be set. This value is contained in the MaxRecordCount property. The default value for this property is 500. If 600 features match a given query only the first 500 results will be returned. You will be unable to access the remaining 100 records. To be able to access these records the MaxRecordCount would need to be increased to 600. MaxRecordCount affects the following IMapServer methods: Find, Identify, QueryFeatureData, QueryFeatureData2, QueryHyperlinks, and QueryHyperlinks2. It does not affect QueryFeatureCount, QueryFeatureIDs or the number of Rows of a MapServerRelationship. The MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMaxRecordCount in interface IMapServerInit
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMaxRecordCount

public void setMaxRecordCount(int count)
                       throws IOException,
                              AutomationException
The maximum number of records returned for query results (Identify, Find, QueryFeatureData, and QueryHyperlinks).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setMaxRecordCount in interface IMapServerInit
Parameters:
count - The count (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMaxBufferCount

public int getMaxBufferCount()
                      throws IOException,
                             AutomationException
The maximum number of records buffered on the server for display.

Remarks

In order to control the amount of information MapServer needs to process for a buffer, a maximum number of records to be buffered can be set. This value is contained in the MaxBufferCount property. The default value for this property is 100. If the number of features to be buffered exceeds MaxBufferCount no features will be buffered. The MaxBufferCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMaxBufferCount in interface IMapServerInit
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMaxBufferCount

public void setMaxBufferCount(int count)
                       throws IOException,
                              AutomationException
The maximum number of records buffered on the server for display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setMaxBufferCount in interface IMapServerInit
Parameters:
count - The count (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMaxImageWidth

public int getMaxImageWidth()
                     throws IOException,
                            AutomationException
The maximum width in pixels of an image request.

Remarks

In order to control the size of an exported map image, IMapServerInit contains two properties: MaxImageHeight and MaxImageWidth. The default value for these properties is 2048 pixels. The MaxImageHeight can also be changed by modifying the MaxImageHeight XML tag in the MapServer's configuration file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMaxImageWidth in interface IMapServerInit
Returns:
The width
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMaxImageWidth

public void setMaxImageWidth(int width)
                      throws IOException,
                             AutomationException
The maximum width in pixels of an image request.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setMaxImageWidth in interface IMapServerInit
Parameters:
width - The width (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMaxImageHeight

public int getMaxImageHeight()
                      throws IOException,
                             AutomationException
The maximum height in pixels of an image request.

Remarks

In order to control the size of an exported map image, IMapServerInit contains two properties: MaxImageHeight and MaxImageWidth. The default value for these properties is 2048 pixels. The MaxImageHeight can also be changed by modifying the MaxImageHeight XML tag in the MapServer's configuration file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMaxImageHeight in interface IMapServerInit
Returns:
The height
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMaxImageHeight

public void setMaxImageHeight(int height)
                       throws IOException,
                              AutomationException
The maximum height in pixels of an image request.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setMaxImageHeight in interface IMapServerInit
Parameters:
height - The height (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPhysicalCacheDirectory

public void setPhysicalCacheDirectory(String pCacheDir)
                               throws IOException,
                                      AutomationException
The physical directory for cache files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setPhysicalCacheDirectory in interface IMapServerInit2
Parameters:
pCacheDir - The pCacheDir (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPhysicalCacheDirectory

public String getPhysicalCacheDirectory()
                                 throws IOException,
                                        AutomationException
The physical directory for cache files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getPhysicalCacheDirectory in interface IMapServerInit2
Returns:
The pCacheDir
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setVirtualCacheDirectory

public void setVirtualCacheDirectory(String pVirtualCacheDir)
                              throws IOException,
                                     AutomationException
The virtual directory for cache files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setVirtualCacheDirectory in interface IMapServerInit2
Parameters:
pVirtualCacheDir - The pVirtualCacheDir (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getVirtualCacheDirectory

public String getVirtualCacheDirectory()
                                throws IOException,
                                       AutomationException
The virtual directory for cache files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getVirtualCacheDirectory in interface IMapServerInit2
Returns:
The pVirtualCacheDir
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSOMCacheDirectory

public void setSOMCacheDirectory(String pCacheDir)
                          throws IOException,
                                 AutomationException
The parent directory for cache files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setSOMCacheDirectory in interface IMapServerInit2
Parameters:
pCacheDir - The pCacheDir (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSOMCacheDirectory

public String getSOMCacheDirectory()
                            throws IOException,
                                   AutomationException
The parent directory for cache files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getSOMCacheDirectory in interface IMapServerInit2
Returns:
The pCacheDir
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSOMVirtualCacheDirectory

public String getSOMVirtualCacheDirectory()
                                   throws IOException,
                                          AutomationException
The parent virtual directory for cache files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getSOMVirtualCacheDirectory in interface IMapServerInit2
Returns:
The pParentVirtualCacheDir
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

activate

public void activate()
              throws IOException,
                     AutomationException
Activates the object.

Specified by:
activate in interface IObjectActivate
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deactivate

public void deactivate()
                throws IOException,
                       AutomationException
Deactivates the object.

Specified by:
deactivate in interface IObjectActivate
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

update

public void update(IPropertySet props)
            throws IOException,
                   AutomationException
Updates object's properties.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
update in interface IObjectUpdate
Parameters:
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initLogging

public void initLogging(ILog log)
                 throws IOException,
                        AutomationException
Initializes an object with a log.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
initLogging in interface ILogSupport
Parameters:
log - A reference to a com.esri.arcgis.system.ILog (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConfigurationName

public String getConfigurationName()
                            throws IOException,
                                   AutomationException
Name of the server object configuration that defines the server object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getConfigurationName in interface IServerObject
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTypeName

public String getTypeName()
                   throws IOException,
                          AutomationException
Type of the server object (MapServer or GeocodeServer).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getTypeName in interface IServerObject
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findExtensionByCLSID

public IServerObjectExtension findExtensionByCLSID(String cLSID)
                                            throws IOException,
                                                   AutomationException
Returns a server object extension found using a string representation of its class ID.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
findExtensionByCLSID in interface IServerObjectExtensionManager
Parameters:
cLSID - The cLSID (in)
Returns:
A reference to a com.esri.arcgis.server.IServerObjectExtension
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findExtensionByTypeName

public IServerObjectExtension findExtensionByTypeName(String name)
                                               throws IOException,
                                                      AutomationException
Returns a server object extension found using its type name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
findExtensionByTypeName in interface IServerObjectExtensionManager
Parameters:
name - The name (in)
Returns:
A reference to a com.esri.arcgis.server.IServerObjectExtension
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryFeatureCount2

public int queryFeatureCount2(String mapName,
                              ILayerDescription pLayerDescription,
                              IQueryFilter filter)
                       throws IOException,
                              AutomationException
Returns the count of the features that meet the query filter selection criteria for the specified layer.

Remarks

QueryFeatureCount2 returns the number of map features that match the parameters of a given query filter.

QueryFeatureCount2 requires a number of input parameters. These include: a MapName, LayerDescription and a QueryFilter. The QueryFilter can be an attribute query (SQL espression), a spatial query, or a combination of both.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression) a spatial filter, or a combination of both. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the sytax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

DefinitionExpressions

A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be also be set in the source map document as a definition query. Any DefinitionExpression set in the LayerDescription will override any definition query set in the source map. MapServer QueryFeatureCount2 honors DefinitionExpression.

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. Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be a count of all sale region features that fall within the North region and are managed by Bob.

Example #2: In the source map the layer has a definition query, "REGION = 'North'". You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be a count of all sale region features with sales over 1000 and are managed by Bob. QueryFeatureCount2 honors the DefinitionExpression set in LayerDescription. The DefinitionExpression overrides the definition query set in the source map. If you wish to include the layer's original defintion query, "REGION = 'North'" in your final query, you must include this in your QueryFilter, ""MANAGER = 'Bob' AND "REGION = 'North'".

Example #3: In the source map the layer has no definition query. You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be a count of all sale region features with sales over 1000 and are managed by Bob. QueryFeatureCount2 honors the DefinitionExpression set in LayerDescription.

Miscellaneous

MaxRecordCount does not affect QueryFeatureCount or QueryFeatureCount2.

There are two key differences between Find and QueryFeatureCount2. The first is that Find can work on multiple layers while the query methods work with a single layer. The second is that Find only works with a search string. The query methods use a queryFilter as a parameter. This allows the query to be based on either an attribute filter (SQL expression) or a spatial filter.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryFeatureCount2 in interface IMapServer2
Specified by:
queryFeatureCount2 in interface IMapServer3
Parameters:
mapName - The mapName (in)
pLayerDescription - A reference to a com.esri.arcgis.carto.ILayerDescription (in)
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryFeatureIDs2

public IFIDSet queryFeatureIDs2(String mapName,
                                ILayerDescription pLayerDesciscription,
                                IQueryFilter filter)
                         throws IOException,
                                AutomationException
Returns the IDs of the features that meet the query filter selection criteria for the specified layer.

Remarks

QueryFeatureIDs2 returns the IDs (FIDSet) of map features that match the parameters of a given query filter.

QueryFeatureIDs2 requires a number of input parameters. These include: a MapName, LayerID, and a QueryFilter. The QueryFilter can be an attribute query (SQL espression), a spatial query, or a combination of both.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression) a spatial filter, or a combination of both. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the sytax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

DefinitionExpressions

A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be also be set in the source map document as a definition query. Any DefinitionExpression set in the LayerDescription will override any definition query set in the source map. MapServer QueryFeatureIDs2 honors DefinitionExpression.

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. Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be the ids of all sale region features that fall within the North region and are managed by Bob.

Example #2: In the source map the layer has a definition query, "REGION = 'North'". You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be the ids of all sale region features with sales over 1000 and are managed by Bob. QueryFeatureIDs2 honors the DefinitionExpression set in LayerDescription. The DefinitionExpression overrides the definition query set in the source map. If you wish to include the layer's original defintion query, "REGION = 'North'" in your final query, you must include this in your QueryFilter, ""MANAGER = 'Bob' AND "REGION = 'North'".

Example #3: In the source map the layer has no definition query. You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be the ids of all sale region features with sales over 1000 and are managed by Bob. QueryFeatureIDs2 honors the DefinitionExpression set in LayerDescription.

Miscellaneous

MaxRecordCount does not affect QueryFeatureIDs or QueryFeatureIDs2.

There are two key differences between Find and QueryFeatureIDs2. The first is that Find can work on multiple layers while the query methods work with a single layer. The second is that Find only works with a search string. The query methods use a queryFilter as a parameter. This allows the query to be based on either an attribute filter (SQL expression) or a spatial filter.

The results of this function can be used with LayerDescription::SelectionFeatures to display the selection in the exported image.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryFeatureIDs2 in interface IMapServer2
Specified by:
queryFeatureIDs2 in interface IMapServer3
Parameters:
mapName - The mapName (in)
pLayerDesciscription - A reference to a com.esri.arcgis.carto.ILayerDescription (in)
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFIDSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryFeatureData2

public IQueryResult queryFeatureData2(String mapName,
                                      ILayerDescription pLayerDesciscription,
                                      IQueryFilter filter,
                                      IQueryResultOptions options)
                               throws IOException,
                                      AutomationException
Returns a record set of features that meet the query filter selection criteria for the specified layer.

Remarks

QueryFeatureData2 returns the records of map features that match the parameters of a given query filter. QueryFeatureData2 returns a QueryResult. A QueryResult format can be either KML or a RecordSet. The Format of the QueryResult is specified in QueryResultOptions. QueryResultOptions can also be used to specify a GeoTransformation if one is needed.

QueryFeatureData2 requires a number of input parameters. These include: a Name, LayerDescription and a QueryFilter. The QueryFilter can be an attribute query (SQL espression), a spatial query, a combination of both or null. ILayerDescription2 has SourceID property that can be used to query against a GP result.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression) a spatial filter, or a combination of both. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the sytax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

It can be set to null or Nothing to retrieve all data (which is also limited by MaxRecordCount)

If geometry is not desired in the output RecordSet, IQuerFilter’s SubFields must be defined without ‘Shape’ field. When SubFields is empty or includes ‘Shape’, IRecordSet will include the fields "shape_length" and "shape_area". If the desired spatial reference of the output geometry is different than the original one, OutputSpatialReference should be used. Otherwise geometry is returned in the same spatial reference system as the DefaultMapDescription by default. When SubFields is not defined or = “*”, it returns all visible fields. Invisible or invalid field names or field aliases must not be included in SubField’s string or it will return an error. Please note ObjectID field is always returned regardless of whether it is in the SubFields or not. Only expection is when DISTINCT is used.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

DefinitionExpressions

A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be also be set in the source map document as a definition query. Any DefinitionExpression set in the LayerDescription will override any definition query set in the source map. MapServer QueryFeatureData2 honors DefinitionExpression.

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. Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be all sale region features that fall within the North region and are managed by Bob.

Example #2: In the source map the layer has a definition query, "REGION = 'North'". You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be all sale region features with sales over 1000 and are managed by Bob. QueryFeatureData2 honors the DefinitionExpression set in LayerDescription. The DefinitionExpression overrides the definition query set in the source map. If you wish to include the layer's original defintion query, "REGION = 'North'" in your final query, you must include this in your QueryFilter, ""MANAGER = 'Bob' AND "REGION = 'North'".

Example #3: In the source map the layer has no definition query. You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be all sale region features with sales over 1000 and are managed by Bob. QueryFeatureData2 honors the DefinitionExpression set in LayerDescription.

Results

The result can be returned in two formats: KML and RecordSet.

KML
When KML is the desired output, it is passed back as a URL (when QueryResultFormat is esriQueryResultKMLAsURL) or as a MIME object (when QueryResultFormat is esriQueryResultKMLAsMime). The file or Mime is returned in compressed KMZ format.

Setting LayerResultOptions has no effect on KML output.

RecordSet
When esriQueryResultRecordSetAsObject is selected as QueryResultFormat, the function returns RecordSet as an Object. Use IQueryResult::Object property to access that. The returned object needs to be QI to IRecordSet.

QueryFeatureData2 honors field visibility set in the source map document. Field aliases, set in the source map document, are honored only when the connection to an ArcGIS Server is made using ArcGIS Server Client API (GISClient library ) or using SOAP/WSDL, but not honored for DCOM connection. However, the RecordSet does NOT honor any field formatting set in the source map.

Result Geometry

By default, geometry is returned in the same spatial reference as the DefaultMapDescription. The spatial reference of QueryFeatureData2 results can be set to something different than the DefaultMapDescription by using OutputSpatialReference. OutputSpatialReference is a property of IQueryFilter. For SOAP/WSDL users, both OutputSpatialReference & SpatialReferenceFieldName properties are required and must be set.

In some instances the result may require a GeoTransformation . For example, a given map service may be using a spatial reference system based on GCS_WGS_1984. A client wants to display QueryFeatureData2 results based on this map service in a different spatial reference, GCS_European_1950. The results will use the spatial reference of the DefaultMapDescription, GCS_WGS_1984, and display these results incorrectly in GCS_European_1950. Features may not "line up" correctly. In order to correctly display these results a GeoTransformation is needed. Applying the correct GeoTransformation ensures the spatial correctness of the result.

Another instance where a GeoTransformation may be need to be specified in the QueryResultsOption is if the queried layer is projected on the fly within the map service. That is, the coordinate system of the layer's source is different than the DefaultMapDescription coordinate system, and no appropriate transformation has been set in the map document before serving. In this case, you can access the coordinate system of a layer source by first getting the layer's MapLayerInfo, then get Fields from MapLayerInfo, get the Shape Field from Fields, get GeometryDef from Field, and finally, get the SpatialReference from GeometryDef.

A GeoTransformation is not needed if the projected coordinate systems share the same underlying geographic coordinate system. For best results it is optimal for data (layers within the map service), map service and MapServer output to use the same coordinate system.

In some cases, may be for performance reasons, you may want limit or adjust the geometry being returned in the record set result. Use ILayerResultOptions to manage this. If IncludeGeometry is set to False, geometry is not included in the recordset. This should increase performance in cases where feature geometry is large. You can also choose to densify or generalize the returned geometry by using GeometryResultOptions. Densification is used to better support clients that do not support Arcs (e.g. Bezier, Circular etc.). Generalization reduces the amount of geography being sent across the network and should lead to better performance.

Field visibility and field aliases

QueryFeatureData2 honors field visibility set in the source map document. Field aliases, set in the source map document, are honored only when the connection to an ArcGIS Server is made using ArcGIS Server Client API (GISClient library ) or using SOAP/WSDL, but not honored for DCOM connection. However, the RecordSet does NOT honor any field formatting set in the source map.

Miscellaneous

In order to control the amount of information MapServer needs to process for a query, a maximum number of records can be set. This value is contained in the MaxRecordCount property on IMapServerInit2. The default value for this property is 500. If 600 features match a given query only the first 500 results will be returned. You will be unable to access the remaining 100 records. To be able to access these records the MaxRecordCount would need to be increased to 600. MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

There are two key differences between Find and QueryFeatureData2. The first is that Find can work on multiple layers while the query methods work with a single layer. The second is that Find only works with a search string. The query methods use a queryFilter as a parameter. This allows the query to be based on either an attribute filter (SQL expression) or a spatial filter.

Precedence. In case where both IQueryFilter::SubField and ILayerResultOption::IncludeGeometry is set, SubField takes precedence over IncludeGeometry. For example, when SubField = “Shape, FName, LName, Address” and IncludeGeometry = False, the output recordset will contain geometry as contained within the Shape field.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryFeatureData2 in interface IMapServer2
Specified by:
queryFeatureData2 in interface IMapServer3
Parameters:
mapName - The mapName (in)
pLayerDesciscription - A reference to a com.esri.arcgis.carto.ILayerDescription (in)
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
options - A reference to a com.esri.arcgis.carto.IQueryResultOptions (in)
Returns:
A reference to a com.esri.arcgis.carto.IQueryResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServiceConfigurationInfo

public IPropertySet getServiceConfigurationInfo()
                                         throws IOException,
                                                AutomationException
A set of name-value pairs for properties set for the MapServer Service Configuration Restrictions.

Remarks

Use ServiceConfigurationInfo to get restrictions set for a map service by the publisher that are stored in map service configuration file (.cfg). This property returns a PropertySet. This PropertySet includes: MaximumRecordCount, MaximumBufferCount, MaximumImageWidth, MaximumImageHeight and SupportedImageFormatTypes .

Image formats supported by optimized MapServices are “PNG32, PNG24, PNG, JPG, DIB, TIFF , EMF, PS, PDF, GIF, SVG, SVGZ” and by standard MapServices are “PNG24, PNG, JPG, DIB, TIFF, EMF, PS, PDF, GIF, SVG, SVGZ, AI”.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getServiceConfigurationInfo in interface IMapServer2
Specified by:
getServiceConfigurationInfo in interface IMapServer3
Returns:
A reference to a com.esri.arcgis.system.IPropertySet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryData

public IQueryResult queryData(String mapName,
                              IMapTableDescription pMapTableDescription,
                              IQueryFilter filter,
                              IQueryResultOptions options)
                       throws IOException,
                              AutomationException
Returns a record set of rows that meet the query filter selection criteria for the specified table.

Remarks

QueryData returns the records of map features from a layer or of rows from a table that match the parameters of a given query filter. QueryData returns a QueryResult. A QueryResult format can be a RecordSet, a KMZ, JSON or AMF. The Format of the QueryResult is specified in QueryResultOptions. QueryResultOptions can also be used to specify a GeoTransformation if one is needed.

QueryData requires a number of input parameters. These include: a MapName, IMapTableDescription and a IQueryFilter. The QueryFilter can be an attribute query (SQL espression), a spatial query, a time query, a combination of all or null. ILayerDescription2 has SourceID property that can be used to query against a GP result.

LayerDescription for a layer can be obtained from MapServerInfo::DefaultMapDescription while StandaloneTableDescription can be obtained using MapServerInfo::StandaloneTableDescriptions property.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression), a spatial filter, time filter, a combination of both or null. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the syntax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

It can be set to null or Nothing to retrieve all data (which is also limited by MaxRecordCount)

If geometry is not desired in the output RecordSet, IQuerFilter’s SubFields must be defined without ‘Shape’ field. When SubFields is empty or includes ‘Shape’, IRecordSet will include the fields "shape_length" and "shape_area". If the desired spatial reference of the output geometry is different than the original one, OutputSpatialReference should be used. Otherwise geometry is returned in the same spatial reference system as the DefaultMapDescription by default.

When SubFields is not defined or = “*”, it returns all visible fields. Invisible or invalid field names or field aliases must not be included in SubField’s string or it will return an error. You may get the list of all visible fields from IMapTableInfo::Fields. Please note ObjectID field is always returned regardless of whether it is in the SubFields or not. Only expection is when DISTINCT is used.

When only the unique value from a field is desired, you need to set PrefixClause = "DISTINCT". In case when you want the result sorted by field(s), set ORDER BY <field1, field2,...> to PostfixClause. Please note these options will only be honored when the source database supports that such as ArcSDE GeoDatabase, File GeoDatabase and Personal GeoDatabase. ORDER BY is not supported on a field from a joined table.

Note: MapServer query function does not support raster data. You should avoid including raster field from SubFields.

TimeQueryFilter

When a layer is time aware (use IMapTableTimeInfo::SupportsTime property), a query can be made to retrieve a set of features that are available at a specific time or for a period of time. In order to perform a time query, TimeQueryFilter object needs to created and passed in to this function. Since the object implements IQueryFilter and ISpatialFilter interfaces, an attribute or spatial query can be combined with time.

Values in StartTimeField or EndTimeField are returned in the Layer's TimeReference. If the desired time reference is different than the layer's one, OutputTimeReference should be explicitly set.

SearchShape

It is only required for spatial query. Since a table does not contain geometry, SearchShape is ignored when a table is queried. Geometry set in SpatialFilter should meet the following criteria:

DefinitionExpressions

A DefinitionExpression can be set on a layer or a standalone table in order to limit layer features or rows available for display or query. This expression can be also be set in the source map document as a definition query. Any DefinitionExpression set in the LayerDescription or StandaloneTableDescription will override any definition query set in the source map. MapServer QueryData honors DefinitionExpression.
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 DefinitionExpression is specified in LayerDescription. Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be all sale region features that fall within the North region and are managed by Bob.

Example #2: In the source map the layer has a definition query, "REGION = 'North'". You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be all sale region features with sales over 1000 and are managed by Bob. QueryData honors the DefinitionExpression set in LayerDescription. The DefinitionExpression overrides the definition query set in the source map. If you wish to include the layer's original definition query, "REGION = 'North'" in your final query, you must include this in your QueryFilter, ""MANAGER = 'Bob' AND "REGION = 'North'".

Example #3: In the source map the layer has no definition query. You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be all sale region features with sales over 1000 and are managed by Bob. QueryData honors the DefinitionExpression set in LayerDescription.

Results

For KML (Keyhole Markup Language), JSON (JavaScript Object Notation) or AMF (Action Message Format), result can be passed back as a URL (when QueryResultOptions.Format is esriQueryResultKMLAsURL) or as a MIME object (when QueryResultOptions.Format is esriQueryResultKMLAsMime).

KML is returned in compressed KMZ format. Setting LayerResultOptions has no effect on KML output.

RecordSet
When esriQueryResultRecordSetAsObject is selected as QueryResultFormat, the function returns RecordSet as an Object. Use IQueryResult::Object property to access that. The returned object needs to be QI to IRecordSet.

Result Geometry

By default, geometry is returned in the same spatial reference as the DefaultMapDescription. The spatial reference of QueryFeatureData2 results can be set to something different than the DefaultMapDescription by using OutputSpatialReference. OutputSpatialReference is a property of IQueryFilter. For SOAP/WSDL users, both OutputSpatialReference & SpatialReferenceFieldName properties are required and must be set.

In some instances the result may require a GeoTransformation . For example, a given map service may be using a spatial reference system based on GCS_WGS_1984. A client wants to display QueryFeatureData2 results based on this map service in a different spatial reference, GCS_European_1950. The results will use the spatial reference of the DefaultMapDescription, GCS_WGS_1984, and display these results incorrectly in GCS_European_1950. Features may not "line up" correctly. In order to correctly display these results a GeoTransformation is needed. Applying the correct GeoTransformation ensures the spatial correctness of the result.

Another instance where a GeoTransformation may be need to be specified in the QueryResultsOption is if the queried layer is projected on the fly within the map service. That is, the coordinate system of the layer's source is different than the DefaultMapDescription coordinate system, and no appropriate transformation has been set in the map document before serving. In this case, you can access the coordinate system of a layer source by first getting the layer's MapLayerInfo, then get Fields from MapLayerInfo, get the Shape Field from Fields, get GeometryDef from Field, and finally, get the SpatialReference from GeometryDef.

A GeoTransformation is not needed if the projected coordinate systems share the same underlying geographic coordinate system. For best results it is optimal for data (layers within the map service), map service and MapServer output to use the same coordinate system.

In some cases, may be for performance reasons, you may want limit or adjust the geometry being returned in the record set result. Use ILayerResultOptions to manage this. If IncludeGeometry is set to False, geometry is not included in the recordset. This should increase performance in cases where feature geometry is large. You can also choose to densify or generalize the returned geometry by using GeometryResultOptions. Densification is used to better support clients that do not support Arcs (e.g. Bezier, Circular etc.). Generalization reduces the amount of geography being sent across the network and should lead to better performance.

Field visibility and field aliases

QueryData honors field visibility set in the source map document. Field aliases, set in the source map document, are honored only when the connection to an ArcGIS Server is made using ArcGIS Server Client API (GISClient library ) or using SOAP/WSDL, but not honored for DCOM connection. However, the RecordSet does NOT honor any field formatting set in the source map.

Miscellaneous

In order to control the amount of information MapServer needs to process for a query, a maximum number of records can be set. This value is contained in the MaxRecordCount property on IMapServerInit2. The default value for this property is 500. If 600 features match a given query only the first 500 results will be returned. You will be unable to access the remaining 100 records. To be able to access these records the MaxRecordCount would need to be increased to 600. MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

There are two key differences between Find and QueryFeatureData2. The first is that Find can work on multiple layers while the query methods work with a single layer. The second is that Find only works with a search string. The query methods use a queryFilter as a parameter. This allows the query to be based on either an attribute filter (SQL expression) or a spatial filter.

The main differences between QueryData & QueryFeatureData are that the former can search both layer and table and honors their settings e.g. DefinitionExpression etc.

Precedence

In case where both IQueryFilter::SubField and ILayerResultOption::IncludeGeometry is set, SubField takes precedence over IncludeGeometry. For example, when SubField = “Shape, FName, LName, Address” and IncludeGeometry = False, the output recordset will contain geometry as contained within the Shape field.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryData in interface IMapServer3
Parameters:
mapName - The mapName (in)
pMapTableDescription - A reference to a com.esri.arcgis.carto.IMapTableDescription (in)
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
options - A reference to a com.esri.arcgis.carto.IQueryResultOptions (in)
Returns:
A reference to a com.esri.arcgis.carto.IQueryResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryRowCount

public int queryRowCount(String mapName,
                         IMapTableDescription pTableDescription,
                         IQueryFilter pFilter)
                  throws IOException,
                         AutomationException
Returns the count of the rows that meet the query filter selection criteria for the specified table.

Remarks

QueryRowCount returns the number of map features from a layer or of row from a table that match the parameters of a given query filter.

QueryRowCount requires a number of input parameters. These include: a MapName, IMapTableDescription and a IQueryFilter.

LayerDescription for a layer can be obtained from MapServerInfo::DefaultMapDescription while StandaloneTableDescription can be obtained using MapServerInfo::StandaloneTableDescriptions property.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression), a spatial filter, time filter, a combination of both or null. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the sytax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

TimeQueryFilter

When a layer is time aware (use IMapTableTimeInfo::SupportsTime property), a query can be made to retrieve a set of features that are available at a specific time or for a period of time. In order to perform a time query, TimeQueryFilter object needs to created and passed in to this function. Since the object implements IQueryFilter and ISpatialFilter interfaces, an attribute or spatial query can be combined with time.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

DefinitionExpressions

A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be also be set in the source map document as a definition query. Any DefinitionExpression set in the LayerDescription will override any definition query set in the source map. MapServer QueryFeatureCount2 honors DefinitionExpression.

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. Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be a count of all sale region features that fall within the North region and are managed by Bob.

Example #2: In the source map the layer has a definition query, "REGION = 'North'". You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be a count of all sale region features with sales over 1000 and are managed by Bob. QueryFeatureCount2 honors the DefinitionExpression set in LayerDescription. The DefinitionExpression overrides the definition query set in the source map. If you wish to include the layer's original defintion query, "REGION = 'North'" in your final query, you must include this in your QueryFilter, ""MANAGER = 'Bob' AND "REGION = 'North'".

Example #3: In the source map the layer has no definition query. You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be a count of all sale region features with sales over 1000 and are managed by Bob. QueryFeatureCount2 honors the DefinitionExpression set in LayerDescription.

Miscellaneous

MaxRecordCount does not affect QueryRowCount.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryRowCount in interface IMapServer3
Parameters:
mapName - The mapName (in)
pTableDescription - A reference to a com.esri.arcgis.carto.IMapTableDescription (in)
pFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Returns:
The pCount
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryRowIDs

public ILongArray queryRowIDs(String mapName,
                              IMapTableDescription pTableDescription,
                              IQueryFilter pFilter)
                       throws IOException,
                              AutomationException
Returns the IDs of the rows that meet the query filter selection criteria for the specified table.

Remarks

QueryRowIDs returns an array of ObjectIDs unlike QueryFeatuerIDs or QueryFeatureIDs2. Each integer represents a unique identifier for each feature (FID) of a layer or row of a table being queried.

Please note quering a table with no ObjectID field (such as Excel, text files etc.) fails. You may want to check OIDFieldName to find out whether the table has ObjectID field.

The key differences between QueryRowIDs and QueryFeatureIDs2 are:

QueryRowIDs requires a number of input parameters. These include: a MapName, IMapTableDescription and a IQueryFilter.

LayerDescription for a layer can be obtained from MapServerInfo::DefaultMapDescription while StandaloneTableDescription can be obtained using MapServerInfo::StandaloneTableDescriptions property.

QueryFilter

QueryFilter provides the ability to query based on attribute filter (SQL expression), a spatial filter, time filter, a combination of both or null. Attribute filters take any valid ‘non-GIS data specific’ SQL statement. For example, CNTRY_CODE = ‘BD’ or POPULATION = 12345. Syntax for querying date fields depend on the underlying data. If you are working with Shapefile or File GeoDatabase data the syntax is <FieldName> = date ‘YYYY-MM-DD’; for Access-based Personal GeoDatabase the sytax is #YYYY-MM-DD#. For SDE database, check with the specific database’s help.

TimeQueryFilter

When a layer is time aware (use IMapTableTimeInfo::SupportsTime property), a query can be made to retrieve a set of features that are available at a specific time or for a period of time. In order to perform a time query, TimeQueryFilter object needs to created and passed in to this function. Since the object implements IQueryFilter and ISpatialFilter interfaces, an attribute or spatial query can be combined with time.

SearchShape

Geometry set in ISpatialFilter should meet the following criteria:

DefinitionExpressions

A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be also be set in the source map document as a definition query. Any DefinitionExpression set in the LayerDescription will override any definition query set in the source map. MapServer QueryFeatureIDs2 honors DefinitionExpression.

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. Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be the ids of all sale region features that fall within the North region and are managed by Bob.

Example #2: In the source map the layer has a definition query, "REGION = 'North'". You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be the ids of all sale region features with sales over 1000 and are managed by Bob. QueryFeatureIDs2 honors the DefinitionExpression set in LayerDescription. The DefinitionExpression overrides the definition query set in the source map. If you wish to include the layer's original defintion query, "REGION = 'North'" in your final query, you must include this in your QueryFilter, ""MANAGER = 'Bob' AND "REGION = 'North'".

Example #3: In the source map the layer has no definition query. You apply a DefinitionExpression in LayerDescription as "SALES > 1000". Your QueryFilter where clause is "MANAGER = 'Bob'". The result will be the ids of all sale region features with sales over 1000 and are managed by Bob. QueryFeatureIDs2 honors the DefinitionExpression set in LayerDescription.

Page through Result

Result from QueryRowIDs can be used to page through a result. When a query is expected to return a lot of rows and showing all those records on a single page is not desirable, you may use the following steps to page through your result and get records for a selected subset on demand:

Miscellaneous

MaxRecordCount does not affect QueryRowIDs.

The results of this function can be used with LayerDescription::SelectionFeatures to display the selection in the exported image.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryRowIDs in interface IMapServer3
Parameters:
mapName - The mapName (in)
pTableDescription - A reference to a com.esri.arcgis.carto.IMapTableDescription (in)
pFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Returns:
A reference to a com.esri.arcgis.system.ILongArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryRelatedRecords

public IQueryResult queryRelatedRecords(String mapName,
                                        int sourceTable,
                                        IFIDSet pFIDs,
                                        IRelateDescription relateDescription)
                                 throws IOException,
                                        AutomationException
Returns the IDs of the rows that meet the query filter selection criteria for the specified table.

Remarks

When esriRelateResultRelatedRecordSetAsObject is selected as ResultFormat, the function returns RelatedRecordSet embedded within a QueryResult. Use QueryResult.Object to get RelatedRecordSet.

An FIDSet needs to be created and assign an array of ObjectID to FIDArray property. Related records for ObjectID(s) contained by FIDSet will be queried. Typically this function follows QueryData, in that case you can use values of OIDField from the returned RecordSet to populate FIDSet.

RelateDescription contains information about relationship that will be explored. RelateDescription needs to be created and populated with relates ID, list of fields and output result format. In case where both RelatedTableFields and IncludeGeometry is set, RelatedTableFields takes precedence over IncludeGeometry. For example, when RelatedTableFields = “Shape, FName, LName, Address” and IncludeGeometry = False, the output recordset will contain geometry as contained within the Shape field.

When more than one ObjectID is passed, use SourceRowID to relate ‘related rows’ back to the source feature or row.

The result honors the fields visibility set in the layer or the standalone table.

Output Spatial and Time Reference

If the desired spatial reference of the output geometry is different than the original one, OutputSpatialReference should be used. Otherwise geometry is returned in the same spatial reference system as the DefaultMapDescription by default.

Values in StartTimeField or EndTimeField are returned in the Layer's TimeReference. If the desired time reference is different than the layer's one, OutputTimeReference should be explicitly set.

Relates with non GeoDatabase Tables

Since QueryRelatedRecords relies on IDs of features or rows from the source layer/table, when a table does not have an OIDField (not a Geodatabase table), finding related records from the source layer/table from the destination table is not possible. For example, when a Parcel layer is related to a Owership table (for example from an Oracle database), you may find related ownership information for a parcel, but the function does not allow to find parcels belong to a owner. In order to traverse the other way a table must have a OIDField. You may consider one of the following options for this type of scenario:

Please note that retrieving related rows that has joins may impact the performance.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryRelatedRecords in interface IMapServer3
Parameters:
mapName - The mapName (in)
sourceTable - The sourceTable (in)
pFIDs - A reference to a com.esri.arcgis.geodatabase.IFIDSet (in)
relateDescription - A reference to a com.esri.arcgis.carto.IRelateDescription (in)
Returns:
A reference to a com.esri.arcgis.carto.IQueryResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryRasterValue

public IImageResults queryRasterValue(String mapName,
                                      int sourceTableID,
                                      ILongArray rowIDs,
                                      String fieldName,
                                      IImageType rasterValueType)
                               throws IOException,
                                      AutomationException
Returns the Raster content that meet the selection criteria for the specified table.

Remarks

An array of IImageResult3. IImageResult3 contains the returned mime type and either the url to the image or the mime data itself.

The ImageResult in the resultant array are returned in the same order the OIDs are passed in. If the feature does not have any raster data, a null is returned.

RasterFieldName is optional since a layer can have only one raster field. In case of join, you may need to pass in the field name, if an empty string is passed the raster field from the base table will be used.

OutImageType is optional as well. When a null is passed in as outImageType, jpeg and url are used as the default image format and returned type respectively.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryRasterValue in interface IMapServer3
Parameters:
mapName - The mapName (in)
sourceTableID - The sourceTableID (in)
rowIDs - A reference to a com.esri.arcgis.system.ILongArray (in)
fieldName - The fieldName (in)
rasterValueType - A reference to a com.esri.arcgis.carto.IImageType (in)
Returns:
A reference to a com.esri.arcgis.carto.IImageResults
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryAttachmentInfos

public IAttachmentInfoArray queryAttachmentInfos(String mapName,
                                                 int tableID,
                                                 ILongArray rowIDs)
                                          throws IOException,
                                                 AutomationException
Returns the attachment info that describe the attachments for the given features/ rows.

Remarks

An array of objects that supports IAttachmentInfo. Each AttachmentInfo object represents metadata for each multimedia data such as Attachment ID, content mime type, name, source OID and size in bytes.

You should check MapLayerInfo.HasAttachments before using this function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryAttachmentInfos in interface IMapServer3
Parameters:
mapName - The mapName (in)
tableID - The tableID (in)
rowIDs - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IAttachmentInfoArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryAttachmentData

public IAttachmentDataArray queryAttachmentData(String mapName,
                                                int tableID,
                                                ILongArray attachmentIDs,
                                                int transportType)
                                         throws IOException,
                                                AutomationException
Returns the attachment data for the given features/ rows.

Remarks

An array of objects that support IAttachmentData. Each AttachmentData object contains AttachmentInfo to relate the data back to the feature/row that this data is attached to, the attachment data and the url to the data.

Use QueryAttachmentInfos to get AttachmentIDs for all attached multimedia data attached to a feature/row.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryAttachmentData in interface IMapServer3
Parameters:
mapName - The mapName (in)
tableID - The tableID (in)
attachmentIDs - A reference to a com.esri.arcgis.system.ILongArray (in)
transportType - A com.esri.arcgis.system.esriTransportType constant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IAttachmentDataArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryHTMLPopups

public IStringArray queryHTMLPopups(String mapName,
                                    int tableID,
                                    ILongArray pRowIDs)
                             throws IOException,
                                    AutomationException
Returns the html as text that can be used in popups.

Remarks

An array of string. Each string represents rich html formatted attributes of a feature.

You should check MapLayerInfo.HTMLPopupType before using this function.

The html content in results are returned in the same order the OIDs are passed in. If you want to query feature based on location and get result back as rich html, you may use Identify function with esriIdentifyVisibleWithHTMLPopup or esriIdentifyTopOneWithHTMLPopup.

This function does not allow a client to format the attribute, instead it returns html content the way an author formatted the result in the source map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
queryHTMLPopups in interface IMapServer3
Parameters:
mapName - The mapName (in)
tableID - The tableID (in)
pRowIDs - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.system.IStringArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDefaultLayerDrawingDescriptions

public ILayerDrawingDescriptions getDefaultLayerDrawingDescriptions(String mapName,
                                                                    ILongArray pLayerIDs,
                                                                    IServerSymbolOutputOptions outputOptions)
                                                             throws IOException,
                                                                    AutomationException
Get Layer Drawing Description

Remarks

An array of ILayerDrawingDescription for layers which IDs were passed in. The result contains drawing descriptions only for feature layers. Therefore the count of input LayerIDs may not match with the count of returned array. If any ID is passed in that is neither of a FeatureLayer nor of an existing layer, no drawing description will be returned for that ID.

You may want to use IMapLayerInfo::HasLayerDrawingDescription to check whether MapServer will return ILayerDrawingDescription for a layer.

outputOptions parameter can be Null, in that case MapServer returns images in PNG format. In absence of virtual directory images are returned as PNG mime.

A LayerDrawingDescription object contains information on the symbology and label specified by the author. FeatureRenderer describes how the layer is symbolized while LabelingDescription contains all label classes defined in the source map by the author.

Please note that MapServer only returns the followings:

Types of renderer:

Types of symbol:

point features

line features

polygon features

If a layer’s renderer is not one of those supported one, nothing will be returned. Symbols that are not the supported get downgraded to one of supported one. Please see the rules below.

Here is how a layer’s symbols get downgraded:

Point symbols

Line symbols

Polygon symbols


Labels:

Graphic of Layer Label Properties in ArcMap

LabelPlacement

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDefaultLayerDrawingDescriptions in interface IMapServer3
Parameters:
mapName - The mapName (in)
pLayerIDs - A reference to a com.esri.arcgis.system.ILongArray (in)
outputOptions - A reference to a com.esri.arcgis.carto.IServerSymbolOutputOptions (in)
Returns:
A reference to a com.esri.arcgis.carto.ILayerDrawingDescriptions
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapTableSubtypeInfos

public IMapTableSubtypeInfos getMapTableSubtypeInfos(String mapName,
                                                     ILongArray pTableIDs)
                                              throws IOException,
                                                     AutomationException
Returns the MapTableSubtypeInfos in the current map.

Remarks

Use GetMapTableSubtypeInfos to get the subtype and domain information for all or given layers and standalonetables from a Map. The function returns IMapTableSubtypeInfos which contains a collection of IMapTableSubtypeInfo for each layer/standalonetable whose HasSubtype value is True.

The function takes an array of standalonetable and layer ids. When this parameter is Nothing/Null, all layers and standalonetables are checked for subtypes. No IMapTableSubtypeInfo returned for layers/tables that does not have subtypes. Therefore the count of input TableIDs may not match with the count of returned array of IMapTableSubtypeInfo. Use TableID to find which layer/table one IMapTableSubtypeInfo belongs to.

IMapTableSubtypeInfo contains information about all subtypes and domains assigned at subtype level. When a field is invisible even though it may have domain assigned for a subtype, FieldDomainInfo for that field is not returned.

Also, note that subtype and domains are not returned from joined table.

The function returns empty result when the CodeCount of all CodedValueDomains from all layers and tables exceeds MaxDomainCodeCount. It does not affect DCOM clients.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMapTableSubtypeInfos in interface IMapServer3
Parameters:
mapName - The mapName (in)
pTableIDs - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapTableSubtypeInfos
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onAdd

public IPropertySet onAdd(IPropertySet pProps)
                   throws IOException,
                          AutomationException
Is called when the configuration is added.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onAdd in interface IServerObjectConfigurationManager
Parameters:
pProps - A reference to a com.esri.arcgis.system.IPropertySet (in)
Returns:
A reference to a com.esri.arcgis.system.IPropertySet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onRemove

public void onRemove()
              throws IOException,
                     AutomationException
Is called when the configuration is removed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onRemove in interface IServerObjectConfigurationManager
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onStart

public void onStart(IServerObjectAdmin pAdmin,
                    IPropertySet pProps)
             throws IOException,
                    AutomationException
Is called when the configuration is started.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onStart in interface IServerObjectConfigurationManager2
Parameters:
pAdmin - A reference to a com.esri.arcgis.server.IServerObjectAdmin (in)
pProps - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onStop

public void onStop(IServerObjectAdmin pAdmin,
                   IPropertySet pProps)
            throws IOException,
                   AutomationException
Is called when the configuration is stopped.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onStop in interface IServerObjectConfigurationManager2
Parameters:
pAdmin - A reference to a com.esri.arcgis.server.IServerObjectAdmin (in)
pProps - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onRemoveEx

public void onRemoveEx(IServerObjectAdmin pAdmin,
                       IPropertySet props)
                throws IOException,
                       AutomationException
Is called when the configuration is removed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onRemoveEx in interface IServerObjectConfigurationManager2
Parameters:
pAdmin - A reference to a com.esri.arcgis.server.IServerObjectAdmin (in)
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

beforeStart

public void beforeStart(IServerObjectAdmin pAdmin,
                        IPropertySet props)
                 throws IOException,
                        AutomationException
Is called before the configuration is started.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
beforeStart in interface IServerObjectConfigurationManager2
Parameters:
pAdmin - A reference to a com.esri.arcgis.server.IServerObjectAdmin (in)
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

beforeStop

public void beforeStop(IServerObjectAdmin pAdmin,
                       IPropertySet props)
                throws IOException,
                       AutomationException
Is called before the configuration is stopped.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
beforeStop in interface IServerObjectConfigurationManager2
Parameters:
pAdmin - A reference to a com.esri.arcgis.server.IServerObjectAdmin (in)
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validate

public void validate(IPropertySet props)
              throws IOException,
                     AutomationException
Validates an object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
validate in interface IObjectValidate
Parameters:
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDataSource

public Object getDataSource(String mapName,
                            int layerID)
                     throws IOException,
                            AutomationException
Get Data Source

Remarks

This function allows fine-grained object access to a FeatureLayer, a RasterLayer or a StandaloneTable by returning IFeatureClass, IRaster or ITable respectively. If the layer or standalone table has any joins, the returned object will not contain the joined portion. In addition any field visibility or field alias set to the layer in the source map document will be ignored as it returns the underlying data source.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDataSource in interface IMapServerDataAccess
Parameters:
mapName - The mapName (in)
layerID - The layerID (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDisplayDataSource

public Object getDisplayDataSource(String mapName,
                                   int layerOrTableID)
                            throws IOException,
                                   AutomationException
Get Display Data Source

Remarks

This function allows fine-grained object access to a FeatureLayer, a RasterLayer or a StandaloneTable by returning IFeatureClass, IRaster or ITable respectively, or IRelQueryTable when it is joined. In addition any field visibility or field alias set to the layer in the source map document will be ignored as it returns the underlying data source.

The main difference between GetDisplayDataSource and GetDataSouce functions is that the former one honors joins and returns IRelQueryTable when join exists. This IRelQueryTable interface gives you access to the source or destination table, or the relationship class. When the layer or standalone table is not participating in any join, the behavior of GetDisplayDataSource and GetDataSouce functions are identical.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDisplayDataSource in interface IMapServerDataAccess
Parameters:
mapName - The mapName (in)
layerOrTableID - The layerOrTableID (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.