0

This question already has an answer here:

I have many polygons which represent different areas (with different plant species in each of them).

I want to “link” some information to the polygons in order to later be able of seeing which kind of vegetation is in each of the areas (or polygons).

I attach an image so that you can see better what I am trying to explain and do.

The attribute tables of all the polygons are like shown in the picture, and I would like to add the information there is in the excel table.

In each polygon I want to have the information corresponding to the row belonging to the area (as you can see each area has a number and correspond to a specific polygon).

Then, in each polygon should have the same amount of species (all of them) and the information which will be specifically belonging to the area (or polygon) which is based on the numbers (1, 2, 3 or 0) which correspond to the abundance of each of the species in each area.

After, I will need to select the different areas or polygons by if they have 3 of Acer campestre, or 1 of Calluna vulgaris…. For example when selecting by attributes to select: 2 of abundance of Acer campestre species and then all the polygons with this characteristics to be in another colour.

marked as duplicate by Evil Genius, Paul, Community Oct 5 '15 at 17:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

From the picture it almost appears that each polygon is a specific layer (Attribute Table reads "0 out of 1 Selected", Layer name is area7_poly, all polygons are different colors), but the excel file, not to mention your post, both indicate that there are many polygons.

If they are indeed each separate layers, then this answer will not suffice, but since I can't tell, I'll carry on with what my answer would be if they aren't all separate.

To bring the tabular data (your excel file) into ArcMap and associate it with your polygons, you will need a unique identifier field that is common between the shapefile and the excel document (but obviously unique for each record). Adding this to your excel document is as easy as naming a new column something like ID and populating it with incrementally growing numbers.

You will then want to put in a unique ID field in you Attribute Table so that the ID in one file corresponds to the ID in the other (the ID for any given shape matches the ID for its information). You can add a field to the Attribute Table from the options menu. Pick a short integer and name it ID.

Right-click your new field and select Field Calculator. At the top of the window, check the box next to Python, then check Show Codeblock and paste this in the top box:

rec=0
def autoIncrement():
global rec
pStart = 1
pInterval = 1
if (rec == 0):

and in the lower box paste:
autoIncrement()

Click OK and let it run. Your new ID field should soon be populated. If you don't want to mess with this bit of code you can instead choose to Edit the polygon layer, then open the Attribute Window (on the Editor toolbar). This will let you select the polygons one by one and fill the field, one polygon at a time (one must be selected for the Attribute Window to show anything).

Once you have the ID fields in both files, bring in the excel file either through your catalog or through the Add Data button. Once it is there, right-click your layer, select Joins and Relates > Join. Assuming your excel file is the only one you've brought in, it will be selected by default. Pick your ID field in both the drop-down boxes and click join (Validate the join if you wish, just to test that they match). Soon enough you will be able to open the Attribute Table and see all the fields from your excel document joined.

For the second part, you will perform either a Definition Query (Properties > Definition Query) or a Selection > Select by Attributes. This is fairly straightforward in either case. You will select the field you are filtering by, say Acer campestre where it grows strongly or dominates, so you will use the basic operators and produce something like "ACERC >= 2" to select out those specific areas you wish to analyze.

  • Hey! I have all the polygons in diferent layers, how can I have them only in one layer? cheers – Marta Bosque Oct 3 '15 at 9:28
  • Perfect!!!I think I have it now! I can do it :D :D – Marta Bosque Oct 3 '15 at 9:41
  • @MartaBosque If this answer solved your problem, please mark the answer as "accepted." You can read more here: gis.stackexchange.com/tour – Sara Barnes Oct 5 '15 at 15:19
  • @MartaBosque To get the polygons into one layer, you can use the Merge geoprocessing tool... youtube.com/watch?v=1-9f1C7XIZE – Sara Barnes Oct 5 '15 at 16:03
0

For the first part of your question, not sure if I understood the second part:

What you are searching for is a join.

To do a join you need one unique attribute for every row in your excel - in your case Area1, Area2 etc. - and in your attribute table - like above Area1, Area2 etc. for every feature.

After that you right click on your feature class in your table of contents and then "join and relates" --> "join...". Under 2) you select your excel table, and under 1) and 3) the mentioned above unique fields (before you have to check that your column in excel and feature class have the same format, for example text or double; you can't join a text field with a double field).

After that you should find your data from the excel table in your feature class attribute table.

More information under http://resources.arcgis.com/EN/HELP/MAIN/10.1/index.html#//005s0000002n000000

0

For the second part, it sounds like you need to do a definition query after you've joined the excel table.

Go into layer properties > definition query tab > use the query builder to build an expression like: Acer campestre = 3 OR Calluna vulgaris = 1. That should select, and only show you, those features that satisfy that definition.

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