I've actually been caught by the police twice. You might want to add this to OP, because so far it hasn't failed me.
Basically, we were in a building when a car pulled up the front. I was with two other friends and it was late night so we we freaked out at first but then we decide to approach the officer slowly. He basically said that this the area was a dangerous site and that it had been blocked off for a reason. Since I had my camera and tripod and all my lighting stuff with me, I said I was an art student out to take some arty pictures, and that I brought some friends to help me out. Hardly warning- just talked to the policeman and he was like "Yeah, okay, just pack up and move on."
Seriously, talking to the officer helps you out so much. Every time I say I'm an art student looking for some interesting photos- which is true. If you take a fancy camera and a tripod with you, as far as the officer is concerned all you really are is just some guy looking for snaps.
Worked both times.
If you can't run away or hide, hand yourself over. It's so much less suspicious if you do that, and it makes the officer's job easier... Just be sure it's actually a police officer and not some scary bikie gang.