[Tilesathome] Strange svg code for areas
Jiri Klement
jiri.klement at gmail.com
Thu Sep 18 20:01:04 BST 2008
You would be right if <path> was in <defs> and it was generated only
once. That's how it works for ways.
But areas are rendered differently. Areas are not shared and every
type of area is enclosed in <g> with class specified.
<g class="amenity-school">
<path id="area_24063746" d="..."/>
<use xlink:href="#area_24063746" class="amenity-school"/>
<path id="area_-16" d="..."/>
<use xlink:href="#area_-16" class="amenity-school"/>
<path id="area_-18" d="..."/>
<use xlink:href="#area_-18" class="amenity-school"/>
</g>
So it can be even easier:
<g class="amenity-school">
<path d="..."/>
<path d="..."/>
<path d="..."/>
</g>
orp/XSLT can be probably fixed to share <path> for areas but I think
areas are rarely reused so it will make generated svg file actually
bigger.
On Thu, Sep 18, 2008 at 8:48 PM, Frederik Ramm <frederik at remote.org> wrote:
> Hi,
>
>> Is there a reason why code generated for areas looks like this?
>
> Yes ;-)
>
>> <path id="area_24063746" d="..."/>
>> <use xlink:href="#area_24063746" class="amenity-school"/>
>>
>> The <use> seems to be redundant, following code is doing the same thing:
>>
>> <path id="area_24063746" d="..." class="amenity-school"/>
>
> Some objects have multiple styles, for example: highways (with their cores
> and casings). Using the mechanism above, you can define the geometry once
> and then paint them many times with different styling.
>
> Of course this mechanism would not be required for your area example, but I
> guess it is too complicated to make the distinction.
>
> Bye
> Frederik
>
> --
> Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
>
More information about the Tilesathome
mailing list