How to get polling station/booth lat-long data for an assembly constituency

2,058 views
Skip to first unread message

Nikhil VJ

unread,
May 15, 2015, 2:24:18 PM5/15/15
to data...@googlegroups.com
Not sure about the legality of the data itself, but sharing a general method we can use in any mapping interface which is working here as well on my end.

Install Firebug extension in Firefox browser. https://addons.mozilla.org/en-US/firefox/addon/firebug/

Go to psleci.nic.in
Activate Firebug. Console appears at bottom (or wherever you've positioned it)
Go on "Net" tab
Under that, "XHR" tab

Select State, then District, then AC (Assembly Constituency)
Then press one of the Search buttons.

All the polling stations in that constituency come up.

Now in the console, click on "POST GetGoogleObject" to expand it (this should be around a 100 KB in size now while one step earlier it was much smaller.)
Go to "JSON" tab
Click on "d" to expand it
Right-click on "Points", and select "Copy Points as JSON "

Now go to http://konklone.io/json/
Paste the JSON stuff there
It gets converted to a table, and you can see it.
Download the CSV linked.
Open up the CSV in Calc/Excel, and edit as per your needs.

-----
Why Firebug is needed : The regular "inspect element" etc parts of Chrome and Firefox do help you to see the incoming JSON objects, but Firebug also lets you copy them out.

Screenshot:
Inline image 1


--
Cheers,
Nikhil
+91-966-583-1250
Pune, India
Self-designed learner at Swaraj University <http://www.swarajuniversity.org>
http://nikhilsheth.blogspot.in


Raphael Susewind

unread,
May 15, 2015, 3:13:39 PM5/15/15
to data...@googlegroups.com
Dear all,

the whole dataset is also available at
http://dx.doi.org/10.4119/unibi/2674065 - raw data was scraped at a time
when psleci did not have a copyright disclaimer...

Best
Raphael

On 15.05.2015 20:23, Nikhil VJ wrote:
> Not sure about the legality of the data itself, but sharing a general
> method we can use in any mapping interface which is working here as well
> on my end.
>
> Install Firebug extension in Firefox browser.
> https://addons.mozilla.org/en-US/firefox/addon/firebug/
>
> Go to psleci.nic.in <http://psleci.nic.in>
> Activate Firebug. Console appears at bottom (or wherever you've
> positioned it)
> Go on "Net" tab
> Under that, "XHR" tab
>
> Select State, then District, then AC (Assembly Constituency)
> Then press one of the Search buttons.
>
> All the polling stations in that constituency come up.
>
> Now in the console, click on "POST GetGoogleObject" to expand it (this
> should be around a 100 KB in size now while one step earlier it was much
> smaller.)
> Go to "JSON" tab
> Click on "d" to expand it
> Right-click on "Points", and select "Copy Points as JSON "
>
> Now go to http://konklone.io/json/
> Paste the JSON stuff there
> It gets converted to a table, and you can see it.
> Download the CSV linked.
> Open up the CSV in Calc/Excel, and edit as per your needs.
>
> -----
> Why Firebug is needed : The regular "inspect element" etc parts of
> Chrome and Firefox do help you to see the incoming JSON objects, but
> Firebug also lets you copy them out.
>
> Screenshot:
> Inline image 1
>
>
> --
> Cheers,
> Nikhil
> +91-966-583-1250
> Pune, India
> Self-designed learner at Swaraj University <http://www.swarajuniversity.org>
> http://nikhilsheth.blogspot.in
>
>
> --
> 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
> <mailto:datameet+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Raphael Susewind | BGHS Bielefeld University, CSASP University of Oxford
Snail Mail | Melanchthonstr. 4a, 33615 Bielefeld, Germany
Web & Twitter | http://www.raphael-susewind.de | @RaphaelSusewind

Please do consider http://www.gnupg.org for encryption (key id 10AEE42F)

Nikhil VJ

unread,
May 18, 2015, 3:38:11 AM5/18/15
to data...@googlegroups.com
Thanks Raphael for that link again! I'd actually downloaded that set some months back and didn't know enough about mapping at the time, had hit some road-blocks and abandoned it. Now went back and was able to get through to what I wanted.

I converted the shapefile for maharashtra's polling booths to geojson, at this site: http://converter.mygeodata.eu/
The site has a CSV output option which gives everything except latitude-longitude ;)

Then, not finding a non-crashing online place to process this file having 88k+ locations, I reverted back to command line and grep'd it down to pune-district level.
grep "\"district\": 25," maharashtra.booth.json > district25.pune.booth.json

That brought it down to a workable 7099 locations, and now I could use this online json-to-csv converter (which works with geojson and outputs the lat-long):
http://konklone.io/json/

