The full source code for the same can be found here.
- If you do not have the data yet, you can download it from here. I downloaded the Admin 1 boundary, but this method is generic, so applies to any shapefile that you have.
- Open up the QGIS or any other GIS software