1

I have congressional district layer and a csv file with addresses. I'd like to extract all addresses and their corresponding congressional district. How do I do that using Qgis?

The CSV File contains 3 columns including X,Y coordinates. When I import the CSV file with addresses the CRS = WGS84 (EPGS 4326).

The Congressional District layer CRS = +proj=lcc +lat_1=34.03333333333333 +lat_2=35.46666666666667 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000.0000000001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs

I am using QGIS version 2.0.1.

@Morgan Ellingham, after following your steps, I ran into the following error prompt:enter image description here

  • 3
    Welcome to gis.SE. To avoid us telling you things you already know, and to help us guide you in the right direction, can you expand on your question (just click edit below the question) a bit. In particular, you could include the format in which you layer exists, the version of QGIS, the data in the CSV file (e.g. whether it has some kind of coordinates includes, or you need to look up the addresses), how you've gone with importing the CSV file, and details of the research you've already done before you posted. – BradHards Feb 4 '14 at 6:07
4

Assuming you have coordinates in your CSV file, load it using the Add Delimited Text Layer.

Then pick your columns with the coordinates, here is an example:

Adding delimited text layer

Then add in your boundary layer, so you see your addresses and boundaries in the map:

map example

Then you can use a couple of methods, I like the Join Attributes by Location utility under the Vector > Data Management tools menu:

Select your target layer, in this case your addresses (my case skate parks), then join layer, in your case districts (in my case LGA), select your output file and directory and you're away!

Join attributes example

Click yes to add the new layer to the map and you should have a layer of addresses with the district as an attribute.

If your layers have a different CRS, you may have to save one of them to match the other, to do so use the Save As function under the Layer menu. Pick Selected CRS to match the other layer using the Browse button. Save the layer somewhere logical and use the new layer to run the process again:

crs

  • Mr. Ellingham, I ran into an error message. It's posted with my original post. Kindly, let me know if there are some things I overlooked. – user26518 Feb 4 '14 at 23:45
  • The CRS of the two layers do not match, meaning they are projected differently, try running it anyway and check your results as the CRS might be spatially nearly identical. If not, you will have to save one of your layers under the Layer Menu > Save as ... and then ensure you pick the CRS of the other layer. Use the newly saved layer and go through the process again. – Morgan Ellingham Feb 4 '14 at 23:47
  • Ah, now seeing your comments, yes, save your districts layer to match the address CRS, eg WGS – Morgan Ellingham Feb 4 '14 at 23:54
  • Awesome! I matched both CRS and it worked. Although, it gave the same error prompt (Warning: Input layers have non matching..) – user26518 Feb 5 '14 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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