I downloaded a Shapefile from the Census on the 113th congress broken down by district nationally: http://www2.census.gov/geo/tiger/TIGERrd13_st/nation/tl_rd13_us_cd113.zip

Within the .dbf file, there were no good indicators of how the districts are normally laid out (Eg. PA-15); each state was assigned a number and then a congressional district, so I figured out what the state codes meant (based on other census shapefiles and how many districts were in each state and made a new column that I'm 99.9% sure is right based on the information given. The first four rows are what came with the shapefile and the last highlighted row is what I added:

Modified DBF.jpg

And here's what it looks like when I run a query for the districts that I've defined as Pennsylvania:

"Pennsylvania" GIS.jpg

Pretty sure that's not what Pennsylvania looks like! Can't figure it out -- because, again, I'm really sure that I defined each state's number as the proper actual state. Any ideas as to what might be wrong?

And sorry about all the links to pictures -- since this is my first post, I'm not allowed to post any images or more than two links yet.


  • Did you identify 42 as Pennsylvania's state FIPS code? Here's a list of the state FIPS codes: bls.gov/lau/lausfips.htm
    – mkennedy
    Feb 19, 2013 at 23:41
  • I did! And thanks for the list; I didn't have that at first. So any idea as to why my list when I narrow the state to 42 still gives me the broken picture that I posted above?
    – Ryan
    Feb 20, 2013 at 22:14

2 Answers 2


Setting a filter "STATEFP"='42' on the original dataset gives a good picture: enter image description here

  • Thanks, Andre! If that's what "STATEFP"='42' gives you, then there must be something wrong with something I'm doing? Cause when I query that, I get the same picture as I posted above. Any idea what I should do to combat that? I didn't re-order anything in the original .dbf file to the best of my knowledge.
    – Ryan
    Feb 20, 2013 at 22:12
  • Its not a good idea to manipulate the dbf file outside QGIS. Try the original dataset.
    – AndreJ
    Feb 21, 2013 at 5:17
  • Thanks for the advice. I have a Mac, and I don't know how to edit a DBF file inside of GIS -- so I open the DBF using OpenOffice, add columns in there, and use that to create my map. Is there a better way?
    – Ryan
    Feb 21, 2013 at 19:59
  • 1
    You probably sort the database, too? That surely spoils the connection to the geometry stored in the other files of the shapefile bundle. Better use Table manager plugin or Field calculator in the attribute table dialogue (bottom right icon).
    – AndreJ
    Feb 22, 2013 at 5:17
  • I must've resorted it accidentally, when I downloaded it again and queried to state 42, it showed Pennsylvania without problem. Can you let me know where to get those plug-ins?
    – Ryan
    Feb 22, 2013 at 6:11

If you only want PA congressional districts:

Only download the PA congressional districts - tl_rd13_42_cd113.zip.

It will be smaller, faster, and you will not need to filter, modify. The census data is available but sometimes difficult to understand,interpret the file names and fields. If you nose around a bit, you can find file name definitions and field name definitions.

Here is a list of publications concerning FIPS codes used in the census data. You will have to search for the publication of your interest. And here is a list of state and county codes from the census bureau.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.