<?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 Python method to change spatial reference of query layer? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-method-to-change-spatial-reference-of-query/m-p/1290195#M67670</link>
    <description>&lt;P&gt;I am using ArcGIS Pro 3.04. I have a bunch of maps in several APRX files which contain query layers, each based on a different SQL database view. Those maps are published to an ArcGIS Portal site. The data behind the database views is changing: the spatial reference is currently a state plane system but is being converted to web mercator. The query used for these layers is just one line, selecting everything that's in the database view.&lt;/P&gt;&lt;P&gt;I already have a process to update all the SQL views, but I need to update the query layers to the new spatial reference. In the GUI, I can do this in the layer properties, Source tab: When I re-validate the query (the query doesn't need to change), Pro re-examines the view and selects the correct SRID.&lt;/P&gt;&lt;P&gt;Is there any way to automate the process of changing a query layer's SRID? I've done some searching and it doesn't look like it's possible. I know I can change the connection properties using arcpy, but as far as I've seen it's not possible to update the details of a query layer (either changing the query text, or changing the SRID).&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 17:17:38 GMT</pubDate>
    <dc:creator>DanCall1</dc:creator>
    <dc:date>2023-05-17T17:17:38Z</dc:date>
    <item>
      <title>Python method to change spatial reference of query layer?</title>
      <link>https://community.esri.com/t5/python-questions/python-method-to-change-spatial-reference-of-query/m-p/1290195#M67670</link>
      <description>&lt;P&gt;I am using ArcGIS Pro 3.04. I have a bunch of maps in several APRX files which contain query layers, each based on a different SQL database view. Those maps are published to an ArcGIS Portal site. The data behind the database views is changing: the spatial reference is currently a state plane system but is being converted to web mercator. The query used for these layers is just one line, selecting everything that's in the database view.&lt;/P&gt;&lt;P&gt;I already have a process to update all the SQL views, but I need to update the query layers to the new spatial reference. In the GUI, I can do this in the layer properties, Source tab: When I re-validate the query (the query doesn't need to change), Pro re-examines the view and selects the correct SRID.&lt;/P&gt;&lt;P&gt;Is there any way to automate the process of changing a query layer's SRID? I've done some searching and it doesn't look like it's possible. I know I can change the connection properties using arcpy, but as far as I've seen it's not possible to update the details of a query layer (either changing the query text, or changing the SRID).&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 17:17:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-method-to-change-spatial-reference-of-query/m-p/1290195#M67670</guid>
      <dc:creator>DanCall1</dc:creator>
      <dc:date>2023-05-17T17:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python method to change spatial reference of query layer?</title>
      <link>https://community.esri.com/t5/python-questions/python-method-to-change-spatial-reference-of-query/m-p/1330357#M68694</link>
      <description>&lt;P&gt;I'm curious on one point.&amp;nbsp; How do you know that it's being converted?&amp;nbsp; Online maps and ArcGIS Pro will try to project-on-the-fly, and they usually try to match a map's basemap layer's coordinate system.&amp;nbsp; That's where I'm curious.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 19:32:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-method-to-change-spatial-reference-of-query/m-p/1330357#M68694</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2023-09-19T19:32:44Z</dc:date>
    </item>
  </channel>
</rss>

