Would you do it on a train?
Would you do it on a plane?
Would you do it in full view?
Yes you would, you rascal you!
Would you do it in a car?
Would you do it in bar?
Would you do it in a school?
Oh my gosh! You broke the rules!
Would you do it in the street?
Lying down or on your feet?
Would you do it on the floor?
Better not you’ll break the law!
Would you do it in the park?
Even if it isn’t dark?
Would you do it after dinner?
In the kitchen! What a sinner!
Would you like to whip it out?
When the public’s all about?
Better not to take the chance.
And keep your pecker in your pants.

With aplologies to Dr. Seuss
Well, that depends… maybe Littering, maybe Loggin without a license…
There is a beautiful overlook I know of off of Route 30 in Pennsylvania. You turn into the woods on a dirt trail and drive about a quarter mile through forrest, coming out on the edge of a cliff overlooking an incredible view of the valley below. Very nice place. If you ignore the dozens of used condoms that litter the ground. Eeeew.
Back to the OP wouldn’t the particular statute you were charged under depend on who or what or even how you were having sex with in the car/plane/theatre/dressing room? or are we assuming for the purpose of the question it was sex between consenting adults which didn’t violate any local sodomy laws?
mm
It’s only illegal if you get caught. And then not all the time.
I have been sent on my way more than once.