Just 2 ½ weeks after state lawmakers abandoned plans to gut the Public Records Act, the state Supreme Court issued a ruling that highlighted why the law is essential to keep local governments in line.

The high court Monday unanimously concluded that governments must turn over mapping data without charging exorbitant fees. It was a major victory for public access to electronic government records. But the case took six years to resolve.

At issue was Orange County's assertion that it didn't have to turn over electronic parcel maps to the Sierra Club. The county kept the data in standard geographic information system (GIS) file format that could be easily read with most mapping software. But the county developed its own software, so it also argued that it could make release of the data conditional on payment of a licensing fee for its software.

It all violated the spirit and letter of state law, which requires local governments to turn over data in electronic format if they keep it that way, and to charge only the actual cost of duplication.

Electronic data -- be it spreadsheets, maps, email or databases -- often is far more useful for analysis than paper. It provides a key tool for essential public monitoring of government actions.

Many investigative stories in this newspaper rely on electronic government data, which is why we supported a friend-of-the-court brief backing the Sierra Club. The environmental group had sought mapping data to determine which open spaces were protected by conservation easements and which were threatened by development.

To be sure, state law allows local governments to protect, and charge for, software they develop. But Orange County argued that protection extended to the data. They took that position even though the state attorney general had issued a contrary opinion in 2005 -- and even though 47 of the California's 58 counties provide access to GIS data.

Ironically, until public outcry forced the Legislature and Gov. Jerry Brown to reverse course on June 20, they had planned to suspend parts of the Public Records Act, including the requirements that local government release electronic data.

The state must reimburse local governments for costs of complying with laws imposed since 1975, so lawmakers had wanted to save money by making the laws voluntary. They argued that local governments would obey the Public Records Act even though they didn't have to.

Yeah, right.

The League of California Cities and the California State Association of Counties backed Orange County's position before the Supreme Court. In 2009, Santa Clara County lost a similar case in the state Court of Appeal.

As these cases show, local governments can't be counted on to just do the right thing.