def commit
@shp.close
@shp_r = open(@shp.file_root + ".shp", "rb")
@dbf_r = open(@shp.file_root + ".dbf", "rb")
@shp_io = open(@shp.file_root + ".shp.tmp.shp", "wb")
@shx_io = open(@shp.file_root + ".shx.tmp.shx", "wb")
@dbf_io = open(@shp.file_root + ".dbf.tmp.dbf", "wb")
index = commit_delete
min_x,max_x,min_y,max_y,min_z,max_z,min_m,max_m = commit_add(index)
commit_finalize(min_x,max_x,min_y,max_y,min_z,max_z,min_m,max_m)
@shp_r.close
@dbf_r.close
@dbf_io.close
@shp_io.close
@shx_io.close
FileUtils.move(@shp.file_root + ".shp.tmp.shp", @shp.file_root + ".shp")
FileUtils.move(@shp.file_root + ".shx.tmp.shx", @shp.file_root + ".shx")
FileUtils.move(@shp.file_root + ".dbf.tmp.dbf", @shp.file_root + ".dbf")
@deleted = Hash.new
@added = Array.new
@shp.reload!
end