fanvanzh / 3dtiles

The fastest tools for 3dtiles convert in the world!
Apache License 2.0
1.97k stars 594 forks source link

我在centos7.3上转换 提示坐标转换失败 #219

Closed andy-cd-g closed 5 months ago

andy-cd-g commented 2 years ago

epsg convert failed!

只有坐标转换失败,文件是转换成功了的 osgb转3dtiles

fanvanzh commented 2 years ago

那可能加载到球上位置不对,你可以手动把 metadata.xml 里的坐标改成经纬度坐标

andy-cd-g commented 2 years ago

epsg convert failed! 这个是你打印的错误提示 不应该是 我那配置不对吗 windows下可以的 linux不行

liwei0705 commented 1 year ago

确实有这个错误。Ubuntu18.04 ./target/release/_3dtile --format osgb --input /mnt/d/workspace/osgbdata/KLN --output ./threedtiles222/

ERROR: 2022-11-30 06:27:38 - epsg convert failed! INFO: 2022-11-30 06:28:01 - task over, cost 23.35 s.

应该是这段代码,osgb::epsg_convert返回false

                                unsafe {
                                    use std::ffi::CString;
                                    let c_str = CString::new(gdal_data).unwrap();
                                    let ptr = c_str.as_ptr();
                                    if osgb::epsg_convert(srs, pt.as_mut_ptr(), ptr) {
                                        center_x = pt[0];
                                        center_y = pt[1];
                                        info!("epsg: x->{}, y->{}", pt[0], pt[1]);
                                    } else {
                                        error!("epsg convert failed!");
                                    }
                                }
fanvanzh commented 1 year ago

应该是 linux 分支的代码, 屏蔽了 GDAL transform 的代码, 因为没配置 GDAL 依赖库

liwei0705 commented 1 year ago

我在ubuntu18.04上

sudo add-apt-repository -y ppa:ubuntugis/ppa sudo apt update sudo apt upgrade apt install gdal-bin python-gdal python3-gdal libgdal-dev

$ gdalinfo --version GDAL 2.4.2, released 2019/06/28

是否可以?

fanvanzh commented 1 year ago

应该可以, 你把代码里 宏开关去了

liwei0705 commented 1 year ago

linxu分支里的DIFF不少...没找到要打开哪个开关...方便指点一下吗

fanvanzh commented 1 year ago

ifdef _WIN32

这个宏包起来的代码,只在 Windows 环境下生效,去掉这个宏,在 linux 也编译通过即可

liwei0705 commented 1 year ago

谢谢,搞定了https://github.com/liwei0705/3dtiles/tree/linux_osg_370

简单memo了一下 https://github.com/liwei0705/3dtiles/blob/linux_osg_370/linux_README.md

LYP857 commented 11 months ago

@liwei0705 大哥你是怎么解决的,我还是报epsg convert failed! 是不是这个问题呢,我tileset.cpp里面宏开关没用吖。我用的是centos7.3 [root@localhost release]# ldd _3dtile linux-vdso.so.1 => (0x00007fff9afc5000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f82726e0000) libosg.so.202 => not found libosgDB.so.202 => not found libosgUtil.so.202 => not found libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f82724c8000) librt.so.1 => /lib64/librt.so.1 (0x00007f82722c0000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f82720a4000) libm.so.6 => /lib64/libm.so.6 (0x00007f8271da1000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f8271b9d000) libc.so.6 => /lib64/libc.so.6 (0x00007f82717cf000) /lib64/ld-linux-x86-64.so.2 (0x00007f8272f54000)

liwei0705 commented 11 months ago

我在上面贴了代码分支和readme

DIFF https://github.com/fanvanzh/3dtiles/compare/linux_osg_370...liwei0705:3dtiles:linux_osg_370 我提交时换行符可能变化了,无视掉所有空白变更

@liwei0705 大哥你是怎么解决的,我还是报epsg convert failed! 是不是这个问题呢,我tileset.cpp里面宏开关没用吖。我用的是centos7.3 [root@localhost release]# ldd _3dtile linux-vdso.so.1 => (0x00007fff9afc5000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f82726e0000) libosg.so.202 => not found libosgDB.so.202 => not found libosgUtil.so.202 => not found libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f82724c8000) librt.so.1 => /lib64/librt.so.1 (0x00007f82722c0000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f82720a4000) libm.so.6 => /lib64/libm.so.6 (0x00007f8271da1000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f8271b9d000) libc.so.6 => /lib64/libc.so.6 (0x00007f82717cf000) /lib64/ld-linux-x86-64.so.2 (0x00007f8272f54000)

LYP857 commented 11 months ago

@liwei0705 大哥你修改完的代码没有在仓库吗,我攒看起来和原作者的一样吖,tileset.cpp这个文件最后是什么样的呢,还有gdal版本有要求嘛?

LYP857 commented 11 months ago

@liwei0705 大哥,或者能够给我一个编译后好的嘛,我尝试了多次,ubantu下就是编译不成功,去cenots编译成功但是却坐标错误

liwei0705 commented 11 months ago

说明文档:https://github.com/fanvanzh/3dtiles/commit/599ded2c6b77fe29f9eca371baa1cdf787e465b4?diff=unified&w=1 tileset.cpp: https://github.com/fanvanzh/3dtiles/blob/6f1ea3adaaf573e3d36cbc008f2f612a6f4e8873/src/tileset.cpp

fanvanzh commented 5 months ago

增加了 linux 版本的编译测试

IKangXu commented 4 months ago

@liwei0705
#314 可以帮忙测试一下这份数据吗 我使用你改好的编译处理完之后,坐标也是错误的