diff --git a/src/table.jl b/src/table.jl index 1fb75c3..7411a83 100644 --- a/src/table.jl +++ b/src/table.jl @@ -41,7 +41,7 @@ function Base.setproperty!(p::LazPoint, name, value, header) end end -function write(fn::AbstractString, table, bbox; scale=0.01, kwargs...) +function write(fn::AbstractString, table, bbox; scalex=0.01, scaley=0.01, scalez=0.01, kwargs...) schema = Tables.schema(table) isnothing(schema) && error("A Schema is required") @@ -50,12 +50,12 @@ function write(fn::AbstractString, table, bbox; scale=0.01, kwargs...) rows = Tables.rows(table) header = LazHeader(;kwargs...) - header.x_offset = determine_offset(bbox.min_x, bbox.max_x, scale) - header.y_offset = determine_offset(bbox.min_y, bbox.max_y, scale) - header.z_offset = determine_offset(bbox.min_z, bbox.max_z, scale) - header.x_scale_factor = scale - header.y_scale_factor = scale - header.z_scale_factor = scale + header.x_offset = determine_offset(bbox.min_x, bbox.max_x, scalex) + header.y_offset = determine_offset(bbox.min_y, bbox.max_y, scaley) + header.z_offset = determine_offset(bbox.min_z, bbox.max_z, scalez) + header.x_scale_factor = scalex + header.y_scale_factor = scaley + header.z_scale_factor = scalez p = LazPoint() diff --git a/test/testio.jl b/test/testio.jl index 61dccbe..72204fe 100644 --- a/test/testio.jl +++ b/test/testio.jl @@ -71,7 +71,7 @@ end @test first(ds) isa LazIO.LazPoint @inferred first(Tables.rows(ds)) - LazIO.write("test_table.laz", ds, LazIO.bounds(ds), scale=0.1) + LazIO.write("test_table.laz", ds, LazIO.bounds(ds), scalex=0.1) close(ds) manual_fn = "test_table_manual.laz" @@ -83,7 +83,7 @@ end return_number = [1,2,1], number_of_returns = [1,2,3]) bounds = (min_x = 11000.01, max_x = 32000., min_y = 11000., max_y = 32000., min_z = 11000., max_z = 32000.01) - LazIO.write(manual_fn, table, bounds, scale=0.01, system_identifier=LazIO.writestring("Laser shooter, pew pew!", 32)) + LazIO.write(manual_fn, table, bounds, scalex=0.01, system_identifier=LazIO.writestring("Laser shooter, pew pew!", 32)) ds = LazIO.open(manual_fn)