POST
|
Going through the arcgis documentation page. arcgis.features module — arcgis 1.6.2 documentation (1) 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="https://services1.arcgis.com/okWBWNlpfMx5q1bT/arcgis/rest/services/QFESFireStations/FeatureServer/0") WebMap = gis.map('Queensland') WebMap.add_layer(point_layer) WebMap.legend = True WebMap (2) 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? EDIT: 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 = "https://services1.arcgis.com/okWBWNlpfMx5q1bT/arcgis/rest/services/QFESFireStations/FeatureServer/0" 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... arcgis.features.analysis. find_centroids
... View more
10-17-2019
05:37 PM
|
0
|
0
|
425
|
POST
|
How do you do this in jupyter (python)? 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. see the given layer below as an example. And how do i get the legend to appear, i found ".legend" but it doesn't work? from arcgis.features import FeatureLayer polygon_layer = FeatureLayer(url="https://gisservices.information.qld.gov.au/arcgis/rest/services/Farming/DroughtDeclarations/MapServer") WebMap = gis.map('Queensland') WebMap.add_layer(polygon_layer) WebMap.legend = True WebMap
... View more
10-17-2019
05:10 PM
|
0
|
0
|
1050
|
POST
|
Thank you so much! Also justed wanted to ask: (1) how do i add another 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. Like i have a bunch of layers here for example and 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? WebMap = gis.map('Queensland') WebMap.add_layer(analysis_layer) WebMap.add_layer(point_layer) WebMap.legend = True WebMap (2) 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? --------------------------NOTES FOR OTHERS----------------------------- Heres a couple more points I just learned to add. (1) # Change a mapserver layer to a featurelayer in case someone needs to know how from arcgis.features import FeatureLayer drought_polygons = FeatureLayer(url="https://gisservices.information.qld.gov.au/arcgis/rest/services/Farming/DroughtDeclarations/MapServer/0") Thank you so much AGAIN!
... View more
10-16-2019
09:09 PM
|
0
|
0
|
1203
|
POST
|
In arcgis online i have a webmap where i did a sumamrize within of a bunch of points into polygons to give those polygons density colours based on the number of points that are within them, now I want to do the same thing but solely in python. my points are the "QFESFireStations", and my polygons are the "Drought Affected Shires; QLD". My code is below. Also, I dont get why the summary_polygons layer is optional, because the tool NEEDS two layers, so how can only one layer be required for an input??? See the links below. For some reason when i run this below i get (AttributeError: 'Item' object has no attribute 'summarize_within') from arcgis.geoanalytics.summarize_data import summarize_within webmap.summarize_within(summarized_layer="QFESFireStations", output_name = "SEE_ME", polygon_or_bin = "POLYGONS", bin_type = "SQUARE", summary_polygons="Drought Affected Shires; QLD", sum_shape = True) https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geoanalytics.summarize_data.html#summarize-within ---------------------------------------------------------- Also, this is just a note I have three variable types webmap = item NewWebMap = MapView usable = WebMap --------------------------------------------------------- I tried the samething using arcpy but also didnt work. # https://pro.arcgis.com/en/pro-app/tool-reference/big-data-analytics/summarize-within.htm import arcpy drought = gis.content.get('4e73c854013a43beb258150d4be7e135') Fire_station = gis.content.get('84fead439e2444a299d75296c365aba7') outFS = 'SEE_ME1' dataStore = "SEE_ME_DataStore1" # Execute SummarizeWithin arcpy.geoanalytics.SummarizeWithin(Fire_station, outFS, "POLYGON", None, None, drought, "ADD_SUMMARY", dataStore) This gives the error (RuntimeError: Object: Error in executing tool)
... View more
10-15-2019
03:25 PM
|
0
|
3
|
1513
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|