VCityTeam / py3dtilers

Tilers accepting various input formats (OBJ, 3DCity databases, GeoJson, IFC) and producing 3DTiles tilesets.
Other
186 stars 50 forks source link

Remove hardwired geographical coordinates system code #5

Closed EricBoix closed 2 years ago

EricBoix commented 3 years ago

Within IfcTiler/ifcObjectGeom.py code like

transformer = Transformer.from_crs("EPSG:27562", "EPSG:3946")

hard-wires

Such a rewriting/conversion should be within the Tiler but outside of it. Let the Tiler produce a 3dTiles using the projection system of it's input. Then write a 3dTiles converter utility (CLI) that converts the projection system. This would separate the concerns.

clementcolin commented 2 years ago

In order to write a clean 3DTiles converter utility, there is some work to be done in py3dtiles first. Indeed, there is currently no 3DTiles (tileset.json) reader :

Once we are able to read a tileset, we should then be able to modify it, i.e, in this case, change the projection system used.

A quick but dirty solution would be a script that load the tileset.json and look for transformation and extent matrices in order to modify them.

EricBoix commented 2 years ago

Concerning the 3dtiles deserialization process refer to this issue.

LorenzoMarnat commented 2 years ago

This PR introduce crs_in and crs_out flags. The crs_in flag allows to specify the input CRS (default is EPSG:3946). The crs_out flag projects the geometries in another CRS (default output CRS is EPSG:3946). Those flags can be used by any tiler inheriting from Tiler class.

Example with the IfcTiler

ifc-tiler path/to/ifc --crs_in EPSG:4171 --crs_out EPSG:3946