Beispiel #1
0
        public static ShapeObject BuildObject(byte[] bytes)
        {
            ShapeObject shp = new ShapeObject();

            if (bytes == null)
            {
                return(shp);
            }

            int iType = BitConverter.ToInt32(bytes, 0);

            if (IsPoint(iType))
            {
                shp.Type = GeometryType.Point;
                shp.Data = BuildPoint(bytes);
            }
            else if (IsMultipoint(iType))
            {
                shp.Type = GeometryType.Multipoint;
                shp.Data = BuildMultipoint(bytes);
            }
            else if (IsPolyline(iType))
            {
                shp.Type = GeometryType.Polyline;
                shp.Data = BuildPolyline(bytes);
            }
            else if (IsPolygon(iType))
            {
                shp.Type = GeometryType.Polygon;
                shp.Data = BuildPolygon(bytes);
            }
            else if (IsMultiPatch(iType))
            {
                shp.Type = GeometryType.MultiPatch;
                shp.Data = BuildMultiPatch(bytes);
            }
            return(shp);
        }
Beispiel #2
0
        public static ShapeObject BuildObject(byte[] bytes)
        {
            ShapeObject shp = new ShapeObject();
            if (bytes == null)
                return shp;

            int iType = BitConverter.ToInt32(bytes, 0);
            if (IsPoint(iType))
            {
                shp.Type = GeometryType.Point;
                shp.Data = BuildPoint(bytes);
            }
            else if (IsMultipoint(iType))
            {
                shp.Type = GeometryType.Multipoint;
                shp.Data = BuildMultipoint(bytes);
            }
            else if (IsPolyline(iType))
            {
                shp.Type = GeometryType.Polyline;
                shp.Data = BuildPolyline(bytes);
            }
            else if (IsPolygon(iType))
            {
                shp.Type = GeometryType.Polygon;
                shp.Data = BuildPolygon(bytes);
            }
            else if (IsMultiPatch(iType))
            {
                shp.Type = GeometryType.MultiPatch;
                shp.Data = BuildMultiPatch(bytes);
            }
            return shp;
        }