This practice of "carding" pedestrians is currently big news in Toronto. Mainly because of the demographic typically being "carded". The provincial government is working on legislation to ban the practice and I believe the Mayor of Toronto (sorry, no longer Rob Ford) has put an end to it recently.
Didn't know about this. Kind of funny how they knew it was illegal to begin with to force folks to present ID randomly:
Carding is a practice that involves officers stopping citizens and storing their details in a police database. Data shows that in Toronto, Mississauga, Brampton and London, black individuals are more than three times as likely to be carded than whites. The data also shows that other visible minorities are disproportionately stopped.
Anyone who is being carded can legally walk away from police.
Source Random or arbitrary police carding will stop, province says | Toronto Star
There were some people parking what I thought was illegally at an intersection near where I lived in Texas. I called the non emergency police number to simply ask if they were supposed to be parking there. They said "we will send someone right over" and hung up. Next thing I knew two police officers were at my door and said "they are allowed to park there. Can we see your ID?" Very bizarre. I did since as Nigel said you risk just pissing them off but really didn't make sense. I wasn't reporting anything, just asking a question.
Wow. WTH were they thinking.