D3 Map of Indian State


Map of Indian State

In my previous post d3-map-of-india I spoke about creating a map of India using D3. In this post am going to talk about creating a map of a specific state of India.

Am going to create a map of Rajasthan in this article. Maps of all other states can be created following the same steps.

Follow Steps 1 to 4 remain as explained in  d3-map-of-india

Now we extract the data for the state for which we want to build the map, from the SHAPE data for INDIA, in JSON format.

Open Terminal and go to the IND_ADM folder (see steps 1 to 5 in d3-map-of-india ) and run the following command line :

ogr2ogr -f GeoJSON -where “NAME_1 IN (‘Rajasthan’)” raj.json IND_adm1.shp

This will generate the json data for State of Rajasthan. (Similarly you can generate the JSON data for other states of India)

Now you are ready to use this json file with D3 to create the map of Rajasthan.

Download the code from



Posted in CSS, HTML5, Web Technology
2 comments on “D3 Map of Indian State
  1. Aman says:

    Hi Actually I am loading States the same way you are doing but what i want is a generic algorithm which will align the map always in the center every time i don’t need to change the properties of rotate or center is this possible?

  2. Pawan says:

    Hi Nishant,

    I am having the issue with size of map, it is generated too small can you please guide me how can do the designing of the map.


1 Pings/Trackbacks for "D3 Map of Indian State"
  1. max says:


    thanks for information.

Leave a Reply

Your email address will not be published. Required fields are marked *