Commits

tbrugz committed e9bcc92

docs updated ; SVGParser bugfixing (thanks Thomas)

  • Participants
  • Parent commits 3ae65ad

Comments (0)

Files changed (3)

 		<copy tofile="dist/kmlutils.jar" file="dist/svg2kml.jar"/>
 	</target>
 	
-	<target name="run">
+	<target name="run-svg2kml">
 		<java classpathref="default" classname="tbrugz.geo.SVG2KML" />
 	</target>
 
+	<target name="run-svg2graphml">
+		<java classpathref="default" classname="tbrugz.geo.SVG2GraphML" />
+	</target>
+	
+	<target name="run-all" depends="run-svg2kml, run-svg2graphml">
+	</target>
+
 	<target name="kml-validate" depends="prepare">
 		<!--
 		http://ant.apache.org/manual/Tasks/xmlvalidate.html
 kmlutils - utils for KML files
 ------------------------------
 
-The main purpose of this project is a tool for converting SVG files into KML files. Currently it (svg2kml)
-partially converts polygons.
+The purpose of this project is to provide functions for XML-based "visual" file formats. 
+Main Focus is KML, SVG and GraphML file formats.
+
+The main functionality of this project is a tool for converting SVG files into KML files. Currently it (svg2kml)
+partially converts polygons (tbrugz.geo.SVG2KML)
+
+This project also provides a conversion tool for SVG to GraphML (tbrugz.geo.SVG2GraphML)
 
 svg2kml howto:
 - build with ant
 - (optional) edit idmappings.properties to translate IDs from the SVG file to the KML file
 - run "java -cp dist/svg2kml.jar;lib/commons-logging-1.1.1.jar;lib/log4j-1.2.15.jar tbrugz/geo/SVG2KML"
 
+svg2graphml howto:
+- similar to svg2kml ;) but you have to edit svg2graphml.properties
+- run "java -cp dist/svg2kml.jar;lib/commons-logging-1.1.1.jar;lib/log4j-1.2.15.jar tbrugz/geo/SVG2GraphML"
+
 Author:
 Telmo Brugnara <tbrugz@gmail.com>
 
 Running - classes with main()
 -----------------------------
 - tbrugz.geo.SVG2KML (main)
+- tbrugz.geo.SVG2GraphML
 - tbrugz.geo.test.Test
 - tbrugz.xml.test.Test
 

File src/tbrugz/svg/parser/SVGParser.java

 		if(firstNumber==-1) return null;
 		
 		int i = indexOf(sb, LETTERS_OR_DELIMITER, firstNumber);
-		if(i==-1) return null;
-		if(i==0) return "";
+		if(i==-1) { i=sb.length(); }
+		if(i==0) { return ""; }
 
 		//log.trace("readN: "+pos+"; "+i);
 		String substr = sb.substring(firstNumber, i);
 				}
 				else if(token.equalsIgnoreCase("C")) {
 					log.warn("PATH.D: token ["+token+"] processed as L");
+					for(int i=0;i<4;i++) { token = sr.readNumbers(); } //ignore next 4 numbers
+					
 					state = 1;
 					lastLetter = token.charAt(0);
 				}