<?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 Modifiying a view using arcgis python api in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832457#M3223</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I'm attempting create multiple views off of a single feature layer -&lt;/P&gt;&lt;P&gt;I can copy a view I've created but I cant modify the visible area (trying to make views for different parts of the country)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This appears to be the geometry filter on the view :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AFeatureLayer.manager.properties.adminLayerInfo.viewLayerDefinition.table.filter.value.geometry&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attempted to take a copy of the manager properties - modify the geometry value and then run&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AFeatureLayer.manager.update_definition(copy_of_properties)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this returns an error message :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RuntimeError: Unable to update feature service layer definition.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Invalid definition for 'LastEditDate'.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Invalid definition for ESRI.ArcGIS.SDS.Metadata.EditingInfo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I attempted to only update using only&amp;nbsp;&lt;STRONG&gt;AFeatureLayer.manager.properties.adminLayerInfo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;with the geometry changed . This returns&amp;nbsp;&lt;STRONG&gt;{'success': True}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesnt seem to actually update the layer and the view doesnt change filter when reloaded -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be very useful as I cant find any documentation&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Feb 2020 15:57:22 GMT</pubDate>
    <dc:creator>OisinSlevin</dc:creator>
    <dc:date>2020-02-13T15:57:22Z</dc:date>
    <item>
      <title>Modifiying a view using arcgis python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832457#M3223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I'm attempting create multiple views off of a single feature layer -&lt;/P&gt;&lt;P&gt;I can copy a view I've created but I cant modify the visible area (trying to make views for different parts of the country)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This appears to be the geometry filter on the view :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AFeatureLayer.manager.properties.adminLayerInfo.viewLayerDefinition.table.filter.value.geometry&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attempted to take a copy of the manager properties - modify the geometry value and then run&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AFeatureLayer.manager.update_definition(copy_of_properties)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this returns an error message :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RuntimeError: Unable to update feature service layer definition.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Invalid definition for 'LastEditDate'.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Invalid definition for ESRI.ArcGIS.SDS.Metadata.EditingInfo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I attempted to only update using only&amp;nbsp;&lt;STRONG&gt;AFeatureLayer.manager.properties.adminLayerInfo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;with the geometry changed . This returns&amp;nbsp;&lt;STRONG&gt;{'success': True}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesnt seem to actually update the layer and the view doesnt change filter when reloaded -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be very useful as I cant find any documentation&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 15:57:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832457#M3223</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2020-02-13T15:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Modifiying a view using arcgis python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832458#M3224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;figured it out&amp;nbsp;&lt;/P&gt;&lt;P&gt;view_def = {"viewLayerDefinition":{"filter": &lt;BR /&gt;{"operator":"esriSpatialRelIntersects","value":&lt;BR /&gt;{"geometryType":"esriGeometryPolygon","geometry":&lt;BR /&gt;{'rings': [[[some coords]]]}&lt;BR /&gt; "spatialReference":{"wkid":29900,"latestWkid":29902}}}}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;AFeatureLayer.manager.update_definition(&lt;SPAN style="font-weight: 400;"&gt;view_def&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;now I'm struggling with copying a view itself as I noticed my filter applied to the copy and the original View any suggestions would be a great help&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 18:07:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832458#M3224</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2020-02-13T18:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Modifiying a view using arcgis python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832459#M3225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/350049"&gt;Oisin Slevin&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did have a similar question last year, and this forum provided me with the answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have already found out how to apply the the updateDefinition operation on the view layer to set an area of interest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And now the trick is not to copy a view, but to create multiple views for the same FeatureLayerCollection, and then set the area of interest for each of these views.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my original question, and the response by &lt;A href="https://community.esri.com/migrated-users/271172"&gt;Earl Medina&lt;/A&gt;‌ here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/230204"&gt;ArcGIS API for Python:  set an Area of Interest on a  Hosted Feature Layer View?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this blog I present a script looping through a FeatureLayer with geometries (12 provinces in the Netherlands), to create a view with all the police stations in each of these provinces:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/EPolle_TensingInternational/blog/2019/03/27/create-view-from-hosted-feature-layer-and-define-area-of-interest"&gt;https://community.esri.com/people/EPolle_TensingInternational/blog/2019/03/27/create-view-from-hosted-feature-layer-and-define-area-of-interest&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let us know whether or not this solves your issue &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 16:06:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832459#M3225</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2020-02-14T16:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Modifiying a view using arcgis python api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832460#M3226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Egge-Jan&lt;/P&gt;&lt;P&gt;The reason I want to be able to copy is a User is creating the view with specific rules, /stylings / permissions as a template.&lt;/P&gt;&lt;P&gt;I just want to be able to replicate it for the User for multiple locations quickly.&lt;/P&gt;&lt;P&gt;Otherwise I need to figure out how to replicate his view - ie give users permissions and custom styling etc using code and updating the definitions, where as a Copy would make this much simpler - as the user may want to change the view template in the future&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to create a view of the same data and then copy view parameters from a template view ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 17:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/modifiying-a-view-using-arcgis-python-api/m-p/832460#M3226</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2020-02-14T17:06:48Z</dc:date>
    </item>
  </channel>
</rss>

