|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITiledMapServer
Provides access to members that serve tiled maps.
ITiledMapServer has methods that allow the caller to discover if a map service is cached, the type of the cache and the tiling scheme for the cache. ITiledMapServer also has methods to determine the virtual directory for the cache and methods to retrieve tiles from the cache.
A tiled map has a number of LODs (Levels of Detail). Each LOD, which corresponds to a map at given map scale, contains many tiles. Each tile consists of pixels, and number of pixels in a tile (described as TileROWs and TileCOLs) is the same at all levels, but the pixel size, in map space, of a tile varies with LOD.
The ITiledMapServer, ITileCacheInfo and ILODInfo interfaces are used to access a tiled map that is served through ArcGIS Server.
To get the pixel size (in map space) at a given LOD, use following code snippet:
Dim pTiledMap As ITiledMapServer
Dim pTileCacheInfo As ITileCacheInfo
Set pTiledMapInfo = pMapServer
Set pTileCacheInfo = pTiledMap.GetTileCacheInfo("usa")
Dim Resolution As Double
Dim pLODInfos As ILODInfos
Dim pLODInfo As ILODInfo
Set pLODInfos = pTileCacheInfo.LODInfos
Set pLODInfo = pLODs.Element(i)
Resolution = pLOD.Resolution
The dimension of a tile can be retrieved by ITileMapServer::TileRows and TileCols respectively.
TileRows = pTiledMap::TileRows
TileCols = pTiledMap::TileCols
Each tile is assigned a row and column number (TROW, TCOL) in a tile coordinate system. TROW, which starts from 0, increases from ‘top to bottom’ (i.e tile row number increases as map y coordinate decreases). TCOL, also starting from 0, increases from ‘left to right’ (i.e. tile column number increases as map x coordinate increases).
The size of tile, in map space, at a given LOD can be obtained by:
TileWidth = TileCols * Resolution
TileHeight = TileRows * Resolution
The tiling origin, in map space, is the same for all LODs, and can be obtained from ITileCacheInfo.Origin property.
xorigin = pTileCacheInfo.Origin.X
yorigin = pTileCacheInfo.Origin.Y
Given a map coordinate (x, y) the tile coordinates (TCOL, TROW)
of the tile containing it for a given LOD are given by:
TCOL = floor ( (x – xorigin) / TileWidth )
TROW = floor ( (yorigin – y) / TileHeight )
The corner points in map coordinates of a tile with tile coordinates (TROW, TCOL) are:
xmin = xorigin + (TCOL * TileWidth)
xmax = xmin + TileWidth
ymax = yorigin - (TROW * TileHeight)
ymin = ymax - TileHeight
Tiles are semi-open, include the boundaries corresponding to xmin, ymax.
Method Summary | |
---|---|
String |
getCacheName(String mapName,
int layerID)
Gets the cache name for a given layer within a map. |
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[] |
getMapTile(String mapName,
int level,
int row,
int column)
Gets a tile for a given tile location from a given map. |
ITileCacheInfo |
getTileCacheInfo(String mapName)
Gets the cache configuration for a given map. |
String |
getVirtualCacheDirectory(String mapName,
int layerID)
Gets the virtual cache directory for a given layer within a map. |
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. |
boolean |
isFixedScaleMap(String mapName)
Indicates if a given map is a fixed scale map. |
Method Detail |
---|
boolean isFixedScaleMap(String mapName) throws IOException, AutomationException
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.
mapName
- The mapName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean hasSingleFusedMapCache(String mapName) throws IOException, AutomationException
Use this method to determine if a cached map service has a single fused map cache.
mapName
- The mapName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ITileCacheInfo getTileCacheInfo(String mapName) throws IOException, AutomationException
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.
mapName
- The mapName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.byte[] getMapTile(String mapName, int level, int row, int column) throws IOException, AutomationException
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.
mapName
- The mapName (in)level
- The level (in)row
- The row (in)column
- The column (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean hasLayerCache(String mapName, int layerID) throws IOException, AutomationException
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.
mapName
- The mapName (in)layerID
- The layerID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.byte[] getLayerTile(String mapName, int layerID, int level, int row, int column) throws IOException, AutomationException
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.
mapName
- The mapName (in)layerID
- The layerID (in)level
- The level (in)row
- The row (in)column
- The column (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getVirtualCacheDirectory(String mapName, int layerID) throws IOException, AutomationException
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.
mapName
- The mapName (in)layerID
- The layerID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getCacheName(String mapName, int layerID) throws IOException, AutomationException
mapName
- The mapName (in)layerID
- The layerID (in)
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 |