private static double GetCellWidth(RasterGridPrescription prescription) { var cellWidth = 0.0; if (prescription.CellWidth != null) cellWidth = prescription.CellWidth.Value.Value; if (prescription.BoundingBox != null && prescription.BoundingBox.MinX != null && prescription.BoundingBox.MaxX != null) cellWidth = Math.Abs(prescription.BoundingBox.MaxX.Value.Value - prescription.BoundingBox.MinX.Value.Value) / prescription.ColumnCount; return cellWidth; }