Create DeleteFeatures_onebyone_Portal.ipynb#1653
Open
rmesend wants to merge 2 commits intoEsri:masterfrom
Open
Create DeleteFeatures_onebyone_Portal.ipynb#1653rmesend wants to merge 2 commits intoEsri:masterfrom
rmesend wants to merge 2 commits intoEsri:masterfrom
Conversation
one notebook to delete elements in AGOL one by one.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This Python code leverages the `arcgis` library to interact with ArcGIS Online. It begins by establishing a session on ArcGIS Online using your credentials (username and password). You'll need to replace `"tu_usuario"` and `"tu_contraseña"` with your actual ArcGIS Online username and password. Next, it identifies a specific Feature Service within ArcGIS Online by its ID, which you should replace with the actual ID of your desired Feature Service. The code then accesses the first layer within this Feature Service and performs a query to retrieve a list of elements from the layer. Subsequently, it goes through each retrieved element one by one, deleting them individually using the `edit_features` method with the 'deletes' operation. The 'OBJECTID' attribute is used to uniquely identify and remove each element. Finally, it prints a success message to indicate that the elements have been successfully deleted. It's important to ensure that you have the necessary permissions to perform editing operations on the Feature Service you are working with. This is an update of this FAQ: https://support.esri.com/en-us/knowledge-base/faq-is-it-possible-to-batch-delete-features-in-arcgis-o-000013805
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
one notebook to delete elements in AGOL one by one.
<insert pull request description here>
Checklist
Please go through each entry in the below checklist and mark an 'X' if that condition has been met. Every entry should be marked with an 'X' to be get the Pull Request approved.
imports are in the first cell?arcgisimports? Note that in some cases, for samples, it is a good idea to keep the imports next to where they are used, particularly for uncommonly used features that we want to highlight.GISobject instantiations are one of the following?gis = GIS()gis = GIS('home')orgis = GIS('pro')gis = GIS(profile="your_online_portal")gis = GIS(profile="your_enterprise_portal")./misc/setup.pyand/or./misc/teardown.py?api_data_owneruser?api_data_owneraccount and change the notebook to first download and unpack the files.<img src="base64str_here">instead of<img src="https://some.url">? All map widgets contain a static image preview? (Callmapview_inst.take_screenshot()to do so)os.path.join()? (Instead ofr"\foo\bar",os.path.join(os.path.sep, "foo", "bar"), etc.)