private void AddMultiPolygon(DrawingContext context, SqlGeometry multiPolygon, Func <Point, Point> transform, Brush brush, Pen pen)
        {
            //There is no DrawPolygon method for DrawingContext so we should get the Geometry and use the DrawGeometry method
            var geometry = SqlSpatialToStreamGeometry.ParseSqlGeometry(new List <SqlGeometry>()
            {
                multiPolygon
            }, transform);

            context.DrawGeometry(brush, pen, geometry);
        }
        private void AddPoint(DrawingContext context, SqlGeometry point, Func <Point, Point> transform, Brush brush, Pen pen, double pointSize, SimplePointSymbol pointSymbol)
        {
            if (pointSymbol?.GeometryPointSymbol != null)
            {
                var temp = transform(point.AsWpfPoint());

                var geometry = SqlSpatialToStreamGeometry.Transform(
                    pointSymbol.GeometryPointSymbol,
                    new System.Windows.Point(temp.X - pointSymbolMinX - pointSymbolWidth / 2.0, temp.Y - pointSymbolMinY + pointSymbolHeight / 2.0));

                context.DrawGeometry(brush, pen, geometry);
            }
            else if (pointSymbol?.ImagePointSymbol != null)
            {
                Point location = transform(point.AsWpfPoint());

                context.DrawImage(pointSymbol.ImagePointSymbol, new Rect(location.X, location.Y, pointSymbol.SymbolWidth, pointSymbol.SymbolHeight));
            }
            else
            {
                context.DrawEllipse(brush, pen, transform(point.AsWpfPoint()), pointSize, pointSize);
            }
        }