A Study on Cutting and Accessing to and Splicing Tile Map Dynamically Based on ArcGIS

The service efficiency of traditional WebGIS model has certain limitation in providing geographic information service. To improve the cutting efficiency and updating convenient of the map tiles and the user interoperability of accessing to and splicing tile map, in the C/S mode, according to the characteristics of data organization of tile map and the shortcoming of traditional accessing to and splicing tile map, the method is proposed by combining ArcGIS Engine with jointed map framework to realize tile map cutted, drawn and projected dynamically. And the method is demonstrated the feasibility through the Hunan basic geographic data.


INTRODUCTION
Online maps such as Google Map, BaiduMap and BingMaps is characterized by easy operation, friendly interface, smooth accessing and data plentifulness and favored by users (Wei, 2012).This tile map service not only promoted the rapid development of WebGIS but also changed the traditional WebGIS service model, largely reduced the server load and improved the quantity and speed of accessing request.This service model put the spatial information data generate custom tiled map stored on the hard drive according to the determined tile cut algorithm firstly and then reduction the map in the browser by the way of link picture.Due to the adoption of the strategy of space-time tradeoff, the tiles map can cache map and read static pictures in the client so that it can provide map services quickly and bringing better user experience (Xu et al., 2010).
However, with the development of economy and the increasing demand of users, the user often don't satisfied the simple online tile map access, but more integration analysis by using the network map data and their own data.This has brought new problem which how to make use of the characteristics (easy storing, updating and accessing) of tile map to binding to the existing senior GIS desktop application directly.At present, the tile map generally created by using ArcGIS Server, but this way will make it difficult to update the local area of tiles and have a high cost; besides, the Flash is used as client to cut map dynamically (Zhao and Sun, 2010;Zhang, 2009), but this method can bring some burden to the client and make the program to reduce the efficiency.The accessing to tiles usually by Flex, Silverlight, OpenLayers, MapEasy, GDAL manners, such as city planning information system uses the Win 32 class library and open source library GDAL mosaic tiles (Wei, 2012); East China Geological and geochemical database system using the Ajax and MapEasy to access tiles (Ma et al., 2008); Longxi County geographic spatial information application system based on Flex (Gao et al., 2011); The BingMaps tiles data was be used to realize the Web Map Service (Wang et al., 2010); those ways have some advantages on accessing the mosaic tiles, but have some limitation on other analytical function developments.Such as the complication of the accessing to database of Flex and Silverlight and the difficulty of advanced functional analysis developments, the low efficiency of GDAL accessing, the function of MapEasy is little although it is easy to call the method only to write the read address, the function of OpenLayers is so rich while it is hard to call methods; using BingMaps tiles data directly can reduce cost, but the content of the tiles data can't be changed at random.Aiming at these disadvantages, such as the complexity of local update by ArcGIS Server, the low efficiency of cutting tile map program on the client by using Flash, the less function of accessing to and splicing tile map by using MapEasy and the low efficiency of GDAL, this study development a dynamic till-cut and access splice tool based on ArcGIS Engine.

Design principle of cutting tile map on the server:
Map tiles technology produces a number of square pictures cutted by the map with coordinate according to the fixed several scale (tile level) and specified image size on the server, which are saved into image file with specified format, named by some rules and stored in the directory system or database system with some organization way on the server, so that the pyramid model of static map cache will be formed.Tile pyramid model is a kind of multi-resolution hierarchical model, whose structure is from the bottom of the pyramid to the top floor tiles with lower and lower resolution and the same geographic area, such as shown in Fig. 1.The proposed cutting tile map method is based on the pyramid model structure of the tile map, determining the biggest scale level of the map service platform and putting the map pictures with the lowest zoom level and biggest scale as the bottom of the pyramid (Liu et al., 2011).Each zoom level represents to the corresponding map scale.According to the area of the geographic coordinates range, the index map grid files of some scale can be generated by calculating the central meridian, setting dividing zone method and coordinates system and then, using the coding rules of national basic scale topographic map, the standard grid code will be calculated.Cutting the map document by the index map grid of each level, the tiles will be generated, which are named by the corresponding grid code.Therefore, the tiles store in server hard disk and Oracle database with the hierarchical directory structure, whose data table field structure has grid code, the path of the picture stored and the corresponding scale.The map tile library of the map document can be obtained on the server so that it is very convenient for the client to index and search the tiles library.

Design ideas of splicing tile map on the client:
Essentially, the map tile is grid data.So, when loading the map tile on the client, it can be loaded or drawn as long as a grid layer (Huang, 2011;Cho, 1999).In this study, the main problem should be solved is that how to locate each tile to the correct position, which can be solved through the geographic coordinates file.Because the tile format is PNG in this study, the PGW files with the same file name and geographic coordinate's information can be kept when downloading the tiles.ArcGIS Engine programs automatically each tile geographic coordinates according to the PGW files.The spatial grid index is established and querying each tile needs to use the joint retrieval by the coordinate grid scope, scale level and other fields.When accessing the map tile in the map control, the grid code of the index map grid can be obtained through the current screen geographic coordinate's scope and scale to calculate the index map grid included.The tile storage path can be Loading the tiles according to the storage path and displayed in the map control, with the tiles geographic coordinates registration on the loading process.

