AnsweredAssumed Answered

Spatial Data Frame to Feature Layer - Spatial Reference

Question asked by rwmeier on May 30, 2019
Latest reply on Jun 7, 2019 by arcpygis

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.


addrSDF = fl.query(where=whr, out_fields=flds, out_sr=102698).sdf

newItem = addrSDF.spatial.to_featurelayer('NewAddresses',gis)
SR = SpatialReference(iterable={"wkid":102698})
newfl = FeatureLayerCollection.fromitem(newItem).layers[0]

newSDF = pd.DataFrame.spatial.from_layer(newfl)

retVal = newSDF.spatial.project(SR,None)


newFlPrj = newSDF.spatial.to_featurelayer('NewAddresses_Prj',gis)