Depending on where you live, you may spend a good deal of your time sitting in traffic, and a good deal of your money paying for gas and insurance.

On the other hand, your commute might involve rocketing over a smooth, well-maintained open highway, waving at the occasional fellow driver, keeping one eye peeled for deer, and wondering if you'll make it to the next gas station 100 miles away.

Positive driving experiences may be somewhat subjective, but to identify the states with the best and worst driving experiences, personal finance site WalletHub compared all 50 states across 30 key indicators of a positive commute. The data set ranges from average gas prices to share of rush-hour traffic congestion to road quality.

Some of the main factors that were ranked include:

Cost of ownership and maintenance: Cost of gas, insurance, maintenance and other costs.

Traffic and infrastructure includes number of days with precipitation or ice and other weather factors, road and bridge quality, average commute time and roadway miles per 1,000 persons.

Safety includes incidents of poor behavior, fatalities, car thefts, strictness of DUI punishment and other laws, and... the likelihood of hitting a deer.

Access to vehicles and maintenance evaluates the availability of car dealerships, car washes, repair shops, gas stations and parking.

Based on WalletHub's study, these are the best and worst states to drive in 2019.