This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Strange size of svg files downloaded at different scales

2
1

Hi,

I've got a question when downloading svg files from openstreetmap. I was trying to download a map of an area in Marseille. The svg file I got was around 40MB when I set the scale at 1:20,000. But when I tried to download a map of a smaller scale, say 1:1,000,000, of the same area, I got an svg file of 120MB. I think that maps scaled smaller are more generalised, and the file size should be smaller as a result. Does anyone know why the file size actually increases when the scale is lowered? Any help is much appreciated.

asked 01 Mar '13, 09:12

weeburn's gravatar image

weeburn
41113
accept rate: 0%


One Answer:

3

The rendering engine behind the SVG export doesn't generalize or simplify geometries. It will drop some features - e.g. on a small scale map you won't see residential roads - but those features that you do see are drawn in full detail (even if that is not visible). Hence the large file.

answered 01 Mar '13, 10:49

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

2

AFAIK the text in OSM's SVG exports is converted to vector geometry, I think this is probably the biggest contributing factor in the size. If you need more compact SVGs, you can use Maperitive's export function.

(01 Mar '13, 12:31) Breki
1

... or have a look at https://wiki.openstreetmap.org/wiki/SVG in general

(01 Mar '13, 18:58) stephan75

Thank you all... But I am still confused why the size of the svg file downloaded under a smaller scales is larger, given a same area. At least, the sizes of svg files downloaded from different scales should be almost the same. For a same polygon, I got a svg file of 120MB for a map scaling at 1:500,000 but got a file of about 30MB for a map of the same polygon scaling at 1:50,000......

(04 Mar '13, 09:10) weeburn

Source code available on GitHub .