Export to SVG: how to add attribute info to a polygon

37 views
Skip to first unread message

Berco Beute

unread,
Nov 20, 2009, 7:36:53 AM11/20/09
to openjump-users
When exporting my shapefile (.shp) to svg the resulting svg has
sections that look like for each feature:

<g style="text-rendering:optimizeLegibility; stroke-linecap:butt;
stroke-linejoin:bevel;" transform="matrix
(1,0,0,1,1009.1915,597.3282)">
<path d="M1.1191 0 L1.1191 -8.6719 L2.8242 -8.6719 -0.8672
68.4316 -1.916 Z" style="stroke:none;" />
</g>


What I want to do is add attribute information to these groups or
paths. The shapefile knows how to associate a feature with a set of
attributes, but how to accomplish that when exporting to svg? Is this
at all possible with OpenJump?

More details:
I have a shapefile of a country with all its counties and their names.
I want to create a svg of the country without the county names, but I
*do* want the county name to be in the right section (as above) in the
svg file.

Thanks!

Larry Becker

unread,
Nov 23, 2009, 9:16:42 AM11/23/09
to openjum...@googlegroups.com
Hi Berco,

  Anything is possible, but it is difficult.  Most of the conversion is done in the Batik library so it would require writing a custom driver that does its own iteration through the layer and item lists.  This is what I did in SkyJUMP's print to pdf driver in order to implement pdf layers.  

First I would verify that data attributes are supported in SVG.  This is a new concept to me.

regards,
Larry Becker
--
Larry Becker
Integrated Systems Analysts, Inc.
Reply all
Reply to author
Forward
0 new messages