computing extent for sw viewer