I am uploading some Points and Lines into ArcGIS Online hosted feature services using a python program the ArcGIS Rest Api. The points work fine but I am having trouble getting the correct format for adding the lines.
For the Points:
{
"features":
"geometry": {
"x": x,
"y": y
},
"attributes": {
"RECORD_ID": RECORD_ID,
"DEVICE_ID": DEVICE_ID,
"DATE_TIME": DATE_TIME,
"LONGITUDE": LONGITUDE,
"LATITUDE": LATITUDE,
}
}
Works.
For the lines If have tried:
{
"features":
"paths":[
[x,y],[x1,y1]],
"spatialReference": {"wkid" : 4326},
"attributes": {
"RECORD_ID": RECORD_ID,
"DEVICE_ID": DEVICE_ID,
"DEVICE_NAME": DEVICE_NAME,
"DATE_TIME": DATE_TIME,
"SPEED": SPEED,
"HEADING": HEADING,
}
}
FAILS.
The error I get is:
"No JSON object could be decoded"
Any idea what I am doing wrong?
Thanks
Larry
Solved! Go to Solution.
Thanks to both of you. I thought I had created a wgs84 lat/long projection but AGOL turned it into web mecator. It is inserting the coordinates correctly when I set the projection to 4236 on the input so I assumed AGOL was doing the conversion. I am getting lines now but AGOL still complains about there was no json object to decode. Thanks for all your help