Open ftomassetti opened 11 years ago
Maybe use bin data:
path = '/Users/federico/my_world/eroded' File.open(path, 'rb') {|file| data = Marshal.load(file) }
class Map3 < BinData::Record array :numbers, type: :float_le uint16le :width uint16le :height end
(0..1999).each do |y| (0..2999).each do |x| m.numbers << om[y][x] end end
destpath = '/Users/federico/my_world/eroded_reduced' File.open(destpath, 'wb') do |io| r = Rectangle.write(io) end
Verify if putting with and height before numbers a nd resplitting the eroded huge file now works (branch binarymap)
Try with something in Java, maybe using the MappedByteBuffer
Maybe use bin data:
path = '/Users/federico/my_world/eroded' File.open(path, 'rb') {|file| data = Marshal.load(file) }
class Map3 < BinData::Record array :numbers, type: :float_le uint16le :width uint16le :height end
(0..1999).each do |y| (0..2999).each do |x| m.numbers << om[y][x] end end
destpath = '/Users/federico/my_world/eroded_reduced' File.open(destpath, 'wb') do |io| r = Rectangle.write(io) end