Select to view content in your preferred language

Fishnet grid attributes - One to Many relationship

2720
2
04-13-2016 12:52 PM
ChristopherAbbott
Deactivated User

Fishnet grid attributes. We generated a fish net grid over a township with over 200 subdivisions.  We need would like to create single attribute entries for each municipal area with the list of the grid cells that cover it.  When running a spatial join it duplicates the attribute rows as 'Stone Harbor'  A3, Stone Harbor A4, Stone Harbor B3.

I would like e.g. Column 1 'Stone Harbor', Column 2 'A3', Column 3 'A4', Column 4 'B3'.

Any thoughts or blogs on the issue?

Thanks, Chris

0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus

If everything is as shown, you can split the string into 4 new columns.

this should give you some ideas

>>> a
'stone harbour ??'
>>> b = " ".join(a.split(" ")[:-1])
>>> c = " ".join(a.split(" ")[-1:])
>>> a
'stone harbour ??'
>>> b
'stone harbour'
>>> c
'??'
WesMiller
Deactivated User

You could put all the grids in a single field. When you do your spatial join use Join operation Join_one_to_one and in the field map section right click the grid field and choose properties and set Merge rule to join and choose your delimiter.

This would produce a feature class with

Name                          Grid

Stone Harbor              A1,A2,A3,A4,B3

Using the field mapping control—Help | ArcGIS for Desktop

0 Kudos