Police often fail to remember they have discretion in some matters. In this case I would understand it if the officer simply told me to close up shop and I complied. Why the ticket?
Years ago when G. Gordon Liddy had a large radio show he was criticizing the National Park police for arresting a woman who had picked up some eagle feathers. The feathers were not attached to an eagle, they were laying on the ground. Strictly speaking, the law said possession of eagle feathers was illegal. After he got done calling it a silly arrest a member of the park police called in and started arguing about it. This "officer" was infuriating. Everything was black and white to him. "She broke a law". "Sir have you ever heard of prosecutorial discretion?". "Our job is to enforce the law to the letter". Back and forth it went. The Barney Fife complex that infects too many people with badges.