Whether the shutdown of the L train next year is a tolerable nuisance or a commuting disaster could depend on one factor: staying in your lane.

City, NYPD and MTA officials plan to aggressively keep dedicated street lanes clear of other vehicles to enable up to 80 buses an hour to speed across the Williamsburgh Bridge, replacing the L’s critical link between Brooklyn and Manhattan. Four new bus routes will be created.

When the planned 15-month shutdown begins in April, enforcement agents must make it a top priority to keep those bus, bike and high-occupancy lanes clear. Strict enforcement and tickets for violators will help many of the L train’s 225,000 daily riders escape a horrific hassle.

But if cars continue to double-park in bus and bike lanes, and other vehicles keep taking advantage of bus-only and HOV approaches to the Williamsburg Bridge, the commute will be hell.

So, it’s up to the city and MTA to make this work through enforcement and up to all New Yorkers to follow the traffic rules. And if this doesn’t work, those officials must consider creating a dedicated bus lane on the bridge.

All of the travel pain is necessary so the MTA can repair and replace signals, tracks, switches and walls in the Superstorm Sandy-damaged Canarsie Tunnel that brings the L under the East River.

The pain will be felt before April, too. Starting soon, the MTA will shut part of the line for preparatory work on 15 weekends. While weekend ridership isn’t as high as rush hour, and the bus- and HOV-restrictions and new Select Bus Service routes won’t fully be in place until next year, the bus replacement experiment should yield some early lessons. City officials should work quickly to get as many of the changes — such as priority traffic-signal timing, and turning lanes — into place.

Whether during weekend work, or once the full shutdown begins, if the bus lanes aren’t clear, life will be a living L.