title: SVG paths to KML polygons
body: <p>I want to create a svg to kml converter in Java. I have created a sort of translator for this task, that takes in text in svg format and prints out text in kml format. I am able to handle <strong>circle</strong> and <strong>rect</strong> tags so far. I'm not able to handle <strong>paths</strong>. </p>
  
  <p>How can I read svg paths(the d attribute) and reconstruct them in kml?</p>
  
  <p>The main issue stems from the fact that svg paths are not simple sequences of coordinates, and they have curves in them. Here's an example of an svg path input that I need to handle:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;svg width="10000" height="1000"&gt;
  &lt;path id="square" fill="#0000FF" 
  d="M351.3,251 l-3.1-2.2c-0.3-0.2-0.3-0.5-0.1-0.8l2.2-3.1c0.2-0.3,0.5-0.3,0.8-0.1l3.1,2.2
  c0.3,0.2,0.3,0.5,0.1,0.8l-2.2,3.1C355,251.1,354.6,251.2,354.3,251z"/&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>If I can figure out how to evaluate the string in the d attribute, the only other issue is how to create the curves using the values extracted from the string in the d attribute.</p>
  
  <p>This format of paths is not the one commonly found online; it is something that was created using adobe illustrator by someone else and now I don't have access to that software. Since there are no spaces or regular commas, I'm not able to understand how to read the string properly.</p>