当前位置: 首页 > 工具软件 > TileCache > 使用案例 >

tilecache切图命令和tilecache配置

江衡
2023-12-01
python "F:\Apache Software Foundation\Apache2.2\cgi-bin\tilecache_seed.py" road 0 6     //切geoserver发布到图
 python "F:\Apache Software Foundation\Apache2.2\cgi-bin\tilecache_seed.py" Mapserver 0 6 //切 mapserver发布到图
 
[road]
type=WMS
url= http://192.168.5.126:8383/geoserver/wms?TRANSPARENT=TRUE
layers=sf:roads
srs=EPSG:26713
maxResolution=78.4857568216703
levels=10
bbox=589434.8564686741, 4914006.337837095,609527.2102150217, 4928063.398014731
size=256,256
extension=png
 
[Mapserver]
type=WMS
url= http://127.0.0.1//cgi-bin/mapserv.exe?MAP=F:/ms4w/apps/mapserv-demo/itasca.map&LAYERS=ALL&transparent=true&MODE=MAP
extension=png
srs=EPSG:26915
levels=6
bbox=388107.634400379, 5203120.88405952, 500896.339019834, 5310243.30613897
 
【注意】scale = resolution * 72 * 39.3701(1米=39.3701英寸,1英寸=72像素)
 
<script type="text/javascript">
        <!--
        var map, layer;
        function init(){
              var options = {
                    controls: [],
                    maxExtent: new OpenLayers.Bounds(589434.8564686741, 4914006.337837095,609527.2102150217, 4928063.398014731),
                    maxResolution: 78.4857568216703,
                    projection: "EPSG:26713",
                    units: 'm'
                };
                map = new OpenLayers.Map('map', options);
                 // 有可能读取到404瓦片(/4/2/-1), 出现异常图片区域
          OpenLayers.Util.onImageLoadError = function() {  this.style.display = "none"; };
           // map = new OpenLayers.Map( $('map'), {'maxResolution': 360/512});
            layer = new OpenLayers.Layer.WMS( "VMap0", " http://localhost:80/cgi-bin/tilecache.cgi?", {layers: 'road', format: 'image/png' } );
            map.addLayer(layer);
   map.addControl(new OpenLayers.Control.PanZoomBar({
                    position: new OpenLayers.Pixel(2, 15)
                }));
           map.addControl(new OpenLayers.Control.Navigation());
            //map.addControl(new OpenLayers.Control.Permalink());
           // if (!map.getCenter()) map.zoomToMaxExtent();
      map.zoomToExtent(new OpenLayers.Bounds(589434.8564686741, 4914006.337837095,609527.2102150217, 4928063.398014731));
        }
        // -->
    </script>
 类似资料: