mfbonfigli / gocesiumtiler Goto Github PK
View Code? Open in Web Editor NEWA Cesium.js point cloud 3D tiles generator from LAS files written in Golang
License: GNU Lesser General Public License v3.0
A Cesium.js point cloud 3D tiles generator from LAS files written in Golang
License: GNU Lesser General Public License v3.0
Hello,
Thanks for developing such an amazing tool for conversion las to 3d tiles conversion.
I am facing some trouble because of the depth of the folder structure, for example a 183 MB Tileset has 33,012 items with too many recursive folders, Is there any way where I can reduce the recursive folder count?
I am also not able to use transforms on the Tileset as the points itself is transformed based on the EPSG provided. Adding transforms to the tileset is resulting in taking the point clouds to unknown coordinates. Is there a way to not transorm the las coordinates with ESPG as some las file do not have their geo location information in their VLRS.
Sometims when the las file do not have EPSG information I tried to pass Default EPSG which throws an error "latitude or longitude exceeded limits".
I'm running into errors while reading a las with version 1.2.0:
After some consideration, I'm attributing this to the input file being las 1.4 and not las 1.2. I'm curious if there is any compatibility with las 1.4? And if so, if you could help guide me in the right direction?
Thanks for all the help!
PS D:\Work\GoWork\gocesiumtiler> go build # runtime
textflag.h:1: '#' must be first item on line
# runtime/cgo
gcc_freebsd_sigaction.c:19:25: error: '_SIG_WORDS' undeclared here (not in a function); did you mean 'SIG_ERR'?
uint32_t __bits[_SIG_WORDS];
^~~~~~~~~~
SIG_ERR
gcc_freebsd_sigaction.c: In function 'x_cgo_sigaction':
gcc_freebsd_sigaction.c:30:19: error: storage size of 'act' isn't known
struct sigaction act;
^~~
gcc_freebsd_sigaction.c:31:19: error: storage size of 'oldact' isn't known
struct sigaction oldact;
^~~~~~
gcc_freebsd_sigaction.c:40:22: error: 'SA_SIGINFO' undeclared (first use in this function); did you mean 'SIGINT'?
if (goact->flags & SA_SIGINFO) {
^~~~~~~~~~
SIGINT
gcc_freebsd_sigaction.c:40:22: note: each undeclared identifier is reported only once for each function it appears in
gcc_freebsd_sigaction.c:41:37: error: unknown type name 'siginfo_t'
act.sa_sigaction = (void(*)(int, siginfo_t*, void*))(goact->handler);
^~~~~~~~~
gcc_freebsd_sigaction.c:41:56: error: expected ';' before '(' token
act.sa_sigaction = (void(*)(int, siginfo_t*, void*))(goact->handler);
^
;
gcc_freebsd_sigaction.c:45:3: error: implicit declaration of function 'sigemptyset' [-Werror=implicit-function-declaration]
sigemptyset(&act.sa_mask);
^~~~~~~~~~~
gcc_freebsd_sigaction.c:48:5: error: implicit declaration of function 'sigaddset' [-Werror=implicit-function-declaration]
sigaddset(&act.sa_mask, i+1);
^~~~~~~~~
gcc_freebsd_sigaction.c:54:8: error: implicit declaration of function 'sigaction'; did you mean 'x_cgo_sigaction'? [-Werror=implicit-function-declaration]
ret = sigaction(signum, goact ? &act : NULL, oldgoact ? &oldact : NULL);
^~~~~~~~~
x_cgo_sigaction
gcc_freebsd_sigaction.c:71:8: error: implicit declaration of function 'sigismember' [-Werror=implicit-function-declaration]
if (sigismember(&oldact.sa_mask, i+1) == 1) {
^~~~~~~~~~~
gcc_freebsd_sigaction.c:31:19: error: unused variable 'oldact' [-Werror=unused-variable]
struct sigaction oldact;
^~~~~~
gcc_freebsd_sigaction.c:30:19: error: unused variable 'act' [-Werror=unused-variable]
struct sigaction act;
^~~
cc1.exe: all warnings being treated as errors
Looking forward to your reply!
Whenever I use 8-bit RGB .las files the point cloud appears all black even though the RGB's byteOffset is present within each .pnts. This doesn't happen with 16-bit RGB files, is this a known prerequesite?
Hello,
I have several .LAS files that I want to merged in a single 3d tiles. I was wondering if it was possible in gocesiumtiler with some special flag in order to reduce the streaming in Cesium environment.
Thank you
I'm trying to process a 3.8GB LAS file on a notebook with 32GB of memory. The process is consuming all the memory, and the operating system is killing the process.
Is it be possible to output to the same coordinate system as the input? Basically skip conversion to 4978?
首先感谢你提供的程序。
由于我的点云数据太大,内存跑不下,能否提供一个基于硬盘内存的程序,再次感谢您!
Hello!
I have a LAS model in the 3857 coordinate system - the Christmas tree. The size at the base is approximately 6.6 meters. When I create a tileset, the model is compressed by about 1.4 times in the XY plane (4.8 meters). I just don't understand the reason.
Here is the model: https://drive.google.com/file/d/1ElwbcpubJ6oYFVeHf2vQQhDlNBy_ctVJ/view?usp=sharing
In the README it says - Along with the source code a prebuilt binary for Windows x64 is provided for each release of the tool in the github page.
What github page are you referring to here. Can you put a useful link to these Windows binaries?
Opening this issue to verify the compatibility issue between Las 1.4 and classifications 0-255 as per the comment #16 (comment)
I just tested it this morning and las 1.4 does appear to be working. However, it seems to only include 0-31 classifications instead of the full 0-255 classifications in 1.4. Is there a flag or way to do this that I'm missing?
Hi,
I'm trying to create 3D Tiles from copc from France site (in version 2.0.0-beta), but getting an error?
-epsg 2154
Error:
_ _ _ _
__ _ ___ ___ ___ ___(_)_ _ _ __ ___ | |_(_) | ___ _ __
/ _ |/ _ \ / __/ _ \/ __| | | | | '_ _ \| __| | |/ _ \ '__|
| (_| | (_) | (_| __/\__ \ | |_| | | | | | | |_| | | __/ |
\__, |\___/ \___\___||___/_|\__,_|_| |_| |_|\__|_|_|\___|_|
__| | A Cesium Point Cloud tile generator written in golang
|___/ Copyright 2024 - Massimo Federico Bonfigli
*** Mode: File, process LAS file at LHD_FXX_0659_6410_PTS_C_LAMB93_IGN69.copc.laz
*** Execution settings:
- EPSG Code: 2154,
- Max Depth: 10,
- Resolution: 20.000000 meters,
- Min Points per tile: 5000
- Z-Offset: 0.000000 meters,
- Geoid elevation: false,
- 8Bit Color: false
- Join Clouds: false
- Tileset Version: 1.0
[2024-08-19 13:14:41.031] [LHD_FXX_0659_6410_PTS_C_LAMB93_IGN69.copc.laz] start reading las
[2024-08-19 13:14:41.033] [LHD_FXX_0659_6410_PTS_C_LAMB93_IGN69.copc.laz] las header read completed: found 40598265 points
[2024-08-19 13:14:41.034] [LHD_FXX_0659_6410_PTS_C_LAMB93_IGN69.copc.laz] point loading started
panic: runtime error: index out of range [134] with length 11
goroutine 52 [running]:
github.com/mfbonfigli/gocesiumtiler/v2/internal/las.(*FileLasReader).GetNext(0xc000072140)
C:/Users/bonfi/go/src/github.com/mfbonfigli/gocesiumtiler/internal/las/reader.go:179 +0x6f7
github.com/mfbonfigli/gocesiumtiler/v2/internal/las.(*CombinedFileLasReader).GetNext(0x0?)
C:/Users/bonfi/go/src/github.com/mfbonfigli/gocesiumtiler/internal/las/reader.go:127 +0xc5
github.com/mfbonfigli/gocesiumtiler/v2/internal/tree.(*GridTreeNode).loadPoints(0xc0001de000, {0x7ff6a4d05520, 0xc000072100}, {0x7ff6a4d054f0, 0xc0000080d8}, {0x7ff6a4d04a48, 0xc0000080f0}, {0x7ff6a4d05a68, 0xc000072080})
C:/Users/bonfi/go/src/github.com/mfbonfigli/gocesiumtiler/internal/tree/gridtree.go:427 +0x8c
github.com/mfbonfigli/gocesiumtiler/v2/internal/tree.(*GridTreeNode).Load(0x3?, {0x7ff6a4d05520?, 0xc000072100?}, {0x7ff6a4d054f0?, 0xc0000080d8?}, {0x7ff6a4d04a48?, 0xc0000080f0?}, {0x7ff6a4d05a68?, 0xc000072080?})
C:/Users/bonfi/go/src/github.com/mfbonfigli/gocesiumtiler/internal/tree/gridtree.go:85 +0x47
github.com/mfbonfigli/gocesiumtiler/v2.(*GoCesiumTiler).ProcessFiles(0xc0001cec00, {0xc000022160, 0x1, 0x1}, {0xc000010108, 0x17}, 0x86a, 0xc000076050, {0x7ff6a4d05a68, 0xc000072080})
C:/Users/bonfi/go/src/github.com/mfbonfigli/gocesiumtiler/tiler.go:116 +0x67e
main.fileCommand.func1({0x7ff6a4d05a68, 0xc000072080})
C:/Users/bonfi/go/src/github.com/mfbonfigli/gocesiumtiler/cmd/main.go:244 +0xdb
main.launch.func1()
C:/Users/bonfi/go/src/github.com/mfbonfigli/gocesiumtiler/cmd/main.go:276 +0x5c
created by main.launch in goroutine 1
C:/Users/bonfi/go/src/github.com/mfbonfigli/gocesiumtiler/cmd/main.go:274 +0x105
Any idea? Maybe copc not supported or so?
I'm trying to display the Point Cloud when zooming out without having to use maximumScreenSpaceError (=0) feature from Cesium. When using the grid algorithm I notice that the conversion has a very low geometric error on the root. My problem is that if I zoom out a small amount the tileset disappears. I do not want to use maximumScreenSpaceError = 0 otherwise all the tiles load which defeats the purpose of having LODs . I can manually edit the tileset.json but is there a way in which I could convert a .las file and produce a specific geometric error on the root?
I am trying to get 3d tiles for rendering these files in cesium
Seeing this issue while converting a las file I see a similar issue raised for compatibility #16
Any help would be much appreciated.
Thank You.
Hi
I ran geocesiumtiler on Windows, like this:
F:\challenge>F:\challenge\gocesiumtiler.exe -i F:\challenge -o F:\challenge\3dtiles -e 7415 -g -f -r
_ _ _ _
__ _ ___ ___ ___ ___(_)_ _ _ __ ___ | |_(_) | ___ _ __
/ _ |/ _ \ / __/ _ \/ __| | | | | '_ _ \| __| | |/ _ \ '__|
| (_| | (_) | (_| __/\__ \ | |_| | | | | | | |_| | | __/ |
\__, |\___/ \___\___||___/_|\__,_|_| |_| |_|\__|_|_|\___|_|
__| | A Cesium Point Cloud tile generator written in golang
|___/ Copyright 2022 - Massimo Federico Bonfigli
Preparing list of files to process...
Processing file 1/2
> reading data from las file... C_37EZ1.LAS
2022/04/26 11:34:08 epsg code not found
2022/04/26 11:34:08 epsg code not found
2022/04/26 11:34:08 epsg code not found
It said "epsg code not found".
How can I define new CRS? Is it OK to write proj text just after -e switch?
I am rendering a point cloud in Cesium JS with a custom shader, it’s displaying perfectly in the sandcastle with the demo point cloud, and with the PNTS tiles that are automatically exported out of DJI Terra, but if I generate tiles from the LAS with gocesiumtiler, it renders fine and in-position with the standard shader/style as simple RGB, but renders complete noise with the custom shader.
The end goal is to change colour based on height in Cesium JS (I had no luck styling based on POSITION_ABSOLUTE so I looked to custom shaders)
Is there something wrong with my gocesiumtiler settings, or is this a bug? Can you offer any improvements to my gocesiumtiler parameters for a 3GB LAS?
Sandcastle with custom shader: ✅
DJI Terra generated tiles: ✅
Same dataset exported as LAS from DJI Terra and tiled with gocesiumtiler: 👎
gocesiumtiler file \
--epsg 32756 \
--resolution 1 \
--depth 8 \
--min-points-per-tile 5000 \
--out "tiles-gocesiumtiler" \
"my-point-cloud.las"
Note that the positions of both tilesets are the same, I have used this method of generating tiles for quite a while but I’ve only ran into problems now that I am using a custom shader.
What EPSG does this project support? My data is EPSG4545. What should I do? I need your help
If we are processing a las file that contains a number of points less than the value of maxpts
setting, then no las file is generated.
This can be reproduced using the las file from this comment:
#1 (comment)
and launching the executable as:
gocesiumtiler -input=D:\ripple.las -output=D:\out
We need to handle this special case properly.
Hi!
Are there plans to support 1.1 of the 3D Tiles Specification?
https://docs.ogc.org/cs/22-025r4/22-025r4.html
In short, some formats such as Batched 3D Model (b3dm), Instanced 3D Model (i3dm), Point Cloud (pnts) and Composite (cmpt) have been deprecated. Now all formats use glTF with extensions instead.
Hello,
I'm calling with the following command, but the 8-bit part is returning false, even though my LAS file has RGB and intensity values. I converted my RGB values to 8-bit using Laspy. However, when I visualize my points in Cesium, they appear black.
What could be the cause of this issue?
I found this error when I try it, as shown in the picture above.It looks like the path is fixed by error.
Please check it. thanks.
And i change the path like the picture, it run ok (a great feeling), I'm still try it.
I'll just rebuild it. the '.exe' file runs ok!Please provide a new '.exe' file!
Originally posted by @taozywu in #10 (comment)
Why does the function ConvertToWGS84Cartesian
not directly convert the source coordinates to EPSG:4978?
BTW, I think this comment should refer to EPSG:4978 instead of EPSG:4326:
After trying it with different Point Clouds, flag -f does not seem to work. After correctly processing the first file, an "octree already built" error appears.
Hello!
I have the same error with all my las files.
Do you have any working las file?
Best regards!!
Preparing list of files to process...
Processing file 1/1
reading data from las file... stadium_all.las
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x4d135d]
goroutine 1 [running]:
github.com/xeonx/proj4.(*Proj).Close(0x0)
C:/Users/user1/go/src/github.com/xeonx/proj4/proj.go:70 +0x2d
github.com/mfbonfigli/gocesiumtiler/converters.DeallocateProjection(...)
C:/Users/user1/go/src/github.com/mfbonfigli/gocesiumtiler/converters/converters.go:133
github.com/mfbonfigli/gocesiumtiler/lasread.(*LasFile).readPointsOctElem(0xc00008ac80, 0xc000042370, 0x10e6, 0x5d21e0, 0xc000448060, 0x0, 0x0)
C:/Users/user1/go/src/github.com/mfbonfigli/gocesiumtiler/lasread/tiler_las_reader.go:178 +0x45d
github.com/mfbonfigli/gocesiumtiler/lasread.(*LasFile).readForOctree(0xc00008ac80, 0xc000042370, 0x10e6, 0x5d21e0, 0xc000448060, 0x0, 0x0)
C:/Users/user1/go/src/github.com/mfbonfigli/gocesiumtiler/lasread/tiler_las_reader.go:61 +0x21c
github.com/mfbonfigli/gocesiumtiler/lasread.NewLasFileForTiler(0xc00000e367, 0x21, 0xc000042370, 0x10e6, 0x5d21e0, 0xc000448060, 0xc000006018, 0xc00007dd68, 0x2)
C:/Users/user1/go/src/github.com/mfbonfigli/gocesiumtiler/lasread/tiler_las_reader.go:26 +0x12f
main.readLas(0xc00000e367, 0x21, 0xc000042370, 0xc000018380, 0x5d21e0, 0xc000448060, 0x0, 0x0)
C:/Users/user1/go/src/github.com/mfbonfigli/gocesiumtiler/tiler.go:125 +0x97
main.loadLasInOctree(...)
C:/Users/user1/go/src/github.com/mfbonfigli/gocesiumtiler/tiler.go:114
main.RunTiler(0xc000018380, 0x0, 0x0)
C:/Users/user1/go/src/github.com/mfbonfigli/gocesiumtiler/tiler.go:84 +0x56e
main.main()
C:/Users/user1/go/src/github.com/mfbonfigli/gocesiumtiler/main.go:99 +0x8f9
The point cloud at the bottom was transformed using gocesiumtiler
The mesh at the top is a gltf file which was generated from the same point cloud file
I use pyproj(proj==9.0.0) to transform the coordinates from EPSG:2326 to EPSG:4978
The final display on Cesium shows that the gltf is correct in position and height, while the point cloud is correct in position but incorrect in height. What causes it?
My conversion command is as follows:
gocesiumtiler -i ./ hk.las -o ./ cesium -e 2326 -n 1.5
I have tried to implement numerous times but the message is always the same. How can I solve this problem? Apparently it has to do with the proj4 library
root@MSI:/home/rvp/gocesiumtiler# export CGO_LDFLAGS="-g -O2 -lm"
root@MSI:/home/rvp/gocesiumtiler# go build
go: downloading github.com/xeonx/proj4 v0.0.0-20151223112312-c52078bad901
go: extracting github.com/xeonx/proj4 v0.0.0-20151223112312-c52078bad901
go: downloading github.com/xeonx/geom v0.0.0-20151223130215-76a21efc1ce4
go: extracting github.com/xeonx/geom v0.0.0-20151223130215-76a21efc1ce4
go: finding github.com/xeonx/proj4 v0.0.0-20151223112312-c52078bad901
go: finding github.com/xeonx/geom v0.0.0-20151223130215-76a21efc1ce4
github.com/xeonx/proj4
pj_strtod.c: In function ‘pj_replace_point_by_locale_point’:
pj_strtod.c:79:2: warning: #warning "localeconv not available" [-Wcpp]
79 | #warning "localeconv not available"
| ^~~~~~~
Hello, what is the map projection code of the City of Melbourne 3D Point Cloud?
I find your repository for gocesiumtiler extremely helpful. I have a question: Do you have any plans to release a pre-compiled version for Linux systems in the future? I am not very familiar with the Go language, and having a pre-compiled Linux version would be of great help to me. Looking forward to your reply, and thank you in advance!
Hello, having an issue when running on MacOS Monterey (ARM).
Individual .LAS files are tiled perfectly, but getting a "octree already built" error on the second file, no matter the file, when run on a folder of .LAS files. I've tried changing the various algorithms and other flags and with different sets of files. It always crashes this same way on the second file. Is this a bug? or am I missing a flag or option?
example command gocesiumtiler -i ../smaller/ -o ../output/ -folder -r -b
example output:
Hello Massimo,
First, thank you for a great tool / library. This isn't really an issue, more of a question for you.
I have several huge obj files I'd like to tile without using cesium ion / 3rd party tools I have to pay for. There's really nothing great out there for this... so here I am exploring options for building my own. This project seems like a decent starting off point for such a tool, as it already outputs 3d tilesets, includes relevant libraries / math for reprojection, and seems to be well written / modular.
My questions for you:
First, thanks for providing such a powerful tool. It's great!
A few minor problems were found after the conversion, as follows:
I'm sorry for my poor english, Looking forward to your reply!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.