Newbie here- Need help with shape file of constituencies of India.

176 views
Skip to first unread message

Manas Sharma

unread,
May 18, 2016, 10:32:02 AM5/18/16
to datameet
Hello,

I got the shape file  of the assembly constituencies of India from the repo of datameet on github.

My question is that is there any way I could get/separate the constituencies of only a particular state from the given shape file?

Also, after that how do i colour individual constituencies with a particular colour?

Thanks a lot for the help :)

Devdatta Tengshe

unread,
May 18, 2016, 10:40:20 AM5/18/16
to data...@googlegroups.com
Hi Manas,
You need a GIS software to create maps from shapefiles. I'll suggest QGIS, which is an opensource, free and a feature rich software. You can download it from http://qgis.org

Once you add the shapefile to QGIS, you can render it however you like.  See this doc for more details: http://docs.qgis.org/2.0/uk/docs/training_manual/basic_map/symbology.html

Regards,
Devdatta

--
Datameet is a community of Data Science enthusiasts in India. Know more about us by visiting http://datameet.org
---
You received this message because you are subscribed to the Google Groups "datameet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datameet+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Manas Sharma

unread,
May 18, 2016, 10:50:59 AM5/18/16
to datameet
Thank You. Will try and let you know if i have any problem :)

Manas Sharma

unread,
May 18, 2016, 9:18:09 PM5/18/16
to datameet
Hey,

Do you have any idea where I can find the map for tamil nadu's assembly constituencies. The one on the datameet repo has only 165 of them. There is 234. If not, how do i go about making a shapefile of my own?

Thanks


On Wednesday, May 18, 2016 at 8:02:02 PM UTC+5:30, Manas Sharma wrote:

Devdatta Tengshe

unread,
May 18, 2016, 11:11:36 PM5/18/16
to data...@googlegroups.com
Here is the shapefile for Tamil Nadu with 234 seats.

The AC shapefile in datameet repo has 235 constituencies, and I'll send a PR to correct it.

Regards,
Devdatta

--
TN.zip

Manas Sharma

unread,
May 18, 2016, 11:50:09 PM5/18/16
to datameet
Hi,

Thank you! But I couldnt find this repo on the git. Isnt it the one located here? https://github.com/datameet/maps/tree/master/assembly-constituencies
Are there individual state shape files too somewhere?

Thanks.

On Wednesday, May 18, 2016 at 8:02:02 PM UTC+5:30, Manas Sharma wrote:

Devdatta Tengshe

unread,
May 19, 2016, 12:59:49 AM5/19/16
to data...@googlegroups.com
That's the correct location. This file has the ACs for all the states, combined together.

Regards,
Devdatta

--

Manas Sharma

unread,
May 19, 2016, 2:28:11 AM5/19/16
to datameet
Hi,

Umm... but when I isolated (as in removed the other features apart from tamil nadu) in the India_AC.shp file from that link in QGIS , there were only 165 left. 
What am i missing?

Thanks,
Manas

On Wednesday, May 18, 2016 at 8:02:02 PM UTC+5:30, Manas Sharma wrote:

Curran Kelleher

unread,
May 19, 2016, 2:34:17 AM5/19/16
to datameet
Hello,

One way to make the data easier to work with is to convert the Shapefile to GeoJSON or TopoJSON. This online tool MapShaper lets you upload a Shapefile, perform line simplification if you want to (to reduce file size), and export to GeoJSON or TopoJSON.

Once you have the data in TopoJSON format, you can use D3 to color regions. Here are some examples: India Map in D3Map of India's Parliamentary Constitiencies, 2014.

Best regards,
Curran

Manas Sharma

unread,
May 19, 2016, 9:21:32 AM5/19/16
to datameet
Hello again,

I am facing really basic issues with data binding. I converted the shape file to topojson and I'm writing the following code-
d3.json("tntopo.json", function(error,topology) {
        svg.append("g")
        .selectAll("path")
      .data(topojson.feature(topology, topology.arcs))
      .enter()
      .append("path")
      .attr("d",path);
});

Although no error is popping up, nothing is showing up when I run it on my computer. The "g" element of the svg is empty. I think I am going wrong at the data(...) line but cant figure out what is wrong.

I have attached the topojson file if someone wants to take a look.

Thanks a lot!


tntopo.json

Manas Sharma

unread,
May 19, 2016, 11:13:25 AM5/19/16
to datameet
I found the issue. It was with the binding as well as with the scale -_-. The thing was there . It was just too small for human eyes to see -_-. Hello d3, I guess :)


On Wednesday, May 18, 2016 at 8:02:02 PM UTC+5:30, Manas Sharma wrote:

Curran Kelleher

unread,
May 20, 2016, 3:45:21 AM5/20/16
to datameet
Congrats on getting it working! D3 definitely has a steep learning curve and can be frustrating.

Is your work something that could be shared publicly? It would be awesome to see the map. blockbuilder.org is a nice tool for publishing code examples to bl.ocks.org.

Regards,
Curran

Manas Sharma

unread,
May 23, 2016, 6:54:17 PM5/23/16
to datameet
Hello,
Sorry for the late reply, was busy with d3 again :P.
Yes once we are done with it it will be open source :) .


On Wednesday, May 18, 2016 at 8:02:02 PM UTC+5:30, Manas Sharma wrote:

Manas Sharma

unread,
Jun 4, 2016, 3:37:58 AM6/4/16
to datameet
Hello again,

Here is our final project. We are a group of three interns at IDC Bombay under Prof. Venkatesh Rajamanickam.

All feedback and suggestions are welcome.


Thank You
Shailaja, Kuhu and Manas


On Wednesday, May 18, 2016 at 8:02:02 PM UTC+5:30, Manas Sharma wrote:

Curran Kelleher

unread,
Jun 5, 2016, 3:53:53 AM6/5/16
to datameet
Great work!

You may want to consider the screen resolution of viewers a bit more. I'm viewing on a 13 inch display, and the "Constituency-wise effect of the NOTA" goes off the right edge by just a few inches.

Regards,
Curran

Manas Sharma

unread,
Jun 5, 2016, 2:20:27 PM6/5/16
to datameet
Thank You. 

We are correcting that. Thanks.
Reply all
Reply to author
Forward
0 new messages