Provide ability of to_featurelayer to overwrite and name layer.

06-24-2021 11:26 AM
Status: Open
Occasional Contributor III


When publishing with GeoAccessor's to_featurelayer function, the resulting service is given a unique name. Ideally a user could specify a name. To facilitate this, it would great if this function could overwrite an existing feature layer, as well. 

Example with psudocode:

from arcgis.gis import GIS
from arcgis.features import FeatureLayer
from arcgis.features import GeoAccessor

gis = GIS(gis=<>, username=<>, password=<>) 
serviceUrl = "<OrgID>/arcgis/rest/services/<name>/FeatureServer/0"

mylayer = FeatureLayer((serviceUrl))
df = GeoAccessor.from_layer(mylayer)