/// <summary> /// Changed but not tested. 93.03.21 /// </summary> /// <returns></returns> public byte[] AsWkb() { List <byte> result = new List <byte>(); if (this.Parts.Count() == 1) { result.AddRange(OgcWkbMapFunctions.ToWkbLineStringZM( ShapeHelper.GetPoints(this, 0), ShapeHelper.GetZValues(this, 0), ShapeHelper.GetMeasures(this, 0))); } else { result.Add((byte)IRI.Standards.OGC.SFA.WkbByteOrder.WkbNdr); result.AddRange(BitConverter.GetBytes((uint)IRI.Standards.OGC.SFA.WkbGeometryType.MultiLineStringZM)); result.AddRange(BitConverter.GetBytes((uint)this.parts.Length)); for (int i = 0; i < this.parts.Length; i++) { result.AddRange( OgcWkbMapFunctions.ToWkbLineStringZM( ShapeHelper.GetPoints(this, this.Parts[i]), ShapeHelper.GetZValues(this, this.Parts[i]), ShapeHelper.GetMeasures(this, this.Parts[i]))); } } return(result.ToArray()); }
//Error Prone: not checking for multipolygon cases public byte[] AsWkb() { List <byte> result = new List <byte>(); result.Add((byte)IRI.Standards.OGC.SFA.WkbByteOrder.WkbNdr); result.AddRange(BitConverter.GetBytes((uint)IRI.Standards.OGC.SFA.WkbGeometryType.Polygon)); result.AddRange(BitConverter.GetBytes((uint)this.parts.Length)); for (int i = 0; i < this.parts.Length; i++) { result.AddRange(OgcWkbMapFunctions.ToWkbLinearRing(ShapeHelper.GetEsriPoints(this, this.Parts[i]))); } return(result.ToArray()); }
public byte[] AsWkb() { //byte[] result = new byte[1 + 4 + 4 + 16 * this.NumberOfPoints]; List <byte> result = new List <byte>(); result.Add((byte)IRI.Standards.OGC.SFA.WkbByteOrder.WkbNdr); result.AddRange(BitConverter.GetBytes((int)IRI.Standards.OGC.SFA.WkbGeometryType.MultiPoint)); result.AddRange(BitConverter.GetBytes((UInt32)this.NumberOfPoints)); for (int i = 0; i < this.NumberOfPoints; i++) { result.AddRange(OgcWkbMapFunctions.ToWkbPoint(this.points[i])); } return(result.ToArray()); }
public byte[] AsWkb() { return(OgcWkbMapFunctions.ToWkbPoint(this)); //byte[] result = new byte[37]; //Array.Copy(BitConverter.GetBytes((byte)IRI.Standards.OGC.SFA.WkbByteOrder.WkbNdr), 0, result, 0, 1); //Array.Copy(BitConverter.GetBytes((int)IRI.Standards.OGC.SFA.WkbGeometryType.PointZM), 0, result, 1, 4); //Array.Copy(BitConverter.GetBytes(this.X), 0, result, 5, 8); //Array.Copy(BitConverter.GetBytes(this.Y), 0, result, 13, 8); //Array.Copy(BitConverter.GetBytes(this.Z), 0, result, 21, 8); //Array.Copy(BitConverter.GetBytes(this.Measure), 0, result, 29, 8); //return result; }
public byte[] AsWkb() { return(OgcWkbMapFunctions.ToWkbPoint(this)); }