When we first moved in we had a problem with NDNs cat pooing in a raised bed just outside our back door, I say in but it never went in. She'd dig a hole at the edge, manage to poo on the wall beside the hole and try to cover her empty hole with soil that had mainly gone on or over the wall. It stank and whenever we went into our garden we'd know she'd been around even before seeing the mess she'd made.
I took to using a trowel to pick it up and for a little while I'd dump the poo over the wall into NDNs bushes (sometimes miss and it would go in ours), but then remembered cats don't like citrus. Whenever we had an orange I would keep the peel and cut it up into tiny pieces and when had enough would spread it over the raised bed and surrounding wall, also put bits of the juice out and peel and juice of lemons if had used them. It only took two or three weeks to stop her using that bed as a litter tray, was expecting to have to repeat the orange every so often but she hasn't used it in the 2 years since. And orange is biodegradable so doesn't need picked up after use, just dig it in to the soil.
If you have a larger area to cover, a citrus spray might be useful as you'd need a lot of oranges to cover a whole garden, or a super soaker might be useful but you'd have to see the cats to squirt them. A motion activated sprinkler may help, but might not cover enough of your garden, you may need a few strategically placed ones.
A bit of water, citrus or vinegar etc. won't harm a cat (I used to have a lovely ginger and white cat, totally spoilt, still miss him after years of being without him so know a little about cats). And as for NDNs cat, she has befriended us and has just come in our window, climbed on my chest and rubbed her face and side across my face to get me to stop typing and stroke her. She is now sprawled out on my knee and will ask for some treats soon; and if my ironing board is still out after that she will lie on it and moult all over the cover! She also spent 2 days straight with us in the bad snow, she was here when it started snowing and wouldn't go out in it so she stayed. When I wrapped her in my coat and took her home NDNs weren't in, she leapt out of my coat and ran to underneath the cars where there was no snow, then ran into our house when I got back after taking the long way round (along the path, through the gate etc.) rather than her direct route over the fence. So she was not affected by the orange\lemon put out to deter her pooing in our garden, she still goes in our garden but doesn't poo in that particular bed. (Plus, her garden is bigger than ours so she should just use that.)