geoflow3d / gfp-building-reconstruction

Geoflow plugin for building LoD2 reconstruction from a point cloud
GNU Affero General Public License v3.0
13 stars 4 forks source link

Set coordinate precision to millimeter #23

Open balazsdukai opened 4 years ago

balazsdukai commented 4 years ago

Supposedly the precision of the coordinates is set to 6 digits, while 3 decimal places (millimeter) should suffice.

[...] There is a precision difference between the TIN (up to 3 digits after the comma) and the buildings shapefile (up to 6 digits after the comma) that we use to get the reflection points. [...]

The TIN comes from 3dfier.

Ylannl commented 4 years ago

Building coordinates are shifted to towards the origin and then represented as float. There is no way to set the precision in this plugin. It's just floating point arithmetic.

In some OGR drivers it is possible to specify a precision, but for most (GPKG, SHP) I assume they also just use a float. Eg WKB seems to use 64bit floats as well: https://mariadb.com/kb/en/well-known-binary-wkb-format/ . So not possible to control the precision as far as I understand.

balazsdukai commented 4 years ago

Good point.

The 3 decimal places comes from text based formats, eg. cityjson, obj, where the coordinates in the 3dfier output are rounded up (or truncated?) to 3 dp.

But since this plugin's primary output is postgis, then we'll handle the precision when exporting from postgis.

I'm going to leave this open here, because I'm not sure where else to put it for now.