<?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 (jupyter) hide layer based on zoom + aggregate points in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-jupyter-hide-layer-based-on-zoom-aggregate/m-p/765102#M514</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Going through the arcgis documentation page.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.toc.html#featurelayer" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.toc.html#featurelayer"&gt;arcgis.features module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;(1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;how do i add a layer and change when it turns on, based on zoom? Like if i zoom out I want a layer to deactivate(hide), and when i zoom in i want to be able to see it again. I dont want the map to be cluttered. And how do i get the legend to appear, i found ".legend" but it doesn't work?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;point_layer&amp;nbsp;&lt;/SPAN&gt;= FeatureLayer(url="https://services1.arcgis.com/okWBWNlpfMx5q1bT/arcgis/rest/services/QFESFireStations/FeatureServer/0")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;WebMap = gis.map('Queensland')&lt;BR /&gt;WebMap.add_layer(point_layer)&lt;BR /&gt;WebMap.legend = True&lt;BR /&gt;WebMap&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;(2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Is there a way to aggregate points? for example if i have a point layer with lots of points can i merge those points together based on some distance? for that layer?&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;STRONG&gt;I found&amp;nbsp;clustering (into groups of colour) based on distance, but cant aggregate to size...&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html#find-point-clusters" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html#find-point-clusters"&gt;arcgis.features.analysis module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;For some reason when i do it im getting the error:&lt;/P&gt;&lt;PRE style="color: #000000; background-color: transparent; border: 0px; font-size: 14px; padding: 1px 0px;"&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;EM&gt;WARNING 001605: Distances for Geographic Coordinates (degrees, minutes, seconds) are analyzed using Chordal Distances in meters.&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;&lt;/PRE&gt;&lt;P&gt;from arcgis.features.analysis import find_point_clusters&lt;BR /&gt;analysis_layer = "https://services1.arcgis.com/okWBWNlpfMx5q1bT/arcgis/rest/services/QFESFireStations/FeatureServer/0"&lt;/P&gt;&lt;P&gt;my_clusters = find_point_clusters(analysis_layer, min_features_cluster=10, search_distance=5, search_distance_unit='Kilometers', &lt;BR /&gt; output_name="Output_name", context=None, gis=None)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then it makes sense to use find centroids if those groups could be split apart somehow...&lt;/P&gt;&lt;P&gt;&lt;CODE class="" style="color: #000000; background: transparent; border: none; font-weight: bold;"&gt;arcgis.features.analysis.&lt;/CODE&gt;&lt;CODE class="" style="color: #000000; background: transparent; border: none; font-weight: bold;"&gt;find_centroids&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Oct 2019 00:37:13 GMT</pubDate>
    <dc:creator>GarasLewis</dc:creator>
    <dc:date>2019-10-18T00:37:13Z</dc:date>
    <item>
      <title>Python (jupyter) hide layer based on zoom + aggregate points</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-jupyter-hide-layer-based-on-zoom-aggregate/m-p/765102#M514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Going through the arcgis documentation page.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.toc.html#featurelayer" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.toc.html#featurelayer"&gt;arcgis.features module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;(1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;how do i add a layer and change when it turns on, based on zoom? Like if i zoom out I want a layer to deactivate(hide), and when i zoom in i want to be able to see it again. I dont want the map to be cluttered. And how do i get the legend to appear, i found ".legend" but it doesn't work?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;point_layer&amp;nbsp;&lt;/SPAN&gt;= FeatureLayer(url="https://services1.arcgis.com/okWBWNlpfMx5q1bT/arcgis/rest/services/QFESFireStations/FeatureServer/0")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;WebMap = gis.map('Queensland')&lt;BR /&gt;WebMap.add_layer(point_layer)&lt;BR /&gt;WebMap.legend = True&lt;BR /&gt;WebMap&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;(2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Is there a way to aggregate points? for example if i have a point layer with lots of points can i merge those points together based on some distance? for that layer?&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;STRONG&gt;I found&amp;nbsp;clustering (into groups of colour) based on distance, but cant aggregate to size...&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html#find-point-clusters" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html#find-point-clusters"&gt;arcgis.features.analysis module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;For some reason when i do it im getting the error:&lt;/P&gt;&lt;PRE style="color: #000000; background-color: transparent; border: 0px; font-size: 14px; padding: 1px 0px;"&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;EM&gt;WARNING 001605: Distances for Geographic Coordinates (degrees, minutes, seconds) are analyzed using Chordal Distances in meters.&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;&lt;/PRE&gt;&lt;P&gt;from arcgis.features.analysis import find_point_clusters&lt;BR /&gt;analysis_layer = "https://services1.arcgis.com/okWBWNlpfMx5q1bT/arcgis/rest/services/QFESFireStations/FeatureServer/0"&lt;/P&gt;&lt;P&gt;my_clusters = find_point_clusters(analysis_layer, min_features_cluster=10, search_distance=5, search_distance_unit='Kilometers', &lt;BR /&gt; output_name="Output_name", context=None, gis=None)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then it makes sense to use find centroids if those groups could be split apart somehow...&lt;/P&gt;&lt;P&gt;&lt;CODE class="" style="color: #000000; background: transparent; border: none; font-weight: bold;"&gt;arcgis.features.analysis.&lt;/CODE&gt;&lt;CODE class="" style="color: #000000; background: transparent; border: none; font-weight: bold;"&gt;find_centroids&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 00:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-jupyter-hide-layer-based-on-zoom-aggregate/m-p/765102#M514</guid>
      <dc:creator>GarasLewis</dc:creator>
      <dc:date>2019-10-18T00:37:13Z</dc:date>
    </item>
  </channel>
</rss>

