yeesian / ArchGDAL.jl

A high level API for GDAL - Geospatial Data Abstraction Library
https://yeesian.github.io/ArchGDAL.jl/stable/
Other
137 stars 25 forks source link

factor out layer copying into its own function #382

Closed maxfreu closed 1 year ago

maxfreu commented 1 year ago

Hi! I have factored out the layer copying from writelayers into its own function. So basically I changed (pseudocode):

function writelayers()
  create() do
    copystuff
  end
end

to

function writelayers()
  create() do
    copylayers(src, dst)
  end
end

function copylayers(src, dst, ...)
  copystuff
end

That should now allow to copy data from and to arbitrary datasets, whether on disk or not. You can also give the layer indices you want to be copied. I added a tiny test for that. Furthermore I adjusted the docstrings for nicer rendering in the REPL. I'm not sure with the naming copylayers, is it ok? What do you think in general? Lastly, this supersedes https://github.com/yeesian/ArchGDAL.jl/pull/381, but I can take that part out if you want to merge this before the change to GDAL.

maxfreu commented 1 year ago

I've just made the requested changes except for one :)

maxfreu commented 1 year ago

I just removed the line superseding #381, as it's just a minor change anyway. Now it can be merged regardless of the changes in GDAL itself.

maxfreu commented 1 year ago

Oh I just saw that the GDAL PR had already been merged and that you closed #381. I'll put the line back tomorrow, then this can be merged.

maxfreu commented 1 year ago

Ok, done - sorry for the forth and back!