I am trying to create a new feature layer from an existing one using this code,
This works but when I look at the REST endpoint in AGOL the Spatial Reference is 102100.
Then I tried to project the newly created feature layer as a spatial data frame, then save it as a new projected feature layer, the project function returns true, still the Spatial Reference is 102100.
When the spatial data frame is created in the first line, it is still 102698, I beloeve the to_featurelayer function is creating the data as 102100.
Oddly, when I download the file geodatabase that is used to create the feature layer, and look at it is Arc Catalog the feature class is on 102698.
Far as I can tell, publishing from SEDF to feature layer ignores the SR set in the SEDF. I haven't yet found a way to explicitly set the SR when publishing. Seems that the only option is to re-project the feature layer after it's published. (I'm still trying to figure that out.)
I hope someone will post here with a happier alternative.