OpenDroneMap / Obj2Tiles

Converts OBJ files to OGC 3D tiles by performing splitting, decimation and conversion
GNU Affero General Public License v3.0
214 stars 62 forks source link

Add ability to specify coordinate system units on a command line #49

Open andreiveselov opened 1 year ago

andreiveselov commented 1 year ago

First of all, thank you for taking the time to report an issue.

Before you continue, make sure you are in the right place. Please open an issue only to report faults and bugs. For questions and discussion please open a topic on http://community.opendronemap.org/c/opendronemap.

Please use the format below to report bugs and faults.


What is the problem?

We have OBJ meshes created using different coordinate systems. Some are UTM and use meters, some are State Plane coordinate system for US and they might use feet as units. If I ran Obj2Tiles on UTM created meshes and specify center longitude, latitude and altitude, everything is positioned correctly in Cesium. If I do the same with datasets that use feet, data is scaled incorrectly, since feet are used for X,Y,Z offsets and not meters.

I assume I can try to modify transformation matrix by multiplying it with a scale matrix for X,Y,Z, but would we good to have it as a part of a command

What should be the expected behavior?

Ideally, would be good to have ability to specify a unit as part of a command. Maybe have "--u meter" or "--u feet". If no unit is specified, then we can assume meters for backward compatibility.

How can we reproduce this? THIS IS IMPORTANT. What steps did you do to trigger the problem? If this is an issue with processing a model, YOU MUST include a copy of your model uploaded on Google Drive or Dropbox (otherwise we cannot reproduce this) along with the command line parameters you used to process it.

[I would be able to create a sample dataset if needed]

PerspectivesLab commented 1 year ago

@andreiveselov do you know the default input unit currently in Obj2Tiles ? is it inches or meters ?

andreiveselov commented 1 year ago

@andreiveselov do you know the default input unit currently in Obj2Tiles ? is it inches or meters ?

@PerspectivesLab , I believe it assumes that everything is in meters. I have a PR opened for review to allow units scaling: https://github.com/OpenDroneMap/Obj2Tiles/pull/52