<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Spatial Data Frame to Feature Layer - Spatial Reference in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-data-frame-to-feature-layer-spatial/m-p/802740#M2108</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a new feature layer from an existing one using this code,&lt;/P&gt;&lt;P&gt;This works but when I look at the REST endpoint in AGOL the Spatial Reference is 102100.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; addrSDF &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; fl.query(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;whr, &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;out_fields&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;flds, &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;out_sr&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;102698&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;).sdf&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; newItem &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; addrSDF.spatial.to_featurelayer(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'NewAddresses'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,gis)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN&gt;SR &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; SpatialReference(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;iterable&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"wkid"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;102698&lt;/SPAN&gt;&lt;SPAN&gt;})&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN&gt; newfl &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; FeatureLayerCollection.fromitem(newItem).layers[&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt; newSDF &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; pd.DataFrame.spatial.from_layer(newfl)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt; retVal &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; newSDF.spatial.project(SR,&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;None&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(retVal)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt; newFlPrj &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; newSDF.spatial.to_featurelayer(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'NewAddresses_Prj'&lt;/SPAN&gt;&lt;SPAN&gt;,gis)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 May 2019 15:58:12 GMT</pubDate>
    <dc:creator>RobertMEIER</dc:creator>
    <dc:date>2019-05-30T15:58:12Z</dc:date>
    <item>
      <title>Spatial Data Frame to Feature Layer - Spatial Reference</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-data-frame-to-feature-layer-spatial/m-p/802740#M2108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a new feature layer from an existing one using this code,&lt;/P&gt;&lt;P&gt;This works but when I look at the REST endpoint in AGOL the Spatial Reference is 102100.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; addrSDF &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; fl.query(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;whr, &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;out_fields&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;flds, &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;out_sr&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;102698&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;).sdf&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; newItem &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; addrSDF.spatial.to_featurelayer(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'NewAddresses'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,gis)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN&gt;SR &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; SpatialReference(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;iterable&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"wkid"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;102698&lt;/SPAN&gt;&lt;SPAN&gt;})&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN&gt; newfl &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; FeatureLayerCollection.fromitem(newItem).layers[&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt; newSDF &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; pd.DataFrame.spatial.from_layer(newfl)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt; retVal &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; newSDF.spatial.project(SR,&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;None&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(retVal)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt; newFlPrj &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; newSDF.spatial.to_featurelayer(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'NewAddresses_Prj'&lt;/SPAN&gt;&lt;SPAN&gt;,gis)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 15:58:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-data-frame-to-feature-layer-spatial/m-p/802740#M2108</guid>
      <dc:creator>RobertMEIER</dc:creator>
      <dc:date>2019-05-30T15:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Data Frame to Feature Layer - Spatial Reference</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-data-frame-to-feature-layer-spatial/m-p/802741#M2109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Far as I can tell, publishing from SEDF to feature layer ignores the SR set in the SEDF.&amp;nbsp; I haven't yet found a way to explicitly set the SR when publishing.&amp;nbsp; Seems that the only option is to re-project the feature layer after it's published.&amp;nbsp; (I'm still trying to figure that out.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope someone will post here with a happier alternative.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2019 15:16:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-data-frame-to-feature-layer-spatial/m-p/802741#M2109</guid>
      <dc:creator>Don_Barker</dc:creator>
      <dc:date>2019-06-07T15:16:19Z</dc:date>
    </item>
  </channel>
</rss>

