Just a cautionary word or two and a bit of advice.
Firstly, it is not legally possible for a cat to be guilty of trespass. So if you were to injure a cat on purpose (trap/rock/airgun), you can be prosecuted. Secondly, it isn't really their "fault" - it is just in their nature, so while I sympathise with you, it is not like they are doing it on purpose!
I have two cats, and they tend to poo in a box in the hallway rather than outside (even though they are allowed out when we are at home). I can see how it is frustrating for a homeowner to get unsolicited cats in their garden.
What I know works (from being a homeowner with no cats, to being a homeowner with cats):
1. Get a cat. As soon as you get any other cats in your garden, yours will chase it away. Plus if you drop anything food-ish on the floor indoors, by the time you bend down to wipe it up, the cats will have eaten it anyway
2. We keep our cats locked in at night so they do not get into fights/get injured/cause trouble (like crapping in other people's gardens!) This then meant when other cats were coming into our garden at night time, ours were getting wound up because they couldn't go out to scare them off. We got an ultrasonic cat scarer from b&q for £39 (yes I know it is a bit pricey) which scared off other cats, but for some reason, ours did not mind it.
3. Keep your grass short. Cats only poo if they can bury it to cover their tracks (to avoid alerting predators to their presence). In the absence of gravel to poo in, they will go in long grass.
4. Cats DEFINITELY do not like pepper. I ate something which had pepper on it, and i put the plate on the dining room floor to let the cats have a go (letting them try all sorts of food means that they do not even think about looking in rubbish bags!) One cat just avoided it, the other (more greedy) one, ran up to the plate, sniffed it, then ran away. FAST. Pepper works in the garden but it gets washed away in the rain.
5. There are cat deterrent granules you can get but I am not sure about how effective they are.
Hope some of this helps.