计算local density