Interactions with police can be smooth and cordial, or acrimonious and hostile.
When street-camping in Santa Cruz one summer (wasn't homeless, had a home, just wasn't there for a while heh,) I was resting on some sort of metal cabinent with electrical utilities or something on a sidewalk early in the evening. Noticed a police car rolling slowly up the road some ways away shining his search light into the dark. Figuring he was looking for someone I stayed put. When he got to me he stopped and got out and I greeted him pleasant as can-be, "Hi! Who ya looking for?" to which he replied, "You." Flattered I responded, "Me? Well here I am." smiling. Asked my business to which I replied just resting a bit after walking around all day. Which was true. And he asked for my identification which I had. Ran the checks and whatever they do with it then gave it back. Then said someone called about someone loitering and I should get on my way to which I said ok. Then he left.
Instead of giving the officer lip or making a federal case out of it asserting my right to sit where I bloody want (which I do,) I complied and avoided a bad scene. Whole thing last maybe 2 mins.
I gotta think this situation at the pools could have been avoided by simply helping make an officer's day go as smoothly as possible without being a total dick. When you begin getting mouthy or saying "no" to an officer, they're thinking "disorderly conduct." And that's gonna be what results in your being placed in handcuffs 90% of the time.
Knowing is half the battle.