Select to view content in your preferred language

Column and Row values for polygons in a shapefile

5696
11
03-30-2016 12:39 PM
KatelijnVan_Munster
Deactivated User

How can I attribute individual polygons in a shapefile with row and column numbers so that each polygon will have its own unique combination of column and row values. Examples of shapefile types could be a simple fishnet grid, or something less regular like the counties in a state.

Right now my attribute table looks something like this:

Polygon
A

B

C

I'd like the resulting attribute table to look something like this:

PolygonColumnRow
A11
B12
C21
D22
E31

*Edited to change "label" to "attribute"

Tags (1)
0 Kudos
11 Replies
MitchHolley1
MVP Regular Contributor

[POLYGON]+[COLUMN]+[ROW]

or

[POLYGON]+"-"+[COLUMN]+"-"+[ROW]

Something like that?

0 Kudos
KatelijnVan_Munster
Deactivated User

Thanks. I had actually meant attributing instead of labeling. But this was helpful in labeling my example image in my reply to Joshua Bixby.

DarrenWiens2
MVP Honored Contributor

I'm not sure I understand what you want to happen in the case of irregular polygons (like states). Can you provide a picture?

edit: based on the following comments, you may also want to provide the starting attribute table. I think most are assuming you already have the values for "Column" and "Row" populated, but I'm guessing that's your real problem.

0 Kudos
KatelijnVan_Munster
Deactivated User

Thanks. Good point.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

A couple of questions:

  • You mention labeling, which implies that attribution already exists and you are looking to display those attributes as labels on a map.  I get the impression you are interested in attributing and not labeling, is that correct?
  • For something less regular, like counties in a state, what do you envision the rows and columns being or looking like?
    • Talking about columns and rows implies something table or grid like, which raises lots of questions when working with something irregular like counties distributed across a state.  For example, would the rows and columns be regular sizes?  If so, would the size be smaller than typical counties or larger than typical counties?  If a county touches multiple columns and rows, how would you decide which one gets attributed to the county?

For the irregular shapes you talk about, can you provide a rough illustration of what you see the result looking like?

KatelijnVan_Munster
Deactivated User

You're right, I meant attributing. Thanks.

I'm trying to input data into a modeling program that requires shapefiles to have column and row values. But it doesn't read the data attached to these shapefiles, so the data needs to be input as a .csv file with matching column and row values, if that makes sense. The program provided some sample data, including a shapefile with counties (attached picture). It seems that every county has the same column value (26, highlighted in yellow), and it is the row value that is unique for each county.

I'm just not sure how to go about attributing column and row values to a shapefile like this or to a regular grid shaped shapefile.

Detroit_Counties_Col_Row.JPG

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

In a former job, I worked extensively with state and county data from across the country.  As soon as I saw the labels in your image, I knew what the number represent.  I am not sure why they are labeled/called "rows" and "columns" in your data, but the data are FIPS/ANSI codes for States and County and County Equivalents (See: American National Standards Institute (ANSI) Codes - Geography - U.S. Census Bureau).  The ANSI code for Michigan is 26, and the other numbers you see are the ANSI codes for the individual counties or county equivalents.  If you are working with data from other states, you don't have to figure out a scheme for numbering, just use the ANSI codes that already exist.

If you are working with different irregular shaped data, then you would need to come up with some logic for ordering them like Dan points out.

KatelijnVan_Munster
Deactivated User

Oh interesting. I'll look into that. Thanks.

What about attributing row and column values to a simple grid polygon? I need to do that too for this program.

0 Kudos
DarrenWiens2
MVP Honored Contributor

It seems like row and column are somewhat arbitrary (i.e. the concept of "grid" is unnecessary, as in, polygons in the same "row" don't have to be at the same approximate Y value, and "columns" don't have to be at the same X value). If that is the case, then you can think of column as a grouping variable (e.g. all the polygons in the same state would get the same value, perhaps the state FID or ANSI or any other unique attribute, via Spatial Join) and then you can increment (there are many example on GeoNet) the value for row to make a unique combination.