RBH's Maps (Now, Atlas Election Entry Script & County Map Generation) (user search)
       |           

Welcome, Guest. Please login or register.
Did you miss your activation email?
April 19, 2024, 06:49:04 PM
News: Election Simulator 2.0 Released. Senate/Gubernatorial maps, proportional electoral votes, and more - Read more

  Talk Elections
  About this Site
  The Atlas
  RBH's Maps (Now, Atlas Election Entry Script & County Map Generation) (search mode)
Pages: [1] 2 3
Author Topic: RBH's Maps (Now, Atlas Election Entry Script & County Map Generation)  (Read 145501 times)
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« on: January 01, 2007, 07:50:23 PM »
« edited: January 01, 2007, 07:59:46 PM by Dave Leip »

Hi all and Happy New Year:

I've got something that you may like here:  I've created a new datatable for other offices/elections that users can contribute through an upload script and generate county maps.  The upload script is still in development and is located here.  Here are the SC 2002 Races for:

Lt. Governor here

Sec of State here

State Treasurer here

Changes to link the pages from the wiki here

The form looks intimidating at first, but really not bad once you get used to it.  It requires the entry of the year, candidate names and party, the election type (general, rep primary, dem primary), the state, the office, the source info, possible notes for fusion, etc., and a tab-delimited county data file (there is an excel template linked on the input form page to assist you). 

Important: Data file:
only include lines in the tab-delimited file that contain data (no blank lines or title lines)
the tab-deliminted file must have UNIX return characters (there should be an option in the text editor or possibly excel to set this).
one state at a time and must include the fips and name info as shown in the template.

For Referenda, questions, initiatives, etc., the names would be shown like
"Question 5: Yes" with shortname "Yes"
"Question 5: No" with shortname "No"

There is a bunch more work to do to get the linked pages from the election summary to work properly for these elections (will be forthcoming).  Also, credit will be shown on the state summary page for the contributor.  Other offices can be added.

Please submit feedback (feature requests, bugs, etc.)

Enjoy,
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #1 on: January 02, 2007, 11:01:23 AM »

Ok, either I did something wrong on this entry, or there's something wrong with the script

https://uselectionatlas.org/RESULTS/state.php?year=1984&off=3&elect=0&fips=21&f=0

The map shows up, the results table doesn't

Thanks - this was a code error in the State script.  Corrected.
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #2 on: January 02, 2007, 11:03:21 AM »

It only allows you to upload a race once, even if you need to upload it again due to an error.

I've added the ability to over-write the data (if you were the person who entered it).  If you find an error in data that someone else submitted, please post it here, or email me.  This script change deletes all the old data before re-writing it - so be sure that you enter all the info again.
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #3 on: January 02, 2007, 11:08:28 AM »

Very cool...although I'm a little confused.

I may be doing something entirely wrong, or my software is corrupting the CSV files somehow...but I did them in what I think is the correct format, and I'm still getting failure on everything.  No commas or anything.  I cannot seem to find the place in Excel where the UNIX line character is customised.  RBH, can you help me out here?

I am also getting the inability to upload issue.

Hi Alcon,
none of the county data were uploaded - the candidates, sources info show up in the database.  Note, do not use a CSV file, but rather a tab-delimited file.  Try this and let me know if it works.
Thanks,
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #4 on: January 02, 2007, 01:18:08 PM »
« Edited: January 02, 2007, 01:20:35 PM by Dave Leip »

It only allows you to upload a race once, even if you need to upload it again due to an error.

I've added the ability to over-write the data (if you were the person who entered it).  If you find an error in data that someone else submitted, please post it here, or email me.  This script change deletes all the old data before re-writing it - so be sure that you enter all the info again.

I get this messege when I try re-entering info for one race:

"Error: Geographic type Type for Name is not in database. Please check spelling or email Dave

Errors Encountered. Data not entered. Please correct and resubmit."

Hi,
This means that one of the geographic county types is not in my database.  The third column in the data file is the type of geographic unit (State, County, Parish, City are examples).  If any of these does not match an entry in my database (or is misspelled), it will generate this error.  Do you have other names in the list of data? 

It looks like in this case, the top row (label row) is in your data file. Be sure that you have deleted the label row and include only data lines in the file.
Thanks,
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #5 on: January 02, 2007, 02:29:59 PM »

