i'm gonna double check this with a couple of lawyer friends of mine. it has always been my understanding that the police have to have reasonable grounds to believe you've broken the law before you're obliged to give them your details if you were just walking down the street or, as Horatio was, in his place of work minding his own business.
obviously if you're behind the wheel of a car and they want to verify you have a driving license/you're insured etc. that's different.
....The Police are unlikely to waste time challenging you for anything unless they are given reason to suspect you may have broken the law in some way. So if they go as far as stopping you, you are consequently under suspicion and therefore obliged to cooperate and give details if asked.
If you are innocent and, importantly, don't give them attitude you will come to no harm - Why should you?