 |
|
View previous topic :: View next topic |
Author |
Message |
Locutus Guest
|
Posted: Sat Sep 27, 2008 23:28 Post subject: SVG (K)ompressor |
|
|
SVG Kompressor is a program designed to compress your SVGs into a KOS format file.
Why? There are a few reasons. First of all, accumulating daily SVGs gets annoying when your SVGs get to a certain size, and a year's worth of SVG files can actually accumulate to a fair amount. Secondly, SVG is a graphics data format. Though it is good to store presentation data for Kosmor maps, it is rather unwieldy to parse for position/course data, and KOS would like to solve that issue.
Kompressor is a small open-source application that I have written that (when complete) will convert between SVG and KOS files. Currently it is in alpha. It has no GUI, and it must be run from the command line. Also, it only converts in one direction (SVG->KOS), and it runs best on Java 1.6, though I have not tested it with previous versions. Help in developing Kompressor is greatly appreciated.
Here are the source files:
http://www.melnx.com/locutus/kosmor
Click on the 'kompressor' link. Also, there are a few other useful tools on that site, if you want to check them out. I need to make a GUI, once I get more free time. |
|
Back to top |
|
 |
alphabravo Major
Joined: 15 Feb 2004 Posts: 827 Location: UK
|
Posted: Sun Sep 28, 2008 06:03 Post subject: |
|
|
A better idea would be to use one of the very many (think VERY many) compression programs which supports gzip (normally .gz).
If you take a .svg file, and gzip it to a filename ending in .svgz rather than .svg.gz, then it can be viewed by all (that I know of) svg viewers/editors.
This is because gzip compression is actually mandatory in the svg specification. _________________ Major alphabravo in the house Thalgados-Sissyhood |
|
Back to top |
|
 |
Locutus Guest
|
Posted: Sun Sep 28, 2008 09:54 Post subject: |
|
|
Yes, but I wanted to make the map easy to parse. Currently, each planet and WP is stored in 3-4 different elements plus text nodes in the SVG, and you have to keep track of all of these. I would like to parse the file easily as well.
Basically, in the new file, each line is in this form:
planets: Code: | name x y colour hasShips radarClass (radarRange) |
wps: Code: | name x y x2 y2 colour hasShips radarClass (radarRange) |
(replace spaces with tabs)
So it would be near-trivial to generate, say, an HTML summary file in a KOS file versus the SVG. |
|
Back to top |
|
 |
alphabravo Major
Joined: 15 Feb 2004 Posts: 827 Location: UK
|
Posted: Sun Sep 28, 2008 15:46 Post subject: |
|
|
In order to view (as most people would like to) the files as maps again, there would need to be an svg recompiler (reasonably trivial, I think I made one once if you're stuck). _________________ Major alphabravo in the house Thalgados-Sissyhood |
|
Back to top |
|
 |
Locutus Guest
|
Posted: Mon Sep 29, 2008 08:10 Post subject: |
|
|
Yeah, I can make one, once I can get find enough time (probably next weekend).
Edit: From testing, the KOS format seems to be about ~20% of the file size of the original SVG, which is actually pretty close to the ratio of SVGZs. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|