Also note: avoid posting Gubernatorial and Senatorial contests in the 1990s as they will be added in bulk soon.
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #6 on: January 02, 2007, 02:47:49 PM »

  I cannot seem to find the place in Excel where the UNIX line character is customised. 

For new line translation, I use BBEdit (there is also a free version called TextWrangler) from Barebones on the Mac.  For PC/Linux land and MacOS X there is a small utility called flip to convert windows/mac newline characters to UNIX:

http://ccrma-www.stanford.edu/~craig/utility/flip/

Other options from the PC users?
Thanks,
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #7 on: January 02, 2007, 02:59:04 PM »

Also note: avoid posting Gubernatorial and Senatorial contests in the 1990s as they will be added in bulk soon.
Dave
Texas Tresurer Races are fair game though: https://uselectionatlas.org/RESULTS/state.php?year=1994&off=8&elect=0&fips=48&f=0

Texas data is pretty easy to gather. Nothing like the Mississippi data (the ones that are still on photocopied handwritten precinct returns)


Yeah, Texas, Florida, Kentucky, South Carolina, Georgia, among others have easily-accessible data for state-wide races in the 1990s/00s and are fast to add using the new script.  And think of all the time saved by not needing to color the counties with Paint ! Smiley
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #8 on: January 02, 2007, 06:44:06 PM »
« Edited: January 02, 2007, 06:53:56 PM by Dave Leip »

Another tip.  In the data file, be sure to replace any commas in vote numbers (such as 7,900 votes) with "nothing" and not space (needs to be 7900 and not 7 900).  Another way to do this is to format the data in excel as "General" prior to saving as tab-delimited .txt file.

I've also reposted the template xls file to change the formatting of the vote columns to "General"
Thanks,
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #9 on: January 02, 2007, 07:09:35 PM »


Error: Geographic type Type for Name is not in database. Please check spelling or email Dave

Check to be sure that the header row has been removed from the data file (data file should only include county, city, and state-level data rows and no column titles)
Errors Encountered. Data not entered. Please correct and resubmit.



I get that error now. I was using OpenOffice before and there was no .txt option, so now I am using Excel and saving it as tab-delimited .txt file and still having trouble.

This error means you have extra "stuff" in your data file.  In the case of WA 1972, you have two issues: the column headers are still in the file (first row) and second, all U.S. Counties are in the file when all you want to enter is Washington.  The data file needs to be just the data you are entering, no more, no less.  In your case, the first piece of data in the file needs to be 53001.

What I do is highlight the data from the state I want and copy it to a new blank spreadsheet then simply choose save as tab-delimited text.

I'll think a bit so see if we can make this more versatile.  I'm also now going to try open office and get back to you on its potential.

Thanks.  and thanks for the patience and help here to make this better.
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #10 on: January 02, 2007, 07:17:44 PM »

