Unless arrested, never give ID to a LEO. Never consent to a search of body or processions.
why?
Ask Theses.
He was on private property, w/o knowledge of a school zone, and Unloaded open carrying. He was questioned by LEO's and released. Weeks later, he was arrested and then charged and convicted of having a gun inside a gun free zone. The judge would not let him put on a honest defense.
Theseus did not GIVE his ID to the LEO. Theseus did not CONSENT to a search.
The LEO illegally searched him, illegally took his wallet, and illegally took his ID out of his wallet. They then let him go as he had done nothing illegal, he was on private property and private property is exempt from PC 626.9.
The officer, or the DA, later researched the laws, and did the measurements from the school property, and issued a warrant for his arrest. If the illegal siezure of his ID had never taken place, he would have never received the summons. The judge then took case law specific to PC 12031 and blatently misapplied it to PC 626.9 and railroaded Theseus.
If you are going to UOC in CA, do sterile UOC. Do not give the officer the chance to come back later after thinking up something to charge you with.