AnsweredAssumed Answered

ARCGIS Rest API with python addfeatures question

Question asked by larrywnolan@gmail.com on Jan 31, 2019
Latest reply on Jan 31, 2019 by larrywnolan@gmail.com

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

Outcomes