How do you stop cats from pooing on the grass or surrounded by patch of dirt?

A stray cat comes into my garden and poos right on the grass. Sometimes it will dig up a patch of dirt under the house and poo there. I've tryed two types of chemicals i bought from the garden shop but neither of them are working.
get a sawn off shot gun and blow its * brains to kingdom come!
you can sprinkle moth balls in the garden- apparently the cats dont similar to the smell. the problem is, if you are like me you wont like the smell any. there is also a spray you can buy that is supposed to repel pets- the problem with that one is that you enjoy to reapply every time it rains or when you water. i think the cat problem is so irritating, i suppose that's why some people poison the cats- owners should keep them indoors, i think.
Answers:    you can justifiably trap them and bring them in for destruction at the animal shelters in oregon, but it costs 25 dollars

and you have to hand over your name and info , which is publicly available, and to their "bad owners" who may try to take revenge on you

but you cannot kill in cold blood them yourself legally ... though a cop once told me, "he wouldn't tell"
Part of what "caylo2ooo" said is ok..However, unless you want to KILL the cat and any other animals that are external and come into your garden..DO NOT USE MOTHBALLS!!

MOTHBALLS WILL KILL ANIMALS..not just keep them away!

Citrus is supposed to work, but I haven't tried it. Good luck.
You can buy products that maintain the cats away. There are products with a strong smell that only cats can smell which they try to hold on to away from, there is also one that cats hear as a sighren but you can hear it.
sorry i dont know the names of the products, but you could probably by them at a super flea market and at a shop like B&Q or maybe in a pet store.
Good Luck! x
OBVIOUSLY THE CAT IS DOING WHAT ITS INSTINCT IS TO DO. IT IS HELPLESS AND IF YOU KILL IT ITS LIKE SOMEONE KILLING YOU FOR GOING TO THE TOILET. capture it trained or a litter box
I enjoy the same problem, dogs and cats both. I put cayenne pepper where they did it and they haven't been final to that spot anyway. It doesn't hurt the grass and you can get it in the spice department at your grocery store.
What is ur cat's term, age...etc?   Why do some cats miaow so much?   Would at hand be any form benefits to a cat by giving it alcohol such as beer ?   Will my cat go underwater from the moment floor?