GPS is only so accurate. the best way is to mark the wheel on the tire facing down. then sitting on your bike roll it till that line is straight down and measure that that will give you the real wheel size. but PSI and weight can change it.
My first e-bike had 20 x 3.3 tires. I didn't know what wheel size to tell my display. Rolling would have been inaccurate unless I used a carpenter's level to measure when a mark on the sidewall was directly below the axle. I simply measured from the center the axle to the pavement. I used mm because they're simpler to read and write than 32nds. It was 290mm.
Next, I lashed a brake lever to prevent rolling and adjusted a rope on each side to hold it vertical. I put 100 pounds on the rack, over the axle. At 30 psi, the tire would have to add 3.3 square inches. If the axle height lost 3mm, that would make the odometer read 1% higher. The change in height was much smaller. Since then, I've read even if it had dropped 1%, the effect on the odometer would have been less because even if the radius is reduced, the tread length remains the same.
Twice 290 is a diameter of 580mm, or 22.83 inches. I chose 23, which would read 0.74% high. Close enough.
To test it I used a large-scale map of a circuit I ride. I broke down into a dozen or so straight segments, added up the mm, and used the scale to calculate the feet. Some days my odometer agreed exactly with the calculated distance, but the odometer could be several percent low. That bike used a geared Bafang motor. I figured the revolution sensor was erratic.
Another bike has 27.5 x 2.00 inch tires and a direct drive motor. Its odometer, too, could read right or several percent low.
Twenty years ago, I twice measured a walking track near here: 528 yards, or exactly 0.3 mile. There's a No Bicycles sign, but nobody walks there because lack of maintenance has left a rutted surface with clumps of grass. I tested both bikes there. I'd put a marker on the track at the bottom bracket, ride until 0.3 came up, put down another marker, measure, pick up the first marker, and ride until 0.6 came up. Etc.
It takes an effort to pedal no faster than 5 miles an hour. At that speed, both odometers were incredibly accurate. As I I rode a little faster, both odometers read low, perhaps more than 15%. As I rode still faster, both turned around and read high. On my fastest laps, I maintained 10 to 15 mph. The odometers read 60% high.
The wheel revolution sensor in a motor seems to be a magnet and a hall-effect transistor. One of them is on a holder than can bounce. Depending on the magnitude and frequency, this can result in undercounting or doublecounting.
The performance of these odometers seems to depend on how well I avoid or slow for violent pavement ripples, which can be invisible in daylight. Another kind of of wheel sensor is external to the motor, using a hall-effect transistor on the chain stay to detect the passage of a magnet on a spoke. I wonder if that's more reliable.