/// <summary> /// 获取Tile的范围四至 /// </summary> /// <returns></returns> public LngLatBbox GetBbox() { var cellSize = new CellSize(); var cell = cellSize.GetCellSizeInDegree(Level); var L = new LngLatSegments(this.Corner.Lng.Code >> (32 - Level) << (32 - Level), true); var B = new LngLatSegments(this.Corner.Lat.Code >> (32 - Level) << (32 - Level), false); var bbox = new LngLatBbox(); if (L.G == 1) { bbox.East = L.Degree; bbox.West = bbox.East - cell; } else { bbox.West = L.Degree; bbox.East = bbox.West + cell; } if (B.G == 1) { bbox.North = B.Degree; bbox.South = bbox.North - cell; } else { bbox.South = B.Degree; bbox.North = bbox.South + cell; } return(bbox); }
public LngLat(string dms) { var str = dms.Split(","); this.Lat = new LngLatSegments(str[0]); this.Lng = new LngLatSegments(str[1]); }
public void DecodeLngLat(ulong code, ref double lat, ref double lng) { var morton = new Morton2D(); uint L = 0; // 横轴 uint B = 0; // 竖轴 morton.Magicbits(code, ref L, ref B); lng = new LngLatSegments(L, true).Degree; lat = new LngLatSegments(B, false).Degree; }
public void DecodeLngLat(UInt64 code, ref double lat, ref double lng) { var morton = new Morton2D(); UInt32 L = 0; // 横轴 UInt32 B = 0; // 竖轴 morton.Magicbits(code, ref L, ref B); lng = new LngLatSegments(L, true).Degree; lat = new LngLatSegments(B, false).Degree; }
/// <summary> /// 构造函数 /// </summary> /// <param name="b">SOT角点二维编码下侧</param> /// <param name="l">SOT角点二维编码左侧</param> public LngLat(UInt32 b, UInt32 l) { this.Lat = new LngLatSegments(b); this.Lng = new LngLatSegments(l); }
public LngLat(double lat, double lng) { this.Lat = new LngLatSegments(lat); this.Lng = new LngLatSegments(lng); }
/// <summary> /// 构造函数 /// </summary> /// <param name="b">SOT角点二维编码下侧</param> /// <param name="l">SOT角点二维编码左侧</param> public LngLat(uint b, uint l) { this.Lat = new LngLatSegments(b, false); this.Lng = new LngLatSegments(l, true); }
public uint EncodeLngLat(double x) { var segs = new LngLatSegments(x); return(segs.G << 31 | segs.D << 23 | segs.M << 17 | segs.S << 11 | segs.S11); }