CesiumGS / 3d-tiles-tools

Apache License 2.0
315 stars 47 forks source link

createTilesetJson with cartographicPositionDegrees failed #126

Closed dlyltm closed 6 months ago

dlyltm commented 6 months ago

createTilesetJson from b3dm file without cartographicPositionDegrees is ok, but fails with this Flag. Additionally, cartographicPositionDegrees prefix with double "-" points out "Unknown arguments". See screenshot for details. ScrSht1 ScrSht2

javagl commented 6 months ago

I do see the same error message when I'm using -cartographicPositionDegrees (with a single dash). I agree that this error message is ... "not very helpful", to say the least. But it's coming from somewhere deep inside the yargs command line parsing library, and I'll have to check whether there is a way to cause a more helpful message here...

Using --cartographicPositionDegrees (with two dashes) should work. The reason why you are seeing this error message is most likely that you are using the version of the tools that is currently released on NPM (which is version 0.4.1 at the time of writing this). The cartographicPositionDegrees parameter was introduced with this PR, and this is not yet part of the release.

However, you can already use the cartographicPositionDegrees when you run a local copy of the current state of the tools:

For example, running something like npx ts-node ./src/cli/main.ts createTilesetJson -i ./input -o ./output/tileset.json --cartographicPositionDegrees 100 40 10 should then work, and print something along the lines of

[13:46:43.150] INFO (CLI): Creating tileset JSON with content URIs: exampleA.glb,exampleB.glb,exampleC.glb
[13:46:43.291] INFO (CLI): Creating tileset at cartographic position: 100,40,10 (in degress)
[13:46:43.293] INFO (CLI): Total: 145.090 ms

If this doesn't work, just drop a note here.


BTW: Creating a new release (with this new functionality) has been on my TODO list for quite a while now, and it is overdue. And the createTilesetJson function seems to be one that is used by many people. I'd like to get some additional functionality into that new release, but if the schedule doesn't work out, we might release one that resembles the current state of the repo.

dlyltm commented 6 months ago

I just try. It works. Thanks.

javagl commented 6 months ago

Then I'll close this for now. Creating a new release (with the extended createTilesetJson functionality) is already on the roadmap, and hopefully, it can be released soon.