首页 / 浏览问题 / 组件GIS / 问题详情
iobject PointCloudCacheBuilder如何设置参数?
14EXP 2020年06月09日

使用产品:iobject 10i 操作系统:win7 x64
数据类型: 文件型 las 点云数据


问题详细描述:我想调用iobject  PointCloudCacheBuilder类,把点云生成为缓存,但尝试了设置参数,一直生成失败,PointCloudCacheBuilder.Build()函数返沪false,但没有提示错误的原因。数据应该没问题,因为用桌面软件可以处理成功,处理后也可以加载到场景中。


问题重现步骤: 

我写的代码如下。

 PointCloudCacheBuilder myPointCloudCacheBuilder = new PointCloudCacheBuilder(myLasFilePath, myCacheFolderPath, myCacheName);
PointCloudFileInfo myPointCloudFileInfo = new PointCloudFileInfo();
myPointCloudFileInfo.PointDataUnit = DataUnit.Meter;
myPointCloudFileInfo.Position = new Point3D(0, 0, 0);
myPointCloudFileInfo.SrcPrjCoordSys = new PrjCoordSys(32650);
myPointCloudCacheBuilder.PointCloudInfos = myPointCloudFileInfo;

myPointCloudCacheBuilder.ProcessType = ProcessFileType.Normal;
myPointCloudCacheBuilder.FileType = SuperMap.Realspace.CacheFileType.S3MB;
myPointCloudCacheBuilder.PointCloudTileSplitType = ImageTilingMode.Local;
myPointCloudCacheBuilder.TilePyramidSplitType = PyramidSplitType.Octree;

myPointCloudCacheBuilder.Stepped += PointCloudCacheBuilder_Stepped;
bool mySucess = myPointCloudCacheBuilder.Build();

2 个回答

您好!看您的代码里面缺PointCloudCacheBuilder.OutputFolder设置缓存路径哦
3,362EXP 2020年06月10日
您好,我在初始化PointCloudCacheBuilder对象时的构造函数里面设置了,并且看了下跟踪了下这个变量,OutputFolder属性是有值的。
经过和技术支持反复沟通,能够成功执行的代码如下

string myLasFilePath = @"F:\227-228.las";
            PointCloudCacheBuilder myPointCloudCacheBuilder = new PointCloudCacheBuilder();
            PointCloudFileInfo myPointCloudFileInfo = new PointCloudFileInfo();
            myPointCloudFileInfo.GroupFileNames.Add("0", new List<string>() { myLasFilePath });
            myPointCloudFileInfo.PointDataUnit = DataUnit.Meter;
            myPointCloudFileInfo.Position = new Point3D(0, 0, 0);
            myPointCloudFileInfo.SrcPrjCoordSys = new PrjCoordSys(32648);
            myPointCloudCacheBuilder.PointCloudInfos = myPointCloudFileInfo;

            myPointCloudCacheBuilder.OutputFolder = @"F:\Test";
            myPointCloudCacheBuilder.CacheName = "AA";
            myPointCloudCacheBuilder.ProcessType = ProcessFileType.Add;
            myPointCloudCacheBuilder.FileType = SuperMap.Realspace.CacheFileType.S3MB;
            myPointCloudCacheBuilder.PointCloudTileSplitType = ImageTilingMode.Local;
            myPointCloudCacheBuilder.TilePyramidSplitType = PyramidSplitType.QuadTree;
            myPointCloudCacheBuilder.CategoryField = PointCloudCategoryField.PosZ;

            bool mySucess = myPointCloudCacheBuilder.Build();
            if (mySucess == false)
            {
                MessageBox.Show("创建点云缓存失败。");
            }
            else
            {
                MessageBox.Show("创建点云缓存成功。");
            }

如果创建点云瓦片想在球上展示设置如下。

myPointCloudCacheBuilder.PointCloudTileSplitType = ImageTilingMode.Globe;

如果要在平面视图中展示 设置如下。

myPointCloudCacheBuilder.PointCloudTileSplitType = ImageTilingMode.Local;

如果要根据高程分层着色 需要设置下面这行代码。

myPointCloudCacheBuilder.CategoryField = PointCloudCategoryField.PosZ;
14EXP 2020年07月15日
...