SVG world map

Hi,

I found this cool vector world map as an adobe illustrator file (.ai) which i was able to open with the free vector program Inkscape and save as an SVG file 8)

I can see the coordinates of the path which is the outline of the world’s continents in the SVG file.

Any ideas on how to turn the SVG string into a bunch of simple polygons composed of straight lines?

I’m currently reading the SVG specs to try and parse the file myself and make a Path2D but I wanted to ask you guys if there was a smarter way.

Unfortunately there are some cubic curves instead of just points and lines. So what I wanted to do was make a Path2D out of the string automagically, then use the Path2D.getPathIterator(double flatness) method to turn the curves to ordinary lines. Batik is meant to do this stuff, but there’s no clear method that just sucks in an SVG file and pumps out a Path2D :-\

Keith

I think Slick has something for this, or maybe used some other library to do something with SVG at some point.

Thanks, I’ll take a look :slight_smile:

On the Substance blog: http://www.pushing-pixels.org/
I remember reading about an app which converted SVG to Java2D classes. Substance demos use these converted classes.