Finally having it in CSV (which both humans and machines can handle, yay). I loaded it to a leaflet app (https://github.com/perrygeo/leaflet-simple-csv). First observations:
1. The CSV has 7099 locations but the webpage says that 4968 have been loaded. Where the balance 2k+ went I can't say right now. Will need to filter the list further down to AC levels.
2. My own polling booth isn't marked at its location. It is marked, alongwith 136 others, at the default location you get when you search for Pune.
3. At many places in my locality, two different schools are marked at same location.

There are disclaimers in the Bielefeld data about this.. so it's going to need work.
 
So it would be a good exercise to get the data from another source (ECI).. and compare them. I have the AC-wise data of Pune from ECI, I'm now going to filter down the Bielefeld data to the same AC's, and then we can have two datasets to compare. First observations for my AC from there : One polling booth is in Nepal, two others are in the mountains, and a few are out of the AC's limits.

PS: AC means Assembly Constituency.

Nikhil VJ

unread,
May 19, 2015, 6:56:41 AM5/19/15
to data...@googlegroups.com
Hi guys,

Can we clone http://pincode.datameet.org/ for polling booths?

Sample CSV attached, which is extracted from the data that Raphael
shared. (I'm finding both this and ECI's current data equally
inaccurate at least for my area!)

We could combine the state, assembly constituency and booth number to
make a unique id for each booth, and then follow the same procedure as
pincode.datameet.org is following.

If someone can guide me on how to go about this, I'll be glad to take
it up, for Pune for starters. We have municipal elections in a year
and need to clean this stuff up.
>> <http://www.google.com/url?q=http%3A%2F%2Fdx.doi.org%2F10.4119%2Funibi%2F2674065&sa=D&sntz=1&usg=AFQjCNEr7VhstzsikCrgurmgGkop9SlozQ>
>> > an email to datameet+u...@googlegroups.com <javascript:>
>> > <mailto:datameet+u...@googlegroups.com <javascript:>>.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> Raphael Susewind | BGHS Bielefeld University, CSASP University of Oxford
>> Snail Mail | Melanchthonstr. 4a, 33615 Bielefeld, Germany
>> Web & Twitter | http://www.raphael-susewind.de | @RaphaelSusewind
>>
>> Please do consider http://www.gnupg.org for encryption (key id 10AEE42F)
>>
>
> --
> 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.
>


--
ac212.parvati.booth.csv

Thejesh GN

unread,
May 19, 2015, 8:39:07 AM5/19/15
to data...@googlegroups.com
I will check the code of pincode project.

But in the mean time can you check http://crowdcrafting.org/

See if we can setup a crowdsourced project there so people can contribute.


Thej
--
Thejesh GN  ತೇಜೇಶ್ ಜಿ.ಎನ್
http://thejeshgn.com
GPG ID :  0xBFFC8DD3C06DD6B0

Nikhil VJ

unread,
May 20, 2015, 8:25:43 AM5/20/15
to datameet
Hi Thejesh,

Crowdcrafting.org seems pretty good!
I'm afraid the coding part over there is a little out of my league at
present. I saw their sample geocoding application, and noticed that it
was about users inputting geolocation afresh. I'm sure it's there in
the code, but I couldn't understand how one could get it to show
present location and verify / edit that, like what the pincode project
does.

It would actually make so much sense to have a generic application for
crowd-correcting any mapping file. I've written up a
requirements/design doc here :
https://datameet.hackpad.com/Mapping-Design-Generic-crowd-correcting-of-locations-prhY58XLfP0



On 5/19/15, Thejesh GN <i...@thejeshgn.com> wrote:
> I will check the code of pincode project
> <https://github.com/sanand0/pincode>.
>
> But in the mean time can you check http://crowdcrafting.org/
>
> See if we can setup a crowdsourced project there so people can contribute.
>
>
> Thej
> --
> Thejesh GN *⏚* ತೇಜೇಶ್ ಜಿ.ಎನ್

Shashi k Verma

unread,
Oct 16, 2017, 11:43:36 PM10/16/17
to datameet
Hi Nikhil,

I am unable to copy Points as JSON on firefox. The option is not available. Your help would be highly appreciated . Thanks

Sandeep Kumar

unread,
Oct 17, 2017, 3:06:34 AM10/17/17
to datameet
Download the json to your system then use it, save as the link to json feed from xhr.

Shashi k Verma

unread,
Oct 17, 2017, 4:21:58 AM10/17/17
to datameet
Hi Sandeep & Nikhil,

Thanks for the prompt reply. I am actually novice, when it comes to working with Web techs. 

I was following Nikhil's step by step process to scrape Long-Lat data from psleci.nic.in. I am trying to scrape these data for all the Assembly constituencies of Jharkhand. In April, when I last tried I was successful doing it following Nikhil's stated way. But now I am unable to Right-click on "Points", and select "Copy Points as JSON ", as I am not getting options for it. I am using Firefox 56 and since Firebug has been discontinued, using the inbuilt dev tools.

Your help would be extremely appreciated.

Thanks
Shashi
Screen Shot 2017-10-17 at 13.57.17.png

Sandeep Kumar

unread,
Oct 17, 2017, 4:46:57 AM10/17/17
to datameet
psleci-chrome.png

Sandeep Kumar

unread,
Oct 17, 2017, 4:50:57 AM10/17/17
to datameet
Use chrome to copy the json from repsonce see my screenshot attached parse the json to your required format using any other software. If you need help parsing json i will post it in a while.
psleci-chrome.png
unminify.png

Shashi k Verma

unread,
Oct 17, 2017, 6:22:02 AM10/17/17
to data...@googlegroups.com
Thanks a ton Sandeep ! It's successfully done. Thanks a lot

--
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 a topic in the Google Groups "datameet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/datameet/kuWXHJLFzX0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to datameet+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Shashi k. Verma

Rahul Pandey

unread,
Jul 10, 2023, 10:58:46 PM7/10/23
to datameet
Does anyone have Rajasthan 2023 polling station data containing pooling station name along with lat, long?


To unsubscribe from this group and all its topics, send an email to datameet+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages