Javafx SVGPath("Kenya Counties Node")

Last time i downloaded data from the kenyaopendata portal,i looked for a way to visualize county data according to some values on a Kenyan map/Kenya counties.Well, with a little research and Inkscape tutorials  a vector graphics software.I was able to build a Kenya node so to speak.
the data can be downloaded here



Step 1 

Download Inkscape.
Download an SVG file of the country you want or any image.

Step 2

i.Open the SVG file with Inkscape
ii.Right click on the image and select Ungroup













iii.Click on any shape












iv.Goto edit on the menubar and click on the XML Editor,XML Editor window will appear,on your right under Attribute click the attribute d and below the SVG path of the shape appears below.











JavaFX SVG

SVGPath path=new SVGPath();
path.setContent("");copy and past the path string here

I created an enum of all 47 counties with the path as the value
An example

public enum County{
      MANDERA("path")
     ,WAJIR("path");

 private final String path;

  County(String path){
        this.path=path;
   }
}

and your done

My Results





Comments

Popular Posts