The process goes as such:
- I create my sedf from a df using a geometry field and declare the wkid in the spatial reference.
- Publish the sedf as a new feature layer with only name and the gis. It works as expected.
- I run the same script but instead of creating a new feature layer, I overwrite. It changes the projection.
from arcgis.geometry import SpatialReference
sr = SpatialReference(wkid=4326) # WGS 84
sedf = pd.DataFrame.spatial.from_df(df,geometry_column='geometry',sr=sr)
lyr = sedf.spatial.to_featurelayer('feat_layer_name', gis=gis) # works correctly
lyr = sedf.spatial.to_featurelayer(gis=gis,overwrite=True,service={'featureServiceId':'1234567890abcdefgh','layer':0}) # breaks projection
Seems like a bug. I'd rather not have to go back to the old method of updating feature layers as this should be the standard.