[Tilesathome] Osmarender colours and stylesheets
Jiri Klement
jiri.klement at gmail.com
Mon Aug 11 15:30:43 BST 2008
Symbols for zoom 12 and zoom 17 are now shared. Currently icons are
saved as symbols in one svg file per each icon. The next step might be
save icons as normal svg images which have the same size as rendered
icons. orp/osmarender will take care about scaling the icon.
On Sun, Aug 10, 2008 at 2:37 PM, Jiri Klement <jiri.klement at gmail.com> wrote:
> I've finished support for external files in orp (it's in svn now).
> I've also moved symbol-bus from z17 to symbols/bus.svg as an example.
> Symbols scaling works as well, but it scales all symbols in
> stylesheet, so I will have to modify all symbols in z16 before bus
> symbol can be shared between z16 and z17.
>
> If nobody complains I will start moving symbols to external files later.
>
> On Sun, Aug 10, 2008 at 2:32 PM, Jiri Klement <jiri.klement at gmail.com> wrote:
>>>> Stylesheets are a bit confusing but it seems that pixels in
>>>> stylesheets actually represent rendered pixels. Even if I'm wrong,
>>>> global transformation can be defined for svg file so 1 unit = 1
>>>> rendered pixel.
>>>
>>>This is not as used in osmarender. Line widths get smaller for higher
>>>zoom levels, often by factor 0.5 resulting in the same rendered width.
>>
>> You're right, I got confused by sligtly obfuscated symbol definition before.
>>
>>>What is a pixel in SVG anyway?
>>
>> It depends on size of image, viewbox and rendered size. In case of
>> osmarender is every svg file big about 878.91*878.91 ((360 / number
>> of z12 tiles)*10000). Size of rendered image is 256 for z12, 512 for
>> z13, ...
>> So 1 rendered px should be:
>> 3.42 units for z12
>> 1.71 units for z13
>>
>> I think it is possible to switch to 1 unit = 1 rendered pixel, but it
>> would mean to change orp/osmarender to convert all nodes/ways
>> coordinates and rewrite all stylesheets.
>>
>>
>>>> Frederik: I think I saw something about this not being implemented in
>>>> or/p? If not it shouldn't be too hard to fix, you can probably find
>>>> examples of how this used to be done by looking at some fairly old svn
>>>> revisions.
>>>
>>> Yes, there was a bit of code in the SVG that I did not understand and
>>> that wasn't obviously used. Maybe one can even produce .svg files that
>>> simply href external symbols?
>>
>> It should be possible as href is just normal URI. Anyway the
>> osmarender code is quite simple:
>> - get list of all referenced symbols
>> - read svg file <symbolsDir>/<nameOfSymbol>.svg
>> - extract symbol from svg file (element with address
>> svg:svg/svg:defs/svg:symbol)
>>
>
More information about the Tilesathome
mailing list