Skip to content

Instantly share code, notes, and snippets.

@drewbo
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewbo/184304fedb64843beebf to your computer and use it in GitHub Desktop.
Save drewbo/184304fedb64843beebf to your computer and use it in GitHub Desktop.
Observer Deployment Data for the runoff of the 2014 Afghanistan elections

Context

The observer deployment data from the 2014 Afghanistan runoff elections was provided in various forms (excel, word) and saved as xlsx files (so the work is visible) and then csvs with minimal editing. That data is all read into R and joined with the updated polling center data to create the TileMill source data (as a csv).

For manual edits, I added the new name information into rosetta_fix.csv and the new name/spatial information (calculated from iec_runoff_polling_centers_en_jun2014-geojson_cl.csv") to district_centroid.csv.

All the extra lat/long calculations were saved as extracentroidcalc.xlsx.

FEFA

FEFA didn't have IEC ID so I sorted the information by province then district and put it next to a similar sorted list from the rosetta stone file (province, district, plus IEC ID). TManually went through the whole list to do name matching

For Helmand-Marja, added IEC ID 3014 to match the polling station information (later adding lat/long based on the average of the same for all the Marja polling stations, added as AGCHO ID 9998)

Same for Delaram district in Nimroz, ID 3406 (it's apparently transfered provinces a few times, AGCHO 9999)

For Dari Suf Bala and Dari Suf Payan, I adjusted the rosetta fix csv so that IEC ID 2006 corresponds to AGCHO ID 1904 and 1905. This was reflected on the first observer deployment map but not totally sure how the matching was managed then. Because of this, the FEFA data has to be joined on AGCHO ID (since the IEC ID isn't unique)

All the numbered districts in Kabul province were assigned to Kabul district (and aggregated)

ANPO

Added these places to the rosetta and district centroid files:

  • Meerzaka, Paktya IEC 1313 AGCHO 9997
  • Chenarto, Uruzgan IEC 2506 AGCHO 9996
  • Dand, Kandahar IEC 2717 AGCHO 9995
  • Takhta Pul, Kandahar IEC 2718 AGCHO 9994

TEFA

Added these places to the rosetta and district centroid files:

  • Abshar, Panjshir IEC 0808 AGCHO 9993

NLO

Performed a manual merge similar to the FEFA data to match province/district name with IEC/AGCHO IDs

Combined the observer numbers for Baghlan and Baghlani-Jadid (since the former was absorbed into the latter in 2005)

Combined the observer numbers for Sia Gird and Ghorband under Syahgirdi Gho (Syahgirdi Ghorband; IEC/AGCHO 0307)

Added these places to the rosetta and district centroid files:

  • Laja Mangal, Paktya IEC 1312 AGCHO 9992
@drewbo
Copy link
Author

drewbo commented Jul 10, 2014

For mapping the results to the 2009 district shapefile (allowing me to bring in the population data) I did the following:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment