ActiveDen

SVG Output Format

1236 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • United Kingdom
  • Referred between 200 and 499 users
LGLab says

Wondering if anyone could point me in the right direction as I can’t find much info on the web. I recently did an interactive usa map using JS and SVG . I got the svg data from some open source, and the “format” was like so:

M 144.9112,382.62909 L 142.28419,384.78742 L 141.96087,386.24237 L 142.44585,387.21233 L 161.36012,397.88192 L 173.48466,405.47996 L 188.19576,414.04797 L 205.00845,424.07092 L 217.29465,426.49583 z

Which is what I need. But I also can find other formats like the following, but that is not good for me:

M 12207,-22798 l 128,-2 30,2656 -3228,38 -312,-1 -17,-1109 -650,-12 0,-1512 333,-6 1077,-14 1123,-16 1219,-19 z

This last one doesn’t work, and it doesn’t even make sense to me, as there is a M to start, then a single lowercase “l”, and then no more L for lineTo, not to mention the minus signs or hypens, not sure what they are.

Ideally I’d like to do my own graphics in Illustrator or other, and export it in a format similar to my first example, I tried lots of different options in Illustrator but it never outputs like I want. I tried inkscape this morning without much luck either.

Anyone got a clue?

Thanks.

4 months ago
1236 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • United Kingdom
  • Referred between 200 and 499 users
LGLab says

Nevermind I was looking at the wrong problem. Lowercase letters in svg mean relative to previous point and also it’s not necessary to repeat commands in a row, which explains the second format.

4 months ago
by
by
by
by
by