Earlier quoted context omitted.
I got a ticket for one of these types of things, some local ordinance prohibiting through traffic during rush hour. It's a great revenue generator for the local PDs. Lots of one-off traffic laws that people passing through won't (and really, can't) know about.
There's no way that the trickle of revenue is greater than the cost of enforcement. Officer salary and benefits, equipment maintenance, and all the costs associated with the court system...
I don't know why you'd think it couldn't be greater than the cost, either. It takes, what, five minutes to write a ticket, which might average $100? That's $1,200/hour of revenue. No way the officer costs that much, even including benefits and equipment. Most people just pay tickets, they don't contest them, so court costs will be small.