public uint PackIndex(long x, long y)
{
// Convert to signed 16-bit so sign bit is in bit 15
Int16 xs16 = (Int16)x;
Int16 ys16 = (Int16)y;
// convert to unsigned because we do not want to propagate sign bit to 32-bits
UInt16 x16 = (UInt16)xs16;
UInt16 y16 = (UInt16)ys16;
uint key = 0;
key = (uint)((x16 << 16) | y16);
return key;
}
/// <summary>