How to Obtain US City from Coordinates

1337
2
Jump to solution
01-30-2014 08:33 AM
KaelDowdy
New Contributor III
Hello,

I'm trying to obtain the US City name for a list of lats/longs I have in a spreadsheet, but am running into difficulties over what I would have assumed to be a relatively simple task 😛

Here's what I've done so far:

  • I first created a Personal Geodatabase, opened up the .MDB in Access and imported the spreadsheet into Access.  My first thought would have been to export the spreadsheet as a .DBF and import it into a File Geodatabase, but I'm using Excel 2013 and it appears Microsoft has dropped support for DBase formats :mad:

  • After importing my spreadsheet into Access (which only has a unique identifier, a latitude, and a longitude), I then opened up the .MDB (file geodatabse) back in ArcMap, right-clicked on the table in the Catalog window, chose Create Feature Classs >> From XY Table.

  • In that table, I chose my Longitude as my X Field and my Latitude as my Y Field.  The geographic coordinate system I used was WGS 1984.

  • After hitting OK, my table was converted to a new Points feature class after a few minutes.

  • Then, taking my newly created feature class, I attempted to perform a Reverse Geocode on the point locations.  I chose my point feature class as my input, chose Address Locators\MGRS as the Input Address Locator (the only option available to me), and left the defaults for the remaining inputs.

  • Then, a secondary point feature class was created, which now contained my original fields from the first point feature class, and it added an MGRS Coordinate field.  This was the feature class I expected to see fields such as Address Number, Street Name, City, State, etc.  However, none of these fields were present.

I tried looking for polygon layers containing city/state boundaries, but didn't run into anything that looked promising.  My thought was that if I could have a polygon layer, I could do just a simple spatial join, and merge my point data with the polygon layer containing the city/state info to associate a particular coordinate point to a particular city.

Perhaps I'm not "setting the stage" so to speak with how my initial points were created with my XY coordinates, but I'm not sure what else I could do differently in that regard.

Any thoughts on how to obtain the a city value for a set of coordinates?

Thanks!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Frequent Contributor
Keal,

The MGRS locator you gave used will just give you the military grid reference for each of your points, you need to use the online world geocoding service, but this is by subscription:

http://www.arcgis.com/home/item.html?id=305f2e55e67f4389bef269669fc2e284

More info here:

http://geocode.arcgis.com/arcgis/index.html#/Batch_geocoding/02q000000004000000/

There are older services around which may still work:

http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer

Regards

Anthony

P.s. You could always just download a shapefile of the cities and perform some sort of spatial join on your data:

http://www.baruch.cuny.edu/geoportal/data/esri/esri_usa.htm

View solution in original post

0 Kudos
2 Replies
AnthonyGiles
Frequent Contributor
Keal,

The MGRS locator you gave used will just give you the military grid reference for each of your points, you need to use the online world geocoding service, but this is by subscription:

http://www.arcgis.com/home/item.html?id=305f2e55e67f4389bef269669fc2e284

More info here:

http://geocode.arcgis.com/arcgis/index.html#/Batch_geocoding/02q000000004000000/

There are older services around which may still work:

http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer

Regards

Anthony

P.s. You could always just download a shapefile of the cities and perform some sort of spatial join on your data:

http://www.baruch.cuny.edu/geoportal/data/esri/esri_usa.htm
0 Kudos
KaelDowdy
New Contributor III
Keal,
There are older services around which may still work:

http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer

Regards

Anthony

P.s. You could always just download a shapefile of the cities and perform some sort of spatial join on your data:

http://www.baruch.cuny.edu/geoportal/data/esri/esri_usa.htm

Ahhh...the more I looked online, the more I realized that the geocoding/reverse geocoding functionality I was attempting to do withing ArcMap was more of a subscription-based service!

I just looked at that old GeocodeServer link you sent.  I can probably write a VBA script in Excel to process each of the coordinate records and then consume the JSON response for each request...and then parse out the info I need.  It looks promising, but don't know if I'll run into performance issues, or hit some maximum request count per IP per day, or some other throddling mechanism.  My report is more of an ad hoc request, so I might be okay as the dataset is only several thousand rows and may not hit any big problems.  Now, if I were to need to push through a bunch of data many times a day, that'd be a different story.

I didn't see the thing about the shape file earlier; I might look at that first since that's where I was going about doing a spatial join earlier and won't have to worry about hitting some API which may or may not work all the time.

Thanks for the ideas, Anthony!

Kael
0 Kudos