I need to add a point in an existing feature class using .NET API of ArcGIS Server 10 in C# (Visual Studio 2008). I'm using a sample from ESRI Resource Center (ArcGIS_SimpleEdit_CSharp). The following shows the portion of the code that creates the new point using X/Y coordinates.

But I need to use Latitude and Longitude (with decimal precision) instead of X/Y coordinates. How can I do that? Can I just use lat/lon instead of X/Y? Or I have to convert lat/lon to X/Y before assigning feature.Shape?

Is this a trick question? Can't you just put your lat long coords in the call to the PutCoords Method? e.g. replace actionRecord.Location.X with -123.54678 and actionRecord.Location.Y with 45.890765...
–
valveLondonJun 2 '12 at 4:45

Oh no, it's not a trick question. I don't know that much about the ESRI Web API and I asked a wrong question. sorry about that. I'm going to update the question.
–
FredJun 2 '12 at 14:18

1 Answer
1

The key missing piece of information here is what spatial reference (coordinate system) your feature class is assigned, and what coordinate system the actionRecord coordinates are in. If they are different (which it sounds like they are) you will need to project the point geometry into the feature class's coordinate system.

Thank you for your answer. I need to convert Lat/Long to GCS_WGS_1984 coordinate system. I think I should refer esriSRGeoCS_WGS1984 constant for GCS_WGS_1984, but I don't know how to refer to Lat/long coordinate system. Is there any specifice constant to refere to Lat/Long?
–
FredJun 2 '12 at 22:22

I think it should be esriSRGeoCS_NAD1983 ((Datum NAD 83). Is that right?
–
FredJun 2 '12 at 22:32

"Lat/long" is not a coordinate system; latitude and longitude are are simply angular units of measurement used by geographic coordinate systems (which both GCS_WGS_1984 and GCS_NAD_1983 are), so no, there is no specific constant to refer to "Lat/Long". Only you can tell us which coordinate systems your data use. If you need to project between GCS_NAD_1983 and GCS_WGS_1984 check out this page to determine the correct transformation to use.
–
blah238Jun 3 '12 at 0:02

Ok I'm sure the coordinate system is GCS_WGS_1984 and when I add a point in X/Y format (like -13069019.954 6268616.389 Meters) everything is fine. But the thing is I have a list of Lon/Lat (like -117.396947, 48.964884) for the same point). How can I use the Lon/Lat instead of X/Y. I'm sorry if you find my question stupid. I'm a newby in GIS Web development.
–
FredJun 3 '12 at 18:36

Not at all, but there is still some missing information or confusion. There are TWO coordinate systems involved here: the one used by your feature class, and the one used by your list of points. From the sounds of it, your feature class uses a projected coordinate system (since it is in meters, apparently), and your list of input coordinates is in a geographic coordinate system (GCS_WGS_1984?). You need to find out what your feature class's coordinate system is so you can project from one into the other.
–
blah238Jun 3 '12 at 20:10