Geocode by Grid Name

2182
6
09-14-2016 01:31 PM
BrandonAdcock1
New Contributor II

I'm kind of new to GIS, so I may not have all the terminology right, but I'm hoping someone can help.

I have a table of data (concentration of chemical X) and each reading is referenced to a grid number.  I have a shapefile that gives these grids a location and I can create a map with the grids on it.

I am looking for a way to use the shapefile (or a derivative of it that contains the geography) as a address locator of sorts to match each of the data points to the grid in which it was collected.

Any help or guidance would be greatly appreciated, thanks.

0 Kudos
6 Replies
RebeccaStrauch__GISP
MVP Emeritus

Would using a SpatialJoin work for you"

Joins attributes from one feature to another based on the spatial relationship. The target features and the joined attributes from the join features are written to the output feature class

Since you can make a map, I'm assuming the table of data already has x/y coordinates that can be represented as points (?) as an event-table and/or shapefile/featureclass.  And the Grid are polygons with attributes.  Using the Spatil Join can give you the information from both tables.  Not quite Geocode-ing, but might be what you are needing.

Spatial Join—Help | ArcGIS for Desktop 

BrandonAdcock1
New Contributor II

That's the idea I'm going for, except the concentration data does not have a spatial reference except the grid reference.  The grid is a shapefile with polygons for each grid, so they have the spatial information associated with them.  The table of concentrations looks a little like this for clarity.

GridConcentrationCollection Date
123159/8/16
123168/30/16
124209/8/16

Then I have a shapefile of grid polygons.  Spatial join would be great, except the concentration data points do not have x/y coordinates, so I would like to derive/approximate the x/y coordinates from the grid number, then I am hoping to do all sorts of cool stuff with this data.  🙂

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

If the Grid polys have the Grid ID, and the concentration data points have the same Grid ID, you can use

Join Field—Help | ArcGIS for Desktop    to make a permanent join, or use  Join or Relate for temporary. 

edit...and if you do this to a copy of the grid, you can then use Converting polygons to points—Help | ArcGIS for Desktop   to get this to a point feature.  if the grid are squares, should be the center...but there are other ways to get that too.

JoeBorgione
MVP Emeritus

Just so I have it straight, you have a polygons shapefile in which each of the polygons are labeled in a fashion shown above, right?  If so, you have  the essence to geocode with:  

Your 'address table' is the Concentrations table, and the 'address' of each is the value shown in the Grid column.  

The data you will match your addresses to is your grid polygons.  (If it's truly a shapefile, do yourself a favor and create a file geodatabase and import the shapefile into it as a feature class. You'll thank me sometime down the road)

Create a 'General- Single Field' style locator and reference the Grid-ID field as the KeyField using the polygon data as your reference data:

edit:  Or you can follow rastrauch123‌ 's excellent procedure ( that she slipped in while I was posting my suggestion....)

That should just about do it....
BrandonAdcock1
New Contributor II

Than k you both for your help.  This did exactly what I wanted it to do.  I used Joe's solution and it worked beautifully.  Now I have these observations spatially correlatied to the grid layer!  Wahoo!

The only small caveat was that since the block ID field was a number field, so the tool would not use that field as a single line address field.  I had to create a new field that was a text type field, then use the filed calculator tool to move the block ID's into it, thereby making the block ID's text.  Small thing, but may be a sticking point for others looking for this solution.

Again, thank you both for your help.  I'm super excited to use this to create some beautiful maps. 🙂

JoeBorgione
MVP Emeritus

I think if you use the VB Script parser, a number will go straight into a text field.  Python will want you to use the str() function:

NewTextField = str(!NumericField!)

That should just about do it....
0 Kudos