Select to view content in your preferred language

Python (jupyter) hide layer based on zoom + aggregate points

10-17-2019 05:37 PM
New Contributor

Going through the arcgis documentation page.

arcgis.features module — arcgis 1.6.2 documentation 


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?

point_layer = FeatureLayer(url="")

WebMap ='Queensland')
WebMap.legend = True


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?


I found clustering (into groups of colour) based on distance, but cant aggregate to size...

arcgis.features.analysis module — arcgis 1.6.2 documentation 

For some reason when i do it im getting the error:

WARNING 001605: Distances for Geographic Coordinates (degrees, minutes, seconds) are analyzed using Chordal Distances in meters.

from arcgis.features.analysis import find_point_clusters
analysis_layer = ""

my_clusters = find_point_clusters(analysis_layer, min_features_cluster=10, search_distance=5, search_distance_unit='Kilometers',
output_name="Output_name", context=None, gis=None)

And then it makes sense to use find centroids if those groups could be split apart somehow...


0 Kudos
0 Replies