管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-09-07 8d7a67ab1d635cb954337d8a767878ae526dd3dc
ExportMap/TerraBuilder/tb.js
@@ -1,16 +1,43 @@
try{
    var project = TerraBuilder.OpenProject("E:\\terrait\\TianJin\\ExportMap\\ExportMap\\TerraBuilder\\tb.tbp");
try {
    // type: 0-Clip, 1-Fill, 2-NullValue
    var project = TerraBuilder.OpenProject("E:\\terrait\\TianJin\\ExportMap\\ExportMap\\TerraBuilder\\tb01.tbp");
    var shp = "D:\\LF\\data\\shp\\buffer_midline.shp";
    var eleLayer = project.Layers.InsertLayer("D:\\LF\\data\\6fa147ab-b43e-4ad1-8e4b-534d8cbb60a7\\DEM\\DEM.tif", "Elevation");
    if (null != eleLayer) eleLayer.ElevationPyramidFormat = 0;
    var imgLayer = project.Layers.InsertLayer("D:\\LF\\data\\DOM\\D0M_M.tif", "imagery");
    if (null != imgLayer) {
        imgLayer.ImageryPyramidFormat = 0;
    var imgLayer = project.Layers.InsertLayer("D:\\LF\\data\\6fa147ab-b43e-4ad1-8e4b-534d8cbb60a7\\DOM\\CABQ_0641.tif", "imagery");
    if (null != imgLayer) imgLayer.ImageryPyramidFormat = 0;
        //var poly1 = VBArray(project.Polygons.ImportPolygons(shp)).toArray()[0];
        //poly1.AttachToLayer(imgLayer);
        //poly1.type = 2;
        var poly2 = VBArray(project.Polygons.ImportPolygons(shp)).toArray()[0];
        poly2.AttachToLayer(imgLayer);
        poly2.type = 0;
    }
    var eleLayer = project.Layers.InsertLayer("D:\\LF\\data\\DEM\\DEM_M.tif", "Elevation");
    if (null != eleLayer) {
        eleLayer.ElevationPyramidFormat = 0;
        //var poly1 = VBArray(project.Polygons.ImportPolygons(shp)).toArray()[0];
        //poly1.AttachToLayer(eleLayer);
        //poly1.type = 1;
        //poly1.ElevationFillBehavior = 1;
        //var poly2 = VBArray(project.Polygons.ImportPolygons(shp)).toArray()[0];
        //poly2.AttachToLayer(eleLayer);
        //poly2.type = 2;
        var poly3 = VBArray(project.Polygons.ImportPolygons(shp)).toArray()[0];
        poly3.AttachToLayer(eleLayer);
        poly3.type = 0;
    }
    //project.Settings.MPTFileName = "D:\\LF\\data\\mpt\\0A.MPT";
    project.CreateResolutionPyramids();
    //project.Settings.MPTFileName = "E:\\terrait\\TianJin\\ExportMap\\ExportMap\\TerraBuilder\mpt\\0A.mpt";
    // project.Save();
    //project.Save();
    project.CreateMPT();
    TerraBuilder.ExitWhenFinished();