Select to view content in your preferred language

ArcGis 10 - How to add x, y data to feature class

4537
3
05-03-2011 11:36 PM
MarcusPreis
New Contributor
Hey experts,

I tried to enhance a shapefile with longitude and latitude coordinates in order to show points on the map. The aim is to do dynamic geocoding in the sap. Therefore I need to enrich my shapefile with the attributes longitude and lattitude.
My first step was to create an adress locator. I tried different options, but I always receive the error: 000042: Failed to create address locator.
Then I tried it with the "Make XY Event Layer function". The function seems to work fine, but no points are displayed on the map. If I click on the new generated layer, I am asked to "set a data source".
I don`t know what to choose there.

Is this the right way? Any solutions to these issues?

Regards
marcus
Tags (3)
0 Kudos
3 Replies
FrankBenitez
New Contributor
Hey experts,

I tried to enhance a shapefile with longitude and latitude coordinates in order to show points on the map. The aim is to do dynamic geocoding in the sap. Therefore I need to enrich my shapefile with the attributes longitude and lattitude.
My first step was to create an adress locator. I tried different options, but I always receive the error: 000042: Failed to create address locator.
Then I tried it with the "Make XY Event Layer function". The function seems to work fine, but no points are displayed on the map. If I click on the new generated layer, I am asked to "set a data source".
I don`t know what to choose there.

Is this the right way? Any solutions to these issues?

Regards
marcus



I'm not an expert, but maybe this helps:
Did you try the "Add XY Coordinates" in ArcToolbox?

Adds the fields POINT_X and POINT_Y to the point input features and calculates their values. It also appends the POINT_Z and POINT_M fields if the input features are Z- and M-enabled.

Regards,

Frank
0 Kudos
denisedavis
Deactivated User
You can also use the "Calculate Geometry" on a field if you already have a lat and long field created.
0 Kudos
Zeke
by
Honored Contributor
If your shapefile or data frame is in lat/long GCS, you could do this pretty simply and quickly:

1. Add two float fields - call them lat and lng, or something else if you prefer
2. Right click the field heading, select Calculate Geometry. Select either X point or Y point from the dropdown as appropriate for that field. X = longitude, Y = latitude.
3. Select whether to use the shapefile coordinate system or the data frame one.
4. Click Ok, and you're done

This won't work to give you lat/long if neither the shapefile or the data frame is in a GCS. If both are projected coordinate systems, the results will  be in that as well. You might try adding your shapefile to a new, empty map where you've first set the data frame to whatever GCS you want to use, then do the above. Your existing map will still be fine, but your shapefile will then have lat/long attributes.
Technically, maybe you could just switch your existing data frame to GCS, perform the above, then switch back, but I like to keep the process cleaner.
0 Kudos