A direct link to the 2017 VT county sub shapefile is here: ftp://ftp2.census.gov/geo/tiger/TIGER2017/COUSUB/tl_2017_50_cousub.zip
(We could always edit the 17 national county file in QGIS & create a 2017 VT-only county shapefile, but let's keep it simple.)
I'm pretty sure the town names are in the same order in the VT_Elections_Database__2000_U_S sheet. But since I'm not, 100% sure, I'll use a =vlookup or =sumif formula:
I can explain these formulas in more detail upon request.
Finally, name Column D "Gore-Jeffords" in D1. Type =B3-C3 in Cell D3 and copy and paste down to cell D249.
1) Create a new spreadsheet in the Vermont.xlsx and call it "2000 Import Data"
3) Since we're only interested in making a map of the Gore-Jeffords PCT, Label Column C in 2000 Import Data "Gore-Jeffords PCT".
5) Copy and paste the formula in C2 through Cell C256.
So copy and paste that column, either by inserting it into Column C or after the data in column D of the data sheet.
This should leave 10 towns to manually check.
We'll need to add three layers to this new project. This can be done by hitting the V looking button on the left.
1) Make sure you're able to view all files by selecting that option from the pull-down menu on the bottom right
2) Select tl_2017_50_cosub.shp from the list
3) Hit Open.
Notice how Vermont looks too wide. We need to change the projection.
1) Click on the globe icon on the bottom right of the screen.
A dialogue will appear.
2) Check the Enable on the Fly box, if it isn't already
3) Type "Vermont" in the Filter
4) Select a Vermont-specific projection below - NAD 83(HARN)/Vermont or whatever
5) Hit OK
1) Hit the V looking icon on the top left to open a vector layer
A dialogue will appear:
3) Navigate to where you saved Vermont.xlsx
4) Click on it
5) Hit Okay
1) Scroll down and select "2000 Import Data"
2) Hit Okay
1) RIGHT-CLICK on tl_2017_50_cousub in the Layers Panel
2) Select Properties from the drop-down menu
A new dialog will open up.
1) Select Joins on the left
2) Hit the + Button on the bottom
Yet another dialog will appear
1) Your Excel worksheet will likely be listed as the join layer. If not, select it by name
2) Select GEOID as the Join field
3) Select GEOID as the target field
5) Hit OK.
1) Hit the button in the ribbon that looks like the Connecticut Avenue Monopoly card. If you don't know what that is, see 1 below.
2) Scroll to the far right and make sure that the circled joined columns exist & ...
2) Select Style on the left top of the Property Dialog
3) Select Style on the bottom left. A menu will appear
4) Select Load Style, and find your style file from where you saved it
1) Select the arrow next to PWINCODE
2) Select V_Gore-Jeffords PCT from the drop-down menu
3) Hit OK
1) I should have checked the Excel data to ensure we weren't missing a town. I do this by totaling or averaging the data in the source and import spreadsheets. If they're equal (without the 10s), the import data likely isn't missing or doubling anything.
I put the -1 in this example to make the geometry appear white if there's an error, since the 8 Color Scale assigns 0 to red.
1) Make sure ESRI Shapelfile is selected in as the format
2) Click Browse, navigate to where you want to save your file & name it
4a) (Optional) Deselect the Add Saved File to Map box below the field window, if you don't want to add it
4b) Hit OK
Most of the names are self-explanatory.
The New 25 [color].qml styles are used when you want to map 1 candidate's percentage.
The Tiger/Line shapefiles are huge and are not clipped to the coasts. The Cartographic Boundary shapefiles are smaller and generally clipped to the coasts.
This would be a good time to save the project by hitting the disk icon on the toolbar or CTRL-S.
=if(sum(O2:R2)=0,10 will make the county dark grey if there are no votes. This is more important for election night mapping that historic mapping..
if(max(O2:R2)=large(O2:R2,2),9 will make the county light grey if there is a tie.
if(R2=max(O2:R2),R2+1 will create a shade of green if Perot (I) won the county
if(O2=max(O2:R2),O2+2 will create a shade of blue if the Dem won the
The final -1 will make the county white if there's an error.
The next step would be to add a GEOID column to the county names so that we can do a join. This was covered in the first part of this tutorial. Fortunately, Drew has already provided a sheet where he has done this.
Load Texas.xlsx into QGIS as a Vector File. Do this by either dragging the sheet's icon to the canvas or selecting the V icon on the left and browsing to find the file.
2) Click on Style at the bottom and
3) Load 7ColorScale New 25.qml from where you saved it.
2) Hit OK
Later tonight: how to use the print composer to make a map.
2) Hit Okay
Voila! The Perot percentage in every county is now mapped!
You can very easily print a simple map by selecting Project-->Save as Image from the far left of the top ribbon's drop-down menu. But you can use QGIS' Print Composer to make a more professional map.
1) Clicking on The rolled-up map looking icon on the left lets you draw a map on the canvas.
2) The mountain icon adds an image.
4) The Three Squares icon adds a legend.
5) The ruler-looking icon allows you to add a scale bar.
6) The disk icon on top saves the project.
7) The mountain image with an out arrow exports your image to file.
8) The icon with shapes adds shapes.
X min: 850000
Y min: 6850000
X max: 2200000
Y max: 8100000
The PC should look like this:
1) Click on the Composition tab
2) In the Resize Pane to Content tab, type 75 in the box next to right to allow room for a legend
3) Hit the resize page button.
1) Click on the 3 square legend icon and draw a rectangle on the right side of the page.
2) Select the Item properties tab
3) Click on the funnel icon to include only features on the map
4) Deselect the Auto Update check box
-The columns menu allows you to make your legend span multiple columns. Default is 1 column
-The symbol menu allows you to change the symbol size
-The spacing menu allows you to change the legend spacing
-Background allows you to turn the background on or off and change its color
1) Click on the T in a box icon
2) Draw a rectangle on the right side of the canvas that will hold your text.
3) Change the Font as you wish. I use Bold 24 point type.
4) Type the legend you want in the box under Main Properties.
1) Click on the ruler-like icon. Click on where you want to place it on the canvas. A Scale bar should appear.
2) Click the Item properties tab
3) Since this is an American map, change the Scalebar units to feet
4) Changing the segments to Left 0
5) and Right 2
You can make the scale bar narrower by:
6) Changing the height to 1.00 mm
Move the scale bar to the bottom of the canvas next to the map.
1) Click on the composition tab
2) Change all the margins to 0 and hit resize page
3) Hit the mountain with arrow icon on the top of the page. Decide where to save your pic and name it.
1) If you're going to use the pic on a website with size limits, change the Export Resolution to 100dpi. It doesn't matter on Twitter.
2) Click the crop to content box
3) Hit save.
Congratulations! You've made a 1992 TX pres map! It should look like this:
For this exercise, we'll need a Mexico and CONUS shapefiles. The CONUS simplified county shapefile will do. That's available here, if you haven't downloaded it already (5m version): census.gov/geo/maps-data/…
1) If you did the shapefile splitting lesson, check the box to turn US County on
3) Click on Simple Fill
4) Double Click on the color next to Fill. A new dialog will appear.
5) Change the HTML notation to #707070. Hit OK.
7) Changing the outline style isn't necessary, but you can change it to "No Pen" if you wish.
9) Click OK.
Your map should now look like this:
Change the name of the Mexico shapefile to Mexico by 1) Right clicking on the layer name and 2) selecting rename.
Your Texas Print Composer should open up.
1) Click on Legend in the Items pane
2) Click on the Item properties tab below
3) Click Update All
The items will update. Unfortunately, this also changed you Bushes back to R, Perots to I, etc.
5) Hitting the down arrow until it's at the bottom
6) Open up the Texas County names by clicking the down arrow
7) Rename the Rs to Bush, Is to Perot and Ds to Clinton.
1) Click on Map0 in the Item pane
2) Click on Item Properties, then Update Map the US and Mexico should be added to it.
3) Scroll down to Background (off the image). Open up the menu and double click on the color.
Move whatever you need to move around on the map to make it look presentable (click on the item in the item pane first before trying to move it). When you're ready to save it, click the mountain icon. Your final map should look like this:
The 5) + magnifying glass allows you to draw a rectangle on the canvas to zoom in.
The 6) - magnifying glass allows you zoom out.
The 8) magnifying glass with the arrows zooms to the full layer extents of the selected layer.
The 9) yellow box with arrows icon zooms to the selected geographies; and
The 10) hand icon allows you to move around the map
Next, we need to add Precinct IDs to the various precincts so that we can merge data. I like to add two columns - one with the precinct name, another with what the state's VTD layer would likely use as a GEOID.
1) Hit the Select Features Icon on top.
2) Make note of the name of a precinct and click on it.
3) Because the selected features are up top, all you need to do is click on the top entry in the Name Field and add it (here, Parsons).
Those are the instructions for making a simple shp from a good vector pdf source with a perfectly georeferenced precinct polygon layer. Tomorrow or Wednesday, I'll try to explain what I do when it's not perfect.