coordinatePrecison attribute proposal

Doug Sheppers asked me to send a proposal that I've made at the SVGOpen 
conference on this subject to the list - so here it is:

SVG code generated by Software often contains attributes, namespaces and 
the like that increase file-size, make code unreadable for human eyes 
and are in fact not needed when displayed on the web. Thus libraries 
like Scour [1] have started to clean up bloated code and even try to 
reduce precision of coordinates during this process. Due to the nature 
of SVG, precision requirements may change within a single file. A 
mapping user interface in pixel space gets along with integers just 
fine, whereas the included map in real-world lat/lon coordinates needs 
at least 3 to 7 decimal places to preserve geometry. Currently it is not 
possible to semantically distinguish between the two, so I propose a new 
attribute named "coordinatePrecision", "precision" or any other name, 
that allows to specify the desired number of decimal places for content 
of the following elements:

   - elements that establish viewPorts [2] - i.e. svg, symbol, image, 
foreignObject
   - marker, pattern and view elements [3]

If it is not possible or desirable to add such an attribute, I encourage 
the working group to consider other ways of giving hints to libraries on 
how to cope with this situation. Maybe using HTML5s custom data- 
attribute or any other way.

Klaus Förster

[1] http://www.codedread.com/scour/
[2] http://www.w3.org/TR/SVG/coords.html#ElementsThatEstablishViewports
[3] http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute

Received on Friday, 9 October 2009 10:00:31 UTC