Adding XY (Lon, Lat) Coordinates to a shapefile

Problem: I have a point shapefile that I want to use with Tableau, but the data does not have X,Y or Longitude, Latitude in the dataset. What do I do?

Both ArcGIS and QGIS have the ability to add this data to shapefiles relatively easily.

Important: The point file must first be projected, otherwise the coordinates will not work with Tableau.

ArcGIS

My layer/dataset is called “fdia_eng_pnt”.

1. Open ArcToolbox

2. Goto Data Management Tools -> Projections and Transformations -> Feature -> Project

3. Pick your input and output datasets

4. for the Output Coordinate system, pick WGS 1984 (EPSG:4326).

5. Click OK

Once this process is done, the new layer is added to ArcGIS.  Next…

6. Go to the Geoprocessing menu, then select Python. This will open the Python command window.

7. Type the following command (I know, so old-school…) and press enter:

arcpy.addxy_management("fdia_eng_pnt")

8. ArcGIS will create 4 columns in the dataset: Point_X, Point_Y, Point_Z, and Point_M.

addxy

QGIS

First, to reproject the data:

1. Go to Processing -> Toolbox.

2.  In the toolbox, go to Geoalgorithms -> Vector -> General tools -> Reproject layer.

3. For Target CRS, select EPSG:4326

4. Run, this will create a new layer.

Here is a link to an app company called Fulcrum that has step by step instructions for creating the same columns in QGIS.

Once the columns have been created, you can export the dataset to a CSV that can then be opened in Tableau.