An 18-year-old masturbating in his van at an intersection near a primary school was caught by a mother walking with her young children.

Kaspar Jay Van Hattum pleaded guilty to a charge of committing an indecent act.

At the New Plymouth District Court today, Judge Chris Sygrove sentenced Van Hattum to 12 months' supervision and ordered he complete counselling to the satisfaction of a probation officer.

At about 9.30am on November 28 last year, Van Hattum was parked on Sackville St in Fitzroy in his van, a police summary of facts said.

He was holding an electronic device with headphones in and masturbating with his free hand.

The victim said she walked past with her children on her way to school to deliver her son's lunch that he had forgotten, and saw him.

She continued walking to school and when she returned he was still in the van masturbating.

She informed police.

In a victim impact statement read aloud by the judge, the victim said she was worried about what Van Hattum was watching and why he was parked near a primary school.

She said she hoped he got the help he needed to get better.

Van Hattum's lawyer Julian Hannam said the young man was about to start university and a conviction would affect his ability to thrive in his area of study.

There was a risk employers would view Van Hattum as a sex offender if he had this conviction on his record, Hannam said.

However police prosecutor Craig Jones said that was a normal consequence of being dealt with in the courts on such matters.

"The defendant should not be able to hide that particular background from bodies that may want to check on employees before employing them," Jones said.

When police spoke to him Van Hattum admitted the facts and said it was "nice and warm and fine" in his vehicle.

In sentencing Van Hattum, the judge took into account the fact it was a public place, his lack of insight into the effect his offending had on members of the public.