addfeature to Arcgis Online using REST API

1525
3
Jump to solution
07-19-2020 02:49 PM
GeoMapps
New Contributor III

hi

i am making a movile app and try only to add points to a feature service on arcgis online, get the xy from the celphones gps and sent it with other information through REST API and all the information was saved correct but the point always appear on 0,0 

facts :

1 .X an Y coordenates get from the GPS ( cellphone )  the values are digital degrees  14,045737 , -86.2618664

2. get token fine

3. sent to the REST and  the record was saved without error

4. the feature is on Arcgis Online and is point feature

5. when i check the map the point is 0,0

6. I also try removing the spatialreference parameter and only put geometry and also went to 0,0

don't know what happend, shoul'd i have to make a coordenate convertion?

thanks

1 Solution

Accepted Solutions
Egge-Jan_Pollé
MVP Regular Contributor

Hi Marco Amaya,

Did you discover your mistake already?

Your code is fine, including the use of the spatialreference parameter, except for the fact that you are using comma's (",") instead of dots (".") as decimal separators in your X and Y values.

As soon as you have replaced the decimal separators you are good to go! With the coordinates you have given I end up on the southwestern outskirts of Tegucigalpa, Honduras, right?

HTH,

Egge-Jan

[
    {
      "geometry": {
        "x": -87.2618664,
        "y": 14.045737,
        "spatialReference": {
          "wkid": 4326
        }
      },
      "attributes" : {
        "field1" : "test",
        "field2" : "SI",
        "field3" : "EC",
        "field4" : "test",
        "field5" : "test"
      }
	}
]

View solution in original post

3 Replies
Egge-Jan_Pollé
MVP Regular Contributor

Hi Marco Amaya,

Did you discover your mistake already?

Your code is fine, including the use of the spatialreference parameter, except for the fact that you are using comma's (",") instead of dots (".") as decimal separators in your X and Y values.

As soon as you have replaced the decimal separators you are good to go! With the coordinates you have given I end up on the southwestern outskirts of Tegucigalpa, Honduras, right?

HTH,

Egge-Jan

[
    {
      "geometry": {
        "x": -87.2618664,
        "y": 14.045737,
        "spatialReference": {
          "wkid": 4326
        }
      },
      "attributes" : {
        "field1" : "test",
        "field2" : "SI",
        "field3" : "EC",
        "field4" : "test",
        "field5" : "test"
      }
	}
]
GeoMapps
New Contributor III

Hi

you are absolutely right, thanks for the observation. I tried Postman to record it via REST and it worked correctly

Egge-Jan_Pollé
MVP Regular Contributor

Hi Marco Amaya,

If you think your issue is solved you may mark the answer as correct. In that way other GeoNet members can see that the call is closed.

TIA,

Egge-Jan