Interpreting Inkscape SVG path coordinates for HTML map

5

1

I needed some coordinates for a HTML MAP and tried to use inkskape by opening the image and just draw a path with my polygon coordinates.

My document properties are set to 256 x 256 pixels and units: px

When opening the svg file i get coordinates which are not immediately apparent.

 <path
   style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;
          stroke-linejoin:miter;stroke-opacity:1"
   d="m 23.864407,126.91525 3.254237,
                   44.47458 35.79661,
                   44.47458 71.593216,
                   19.52542 71.59322,
                   -37.9661 22.77967,
                   -72.67797 L 218.0339,
                   64 192,49.898305 l -32.54237,
                   8.677966 -18.44068,
                   -35.79661 1.08474,
                  -17.3559322 -71.593215,0 L 45.559322,34.711864 35.
                   79661,57.491525 5.4237288,
                   74.847458 6.5084746,101.9661 23.864407,126.91525 z"
                   id="path2840" />

How can I get coordinates I can use ?

The original image

alt text

The SVG file from inkscape

Link to SVG


Progress:

I tried a tool called InkscapeMap which looks promising and simple, but unfortunately it looks like it didn't work with this particular svn file.

alt text


Solved!

Saving the file as a Plain SVG solved the problem and InkscapeMap worked perfectly.

(Btw. saving as an optimized svg caused a parsing error)

Update 13.11

Using inkscapeMap 0.6 and Inkscape 0.48 i needed to uncheck relative coordinates in SVG output preferences. Also if you get a C error message, hunt down the polygon with a C in it, and redraw the polygon using the XML editor in inkscape.

Update 25.11.2011

I modified the source to improve parsing.

http://tovare.com/create-html-imagemaps-using-inkscape/

tovare

Posted 2010-07-12T19:56:51.783

Reputation: 583

Please don't embed SVG files, they don't show up in every browser. Link to them instead. – BloodPhilia – 2010-07-12T21:18:53.427

Answers

4

jrc03c

Posted 2010-07-12T19:56:51.783

Reputation: 7 626

Very promising tool :-) It looks like the tool doesn't work on this particular file. – tovare – 2010-07-12T21:07:13.857

Correction: it did work when saving as a Plain SVG file :) – tovare – 2010-07-13T06:12:14.090

hello i'm trying to do the same thing but i have teh same problem as tovare. I use inkscape 0.48 and i tried to save as svg simple but it doesn't work. – Mermoz – 2011-01-29T18:24:46.683

As am I, 0.48 saving with plain svg doesn't seem to work. Error in parsing: org.xml.sax.SAXParseException: Point cohordinates not valid: C – ajbeaven – 2011-11-03T01:18:43.877

That error is a polygon which hasn't been closed I think. – tovare – 2011-11-13T23:07:55.713