When and how were relative distances to the planets first measured?

I understand that the absolute distance to a planet can be measured using earth-baseline (e.g., diurnal) parallax, and that the first reasonably accurate such measurement was made for Mars by Cassini (and his assistant Richer) in 1672, and then, famously (with some modifications) for Venus by Halley, Cook, and others and others during its 1769 transit; but when were earth-baseline *relative* distance measurements first made for each of the planets?

Interpretation of such measurements requires assumptions about the nature of the orbits of planets, but some of the most compelling evidence for the validity of these assumptions is Kepler's third law of planetary motion, the persuasiveness of which itself rests on observations of relative distances. In fact, all of my texts say, in effect, that the third law "fit" the observed pattern of orbital period and relative distance.

Where did these distance measurements come from? What relative distance measurements were available to Kepler in 1619? When was earth-orbit-baseline parallax used to make these measurements for each of the planets?

The relative distances to the planets is fixed immediately by Copernican model, and this is what makes heliocentrism ten thousand times better than geocentrism, even without any known physical cause for the orbits.

The relative distances are fixed from the radius of the epicycle — the epicycle transfers Earth's orbit onto the planet, and the ratio of the epicycle radius (not the angular extent, which also includes the planet's motion along the deferent) to the deferent size in the Copernican interpretation directly gives the ratio of the Earth's orbit to the planet's orbit. The relative size of Venus and Mercury's orbit, relative to the Earth's distance from the sun, is given by the maximum in angle they get away from the sun.

This is not surprising, because the epicycle radius is giving you the parallax from the point of view of the Earth's orbit of the different planets. Once you know the absolute size of Earth's orbit, you know the distance to everything else, which is why the Earth's orbit is called the "Astronomical Unit".

This means that just Brahe's observations are sufficient to fix the entire solar system size except for the absolute scale of the Astronomical unit. The location of all the planets in 3 dimensions is completely determined from the assumption that the Earth's orbit is shared between all of them. The fact that the epicycles all are given by a one-year orbital period for the Earth is Baysian-wise extremely compelling evidence for heliocentrism without anything further to say.

This is why it is not correct to say that geocentrists were somehow justified, or had any valid points, or were anything other than the dimwitted reactionaries that they were. This includes Ptolmey, who buried the heliocentric work of Appolonius for political reasons, although even the most casual astronomer of the era was aware that heliocentrism was correct.