New technologies can help close the gaps between the government and the public. But they’re not without risks. In recent decades, cities have become increasingly adept at amassing all sorts of data.