[GIS] Issue on Exporting Shapefile Points to Google Map Longitude & Latitude

arcgis-10.2arcgis-desktopgoogle-maps-apiweb-mercator

Using ArcGIS 10.2 and Some points in Shapefile with BC Albers Coordinate System I am having problem on Getting Points Longitude & Latitude in Google Map Coordinate System. What I have is a CSV file contains the X and Y data in BC Albers Coordinate System. I Followed these steps :

  1. I Uploaded The CSV File Data into Map Using File –> Add Data –> Add XY Data…
  2. After Getting the points on the Map I Used Define Projection tool to apply BC Albers Coordinate System into the Layer.
  3. The I used the Project tool to transfer Projection from BC Albers (PCS_Albers) to WGS 1984 Web Mercato (auxiliary sphere)
  4. Finally I used the Add XY Coordinate tool get the X and Y of the points on the table. the result look like:

enter image description here

As you can see the POINT_X and POINT_Y are different than original x and y and when I export the map to KML the data are correctly display on Google Map and Google Earth BUT I need to export these data in MySQL database and get the Google Maps Markers from the POINT_X and POINT_Y which in this case I am getting absolutely wrong location of the points on the Map!
I checked one of points, for example I got

table3.png

from table and it renders correctly on the map but when I get the same location from What's Here function on Google Map I am getting Totally different number for Lat and Long as:

cap.png

gmap.png

Now as I mentioned before I am going to upload my data into MySQL database and use them through Google Map JavaScript API and get them by PHP, so I NEED to have the actual latitude and Longitude values in ArcGIS.
Can you please let me know how to do this?

Best Answer

In QGIS, while in an edit session create new columns for X and Y values in float precision data type.

Then open the Field Calculator, update the new X and Y columns with the Geometry > $x and $y option:

enter image description here

If in ArcGIS you want to create fields that simply contain the X and Y or your data, no matter what coordinate system your data is currently assigned, you can use the Calculate Geometry option in the attribute table.

First create new fields to hold the X and Y data

Then right-click the X and/or Y fields and choose calculate geometry

enter image description here

The dialogue will give you the option to populate the X / Y column with

X Coordinate of Point Y Coordinate of Point

I think you can cheat your projection by setting the Data Frame projection to WGS 84 / EPSG 4326:

enter image description here

Related Question