Open Office can save as tab-delimited - you  have to choose csv (.txt) and then in the next step, it gives you a choice for delimit character (choose {tab}).  However, it also requires you to choose a text character (" or ').  These would need to be stripped out of the file (I think).
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #11 on: January 02, 2007, 08:48:17 PM »
« Edited: January 02, 2007, 08:50:33 PM by Dave Leip »

Most of the linked pages are still a work in progress to get them to look for the data in the new upload table.  I've also disabled the "Primary" election choice for now until I can get a better handle on presenting the data.  It'll be back.

Another suggestion:
Please limit the "Independent" row for true "independent" candidates (typically a strong showing).  Libertarian, Green, US Taxpayers/Constitution, etc. are better in slots 4, 5, etc.

You can also see the most recent list of contributed election content here  These contests will also show up in the state election page, such as: here
Thanks,
Dave  
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #12 on: January 02, 2007, 10:44:35 PM »

Another minor bug:

Third-party maps are broken (Libertarian broke 10% in Skamania County)

This has been fixed.  If a minor party receives > 5%, they get their own map.
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #13 on: January 02, 2007, 10:45:05 PM »

Dave, the green on this initiative map doesn't appear. I don't know if it was my error or a site glitch.

This glitch happend while I was fixing Alcon's bug.  Corrected.
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #14 on: January 02, 2007, 11:03:26 PM »

Here's my first shot at it: https://uselectionatlas.org/RESULTS/state.php?fips=27&year=2006&f=0&off=9&elect=0

That's the Minnesota AG race this year.

Map works pretty good, so does the tables, but not graphs or individual county data, although appears to be the case with other maps.

Hi,
One error here - the "Write-ins" are listed as being column 10, but the datafile includes them under column 5 - so they don't show up.  I'm going to add a check to the script to catch this.  Also, what is the source of the 633 vote switch?  any idea? a single county data transposed?
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #15 on: January 02, 2007, 11:04:27 PM »

Don't forget to take your time with the data.  Quality counts!
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #16 on: January 02, 2007, 11:25:27 PM »

As practice, I decided to do an easy race in a state with not many counties. So here's AZ Attorney General this year:

https://uselectionatlas.org/RESULTS/state.php?year=2006&off=9&elect=0&fips=4&f=0

Great!
Feedback:
Arizona is very good with regard to source information: in this case, the title should be "State of Arizona Official Canvass 2006 General Election - November 7, 2006".  I've made this change.
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #17 on: January 02, 2007, 11:43:36 PM »

OK, I found the error, the totals in Becker county are transposed.

Great.  You should be able to over-write the data with the corrected data.  Thanks for checking!  Quality is important in elections Smiley
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #18 on: January 03, 2007, 08:43:03 AM »

I've finished all of the do-able Washington election offices back to 1972 (click here).

Also, I notice that as it stands, red is being used for "yes" and green for "no" on initiative maps.  Isn't it generally the other way around, with "green" signifying success/go, etc.?

(Also added more to the initiative part above.)

This was an error on my part that I made late last night.  Thanks.  Yes is green and No is red.
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #19 on: January 03, 2007, 08:54:40 AM »

I've finished all of the do-able Washington election offices back to 1972 (click here).

(Also added more to the initiative part above.)

Way to go Alcon!  Great enthusiasm!  Keep it up!
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #20 on: January 03, 2007, 09:31:22 AM »

The state election page is linked at the bottom of each election page, such as South Carolina Governor 2002.  Its called "<state name> Election Results Home".  You also can select them from the pull-down menu at the bottom: Choose another Office.

They link doesn't exist in the frame version at the moment - I'll add that to the list of things to do.
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #21 on: January 03, 2007, 09:43:12 AM »

Dave, if you can, would you mind changing this to 1976?  I'm not sure there is an easy way of doing it.

And this to 2002, if it isn't too much trouble.

Corrections completed.
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #22 on: January 03, 2007, 09:46:25 AM »

And this to 2002, if it isn't too much trouble.

This map should also be changed to 2002- for some reason, I entered it in the wrong year. I also slightly misspelled the Democrat's first name as "Byran" instead of Bryan. 

Also note that this map was an attempt to correct the original map, which has the correct year and candidate spellings... but also reversed numbers in Athens County.

One of these maps should be deleted; the other should be fixed. My attempts to override the existing data have only resulted in error messages, so... can you help? Wink

The best way to correct for these is to over-write the data with the correct data.  Can you describe for me the errors?  You should only need to check the two boxes on the bottom of the entry form to over-write file and over-write data.

Thanks,
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #23 on: January 03, 2007, 10:49:20 AM »
« Edited: January 03, 2007, 10:53:55 AM by Dave Leip »

Jesus - there was a very obscure bug in the script that was causing the data not to be loaded if there was no Democratic candidate.  This caused your Idaho election submissions to fail.  They should now work.  As for the data.php errors, this looks to be on my end (related to the office).  I'll work on the script to show this correctly.
Thanks!!
Dave
Logged
ElectionAtlas
Atlas Proginator
YaBB God
*****
Posts: 3,629
United States


P P P
WWW
« Reply #24 on: January 03, 2007, 10:51:24 AM »

Now that's fixed, is there any way to remove this map completely? It was a dumb mistake on my part to put in the wrong year, and there's no reason for this to stay on the Atlas.

Upload the correct data Smiley
http://www.sos.state.oh.us:80/SOS/ElectionsVoter/results2006.aspx?Section=1844
Logged
Pages: [1] 2 3  
Jump to:  


Login with username, password and session length

Terms of Service - DMCA Agent and Policy - Privacy Policy and Cookies

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Page created in 0.057 seconds with 12 queries.