PROGRAMMING
Process of cutting tile map: With the known initial map geographical range, coordinate system and the total cutting tile level, the index map grid of corresponding grade could be generated according to the coding method of the national basic scale topographic map and then using the corresponding index map grid constantly adjusts the map visual range on the basis of the cutting grade.Finally, the current display content is recycled to export to the predefined format images which are named by the grid code.These images store in a tile library directory structure.Algorithm flow chart is shown in Fig. 2.

Realization of cutting tile map:
 Calculation span: Span refers to the map width per 1 pixel of the one's level map.For example, in the WGS84 system, each screen pixel represents one degree in the largest designated level (generally 18 levels).According to the span, the number of ranks could be calculated within the specified range of map.Georeferencing tile: In the WebGIS, tiles is sized in pixel without spatial reference and located in the browser document calculated by the ranks number and the size of the tiles according to the level of the tiles.But the spatial reference is a very important characteristic of desktop GIS application, which is needed to overlay other data accurately.In the desktop GIS application, the unit of measure is not pixels but meter or degree and so on.In order to adapt to the dynamical map projection change, the projection information should be necessary.Therefore, when accessing to tile map, it needs to calculate the range of tiles dynamically and add spatial reference information.
The referenced vector data and grid map which needs registration should be loaded in the map control view on the client.The method of loading the Shapefile files is used by the AddLayer function of the ArcGIS Engine MapControl class (Xu et al., 2011); the grid map is loaded through the IRasterWorkspace interface of ArcGIS Engine.The general coordinate position of the tile's four corner point is defined by the pixel size and then adding the correct coordinate position collection, finally, choosing the registration model such as p polynomial model.The spatial reference and precise coordinates of these grid images will be obtained after executive registration.Code realization is as follows: Customized layer to draw: According to the layer object model of ArcGIS Engine, tile map layer inheritances from the basic layer object ILayer of ArcGIS Engine and achieves a number of interface and methods.The customized layer to drawn is realized through the Draw function rewritten primarily of the tile map layer.The method downloads or locally reads the map tile form the server on the basis of the current range of the map.Then, the geographic coordinates and projection information are added to the map tile according to the map projection system and the tile code.Finally, the map tile with geographic coordinates could be drawn in the map.When the current map changing, the map control will call this method to draw a new layer, therefore, it is realized the tile map updating and drawing.

Realization of splicing tile map on the client:
 Calculating Coordinates according to the map grid code // calculating the higher left corner //coordinates of designated map grid code double ymax = h * delta_y

EXPERIMENT AND RESULT ANALYSIS
On the basis of above ideas, the tool of dynamically cutting and splicing tile map is programmed and conducted an experiment with basic geographical information data of Hunan province.
Cutting tile map on the server: The tiles library is cutted by the basic geographical information data of Hunan province with WGS84 coordinate system on the server, which is shown in Fig. 3 in 1/1000000 scale.
We can draw a conclusion from the above.Through repeated tests, the cutted tile map with 512*512 pixel size is only cost of 3 sec based on the proposed method in computer with Inter (R) Core (TM) i 2 CPU 2.2 GHz processor, 3G memory, which costs 9 sec based on ArcGIS Server.The advantage of the method can be obvious in small size image.Although tile map technology gives great improvement to the WebGIS performance, the tile map in the shape of picture stores in the server.When the spatial data is edited on-line on the client, the change could not immediately call back to the server, but need to update map tile background.The proposed method can be convenient to update partial map tile which replaces the new tile through finding out the jointed map framework of the modify region in scale, so the partial tile can be updated conveniently and quickly.
Splicing tile map on the client: Addressing and splicing tile map of Hunan province, the picture could be drawn and shown in the map control on the client, as shown in Fig. 4.
We can draw a conclusion from the above: In order to improve system efficiency when addressing and splicing tile map, the memory layer is inserted into the method which the memory layer is managed uniformly.The development style has long development cycle and development personnel demanding using the Sliverlight, GDAL and other method to address and splice tile map, the method proposed above all is mature and easy to understand and develop based on ArcGIS Engine, so that the difficulty of the secondary development can be greatly reduced and rapid development desktop GIS application system can be realized.

CONCLUSION
In order to avoid the disadvantage of cutting and splice tile map based on ArcGIS Server, GeoServer etc., the method is proposed by combining ArcGIS Engine with jointed map framework to realize tile map cutted, drawn and projected dynamically and then the tool of dynamically cutting and splice tile map is designed and programmed with the actual experiment.This method not only is more convenient for updating tile which replaces the new tile through finding out the display content of the modify region, but also could be addressed and spliced tile map, besides, the analysis function can be more strong combined with the existing desktop GIS program.Thus, the Geographic space information resources sharing platform will be impelled by the service mode of tile map.Due to the tile map consisted of single picture, the model of tile geographic coordinates registration proposed in the study doesn't analyses the error, so that how to realize tile geographic coordinates registration more accurately and address and splice tile map more quickly will become the focus of future research.

Fig. 2 :
Fig. 2: Algorithm flowchart of cutting tile selected by the grid code in the Oracle database table.Loading the tiles according to the storage path and displayed in the map control, with the tiles geographic coordinates registration on the loading process.

Fig. 4 :
Fig. 4: Sample of tile map displayed on the client