Select to view content in your preferred language

Delete Feature Service Features with ArcGIS REST

1100
1
Jump to solution
09-20-2023 06:23 AM
kapalczynski
Frequent Contributor

I am adding Features via a Rest EP Feature Service like below... 

But before I do this I need to DELETE all the records... 

I can do this via ArcGIS REST but not sure how to write that into python??  DELETE WHERE 1=1

kapalczynski_0-1695216002875.png

 

    gis_payload = {
      'f': 'json',
      'features': f'''{featureAdding}'''
      }
    url = "https://xxxxx.gov/env/rest/services/Prediction/ReadFeature/FeatureServer/0/addFeatures"
    payload = featureAdding
    files=[]
    headers = {}
    response = requests.request("POST", url, headers=headers, data=gis_payload, files=files)

 

 

0 Kudos
1 Solution

Accepted Solutions
kapalczynski
Frequent Contributor

Think I got it with this

 

    url = "https://xxx/env/rest/services/Prediction/ReadFeature/FeatureServer/0/deleteFeatures"
    whereclause='1=1'
    gis_payload = {
      'f': 'json',
      'where': f'''{whereclause}'''
      }
    response = requests.request("POST", url=url, data=gis_payload)

 

View solution in original post

0 Kudos
1 Reply
kapalczynski
Frequent Contributor

Think I got it with this

 

    url = "https://xxx/env/rest/services/Prediction/ReadFeature/FeatureServer/0/deleteFeatures"
    whereclause='1=1'
    gis_payload = {
      'f': 'json',
      'where': f'''{whereclause}'''
      }
    response = requests.request("POST", url=url, data=gis_payload)

 

0 Kudos