Re: Numerical Limits in SVG coordinates?

On Mon, Feb 2, 2015 at 5:41 PM, Amelia Bellamy-Royds <> wrote:

> Ooops!  That's what I get for whipping up an answer without actually
> testing anything...  Thanks for checking Rik.
> I didn't look closely to see how small the deltas were compared to the
> magnitude in the shape coordinates.   I looked at the viewBox, and thought
> the overall coordinate system dimensions to absolute value was still
> reasonable enough that the lower-precision digits wouldn't be significant.
> I didn't factor in the transform on the shape.

There's actually enough of a delta that it should still display.
I suspect that the problem is somewhere in the logic that deals with the

> For Thomas, this clearly wasn't the answer you wanted to hear, but a
> normalization process is definitely going to be necessary.  You'll need to
> figure out a way to store the information about that conversion process
> (and the original coordinates) in metadata, and access it when necessary to
> align multiple drawings.

This issue was also noticed by the engineers at KDDI who were using SVG to
draw maps. When they didn't normalize the paths and expressed them in
"world" coordinates, graphics were drawn with low precision.

FWIW in PDF we work around this issue by emitting a translate to the first
coordinate of a path. Then the path coordinates become smaller and the
shape is high precision.

> On 2 February 2015 at 18:12, Rik Cabanier <> wrote:
>> Actually not :-)
>> Single precision floats have 6 to 9 digits of precision [1] depending how
>> you convert, so Thomas' example might be losing details even on conforming
>> readers.
>> I saved his example to a fiddle and only IE is able to display it:
>> Chrome, Safari and Firefox all show a blank page.

Received on Tuesday, 3 February 2015 05:25:45 UTC