Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  SVG world map  (Read 3757 times)
0 Members and 1 Guest are viewing this topic.
Offline CommanderKeith
« Posted 2010-12-09 05:38:27 »

Hi,

I found this cool <a href="http://www.vectorworldmap.com/">vector world map</a> as an adobe illustrator file (.ai) which i was able to open with the free vector program Inkscape and save as an SVG file  Cool

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 <a href="http://download.oracle.com/javase/6/docs/api/java/awt/geom/Path2D.html">Path2D</a> 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  Undecided

Keith

Offline Nate

« JGO Bitwise Duke »


Medals: 158
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #1 - Posted 2010-12-09 06:02:24 »

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

Offline CommanderKeith
« Reply #2 - Posted 2010-12-09 08:09:36 »

Thanks, I'll take a look  Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline zammbi

JGO Coder


Medals: 4



« Reply #3 - Posted 2010-12-09 10:29:30 »

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.

Current project - Rename and Sort
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xFryIx (62 views)
2014-11-13 12:34:49

digdugdiggy (41 views)
2014-11-12 21:11:50

digdugdiggy (36 views)
2014-11-12 21:10:15

digdugdiggy (30 views)
2014-11-12 21:09:33

kovacsa (53 views)
2014-11-07 19:57:14

TehJavaDev (56 views)
2014-11-03 22:04:50

BurntPizza (55 views)
2014-11-03 18:54:52

moogie (70 views)
2014-11-03 06:22:04

CopyableCougar4 (71 views)
2014-11-01 23:36:41

DarkCart (156 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!