|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Provides access to members that serve maps.
Use IMapServer to display, export and query ArcGIS map documents in either desktop, LAN/WAN, or internet development environments.
MapServer is a coarse-grained ArcObject. MapServer provides limited interaction with the map through a group of related "MapServer" coclasses and interfaces. The IMapServer interface includes methods to export a map image (ExportMapImage), query features in the map (Identify, Find, QueryFeatureCount, QueryFeatureIDs and QueryFeatureData) and to access specific information about the map bound to the MapServer object (GetServerInfo).
IMapServer is not an implementable interface. Custom server objects cannot be created.
| Method Summary | |
double |
computeDistance(java.lang.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. |
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. |
IMapServerFindResults |
find(IMapDescription mapDesc,
IImageDisplay mapImage,
java.lang.String searchString,
boolean contains,
java.lang.String searchFields,
int option,
ILongArray layerIds)
Returns a collection of Map Server Find Result objects that contain the given search string. |
void |
fromMapPoints(IMapDescription mapDescription,
IImageDisplay mapDisplay,
IPointCollection mapPoints,
ILongArray[] screenXValues,
ILongArray[] screenYValues)
Converts a map coordinate to a screen location. |
java.lang.String |
getDefaultMapName()
Name of the document's active map (data frame). |
IPropertySet |
getDocumentInfo()
A set of name-value pairs for properties set for the map document (mxd only). |
IMapServerLegendInfos |
getLegendInfo(java.lang.String mapName,
ILongArray layerIds,
IMapServerLegendPatch patch,
IImageType imgType)
Returns a collection of Map Server Legend Info objects for the specified layers. |
int |
getMapCount()
The number of maps (data frames) in the document. |
java.lang.String |
getMapName(int index)
Name of the map (data frame) as indicated by the index. |
IMapServerInfo |
getServerInfo(java.lang.String mapName)
Returns information about a map (data frame). |
ISQLSyntaxInfo |
getSQLSyntaxInfo(java.lang.String mapName,
int layerID)
Returns the SQL syntax information for the specified layer. |
int |
getSupportedImageReturnTypes()
The supported image return types for the map server. |
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. |
int |
queryFeatureCount(java.lang.String mapName,
int layerID,
IQueryFilter filter)
Returns the count of the features that meet the query filter selection criteria for the specified layer. |
IRecordSet |
queryFeatureData(java.lang.String mapName,
int layerID,
IQueryFilter filter)
Returns a record set of features that meet the query filter selection criteria for the specified layer. |
IFIDSet |
queryFeatureIDs(java.lang.String mapName,
int layerID,
IQueryFilter filter)
Returns the IDs of the features that meet the query filter selection criteria for the specified layer. |
IMapServerHyperlinks |
queryHyperlinks(IMapDescription mapDesc,
IImageDisplay mapImage,
ILongArray layerIds)
Returns a collection of Map Server Hyperlink objects for the specified layers. |
IPointCollection |
toMapPoints(IMapDescription mapDescription,
IImageDisplay mapDisplay,
ILongArray screenXValues,
ILongArray screenYValues)
Converts a screen location to a map coordinate. |
| Method Detail |
public IPropertySet getDocumentInfo()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int getMapCount()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public java.lang.String getMapName(int index)
throws java.io.IOException,
AutomationException
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.
index - The index (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public java.lang.String getDefaultMapName()
throws java.io.IOException,
AutomationException
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.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IMapServerInfo getServerInfo(java.lang.String mapName)
throws java.io.IOException,
AutomationException
Using IMapServerInfo 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.
This method returns an MapServerInfo object.
mapName - The mapName (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IMapImage exportMapImage(IMapDescription mapDesc,
IImageDescription imageDesc)
throws java.io.IOException,
AutomationException
Use ExportMapImage to generate an image of the map.The input parameter MapDescription contains properties describing the map (data frame). These include the map's Name, the map's MapArea,and SpatialReference, as well as collections of LayerDescription objects. Size, resolution and file format are determined by ImageDescription, which includes ImageDisplay and ImageType.
In order to control the size of an exported map image, the interface IMapServerInit contains two properties: MaxImageHeight and MaxImageWidth. The default value for these properties is 2048 pixels. This value can also be changed by modifying the XML tag in the MapServer's configuration file.
ExportMapImage returns a MapImage object.
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)imageDesc - A reference to a com.esri.arcgis.carto.IImageDescription (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IMapServerFindResults find(IMapDescription mapDesc,
IImageDisplay mapImage,
java.lang.String searchString,
boolean contains,
java.lang.String searchFields,
int option,
ILongArray layerIds)
throws java.io.IOException,
AutomationException
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 requires a number of input parameters. These include: a map description, an image display (this is needed to determine whether layers are visible or not based on the current map scale), 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.
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 ILayerDescription) or whether the layer is on, but not visible due to scale dependencies (the MinScale and MaxScale properties on IMapLayerInfo). 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.
If the searchFields parameter is blank all fields will be searched.
There are two key differences between Find and the IMapServer methods QueryFeatureCount, QueryFeatureIDs 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.
Find returns a collection of objects that implement IMapServerFindResult.
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 IMapServerInit. 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 MapServer methods: Find, Identify, QueryFeatureData, and QueryHyperlinks.. It does not affect QueryFeatureCount or QueryFeatureIds. The MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.
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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IMapServerIdentifyResults identify(IMapDescription mapDesc,
IImageDisplay mapImage,
IGeometry searchShape,
int tolerance,
int option,
ILongArray layerIds)
throws java.io.IOException,
AutomationException
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.
Identify requires a number of input parameters. These include: a map description, an image display (this is needed to determine whether layers are visible or not based on the current map scale), a search shape (usually a point), a tolerance, the esriIdentifyOption, and an array of layer Ids to be identified.
It is important to note that the geometry of the searchShape must have the same spatial reference as the map description.
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 ILayerDescription) or whether the layer is on, but not visible due to scale dependencies (the MinScale and MaxScale properties on IMapLayerInfo). 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.
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.
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.
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 IMapServerInit. 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 MapServer methods: Find, Identify, QueryFeatureData, and QueryHyperlinks.. It does not affect QueryFeatureCount or QueryFeatureIds. The MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.
This method returns a collection of objects that implement IMapServerIdentifyResult.
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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int queryFeatureCount(java.lang.String mapName,
int layerID,
IQueryFilter filter)
throws java.io.IOException,
AutomationException
The query filter can be based on either an attribute filter (SQL expression) or a spatial filter. The expression used in the filter parameter of either QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData methods on MapServer will override any filters set for the layer in the original map document (layer definition query) or set for the MapServer object layer in the DefinitionQuery property on LayerDescription. In order to apply previous query filters to the new filter set by QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData the original query expression will need to be appended to the new expression to form one compounded query expression. This compound expression can then be used by QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData.
mapName - The mapName (in)layerID - The layerID (in)filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IFIDSet queryFeatureIDs(java.lang.String mapName,
int layerID,
IQueryFilter filter)
throws java.io.IOException,
AutomationException
The query filter can be based on either an attribute filter (SQL expression) or a spatial filter. The expression used in the filter parameter of either QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData methods on MapServer will override any filters set for the layer in the original map document (layer definition query) or set for the MapServer object layer in the DefinitionQuery property on LayerDescription . In order to apply previous query filters to the new filter set by QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData the original query expression will need to be appended to the new expression to form one compounded query expression. This compound expression can then be used by QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData.
mapName - The mapName (in)layerID - The layerID (in)filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IRecordSet queryFeatureData(java.lang.String mapName,
int layerID,
IQueryFilter filter)
throws java.io.IOException,
AutomationException
The query filter can be based on either an attribute filter (SQL expression) or on 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 IMapServerInit. 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, and QueryHyperlinks. It does not affect QueryFeatureCount or QueryFeatureIDs. The MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.
The expression used in the filter parameter of either QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData methods on MapServer will override any filters set for the layer in the original map document (layer definition query) or set for the MapServer object layer in the DefinitionQuery property on LayerDescription . In order to apply previous query filters to the new filter set by QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData the original query expression will need to be appended to the new expression to form one compounded query expression. This compound expression can then be used by QueryFeatureCount, QueryFeatureIDs, or QueryFeatureData.
mapName - The mapName (in)layerID - The layerID (in)filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IMapServerHyperlinks queryHyperlinks(IMapDescription mapDesc,
IImageDisplay mapImage,
ILongArray layerIds)
throws java.io.IOException,
AutomationException
Layer visibility depends on whether the layer is on or off (the Visible property on ILayerDescription) or whether the layer is on, but not visible due to scale dependencies (the MinScale and MaxScale properties on IMapLayerInfo). The mapImage parameter is needed to determine whether the layer is not visible based on scale dependencies.
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 IMapServerInit. 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, and QueryHyperlinks. It does not affect QueryFeatureCount or QueryFeatureIDs. The MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.
This method returns a collection of objects that implement IMapServerHyperlink.
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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public double computeScale(IMapDescription mapDesc,
IImageDisplay mapDisplay)
throws java.io.IOException,
AutomationException
mapDesc - A reference to a com.esri.arcgis.carto.IMapDescription (in)mapDisplay - A reference to a com.esri.arcgis.carto.IImageDisplay (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public double computeDistance(java.lang.String mapName,
IPoint fromPoint,
IPoint toPoint,
int units)
throws java.io.IOException,
AutomationException
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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IPointCollection toMapPoints(IMapDescription mapDescription,
IImageDisplay mapDisplay,
ILongArray screenXValues,
ILongArray screenYValues)
throws java.io.IOException,
AutomationException
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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void fromMapPoints(IMapDescription mapDescription,
IImageDisplay mapDisplay,
IPointCollection mapPoints,
ILongArray[] screenXValues,
ILongArray[] screenYValues)
throws java.io.IOException,
AutomationException
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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IMapServerLegendInfos getLegendInfo(java.lang.String mapName,
ILongArray layerIds,
IMapServerLegendPatch patch,
IImageType imgType)
throws java.io.IOException,
AutomationException
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.
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)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public ISQLSyntaxInfo getSQLSyntaxInfo(java.lang.String mapName,
int layerID)
throws java.io.IOException,
AutomationException
The members of the ISQLSyntaxInfo interface provide information regarding the SQL functionality for the DBMS underlying a map layer.
mapName - The mapName (in)layerID - The layerID (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int getSupportedImageReturnTypes()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||