Short version: How can I make an ArcGIS Pro polygon layer draw super-tiny features as points, leaving larger features as polygons as the user zooms in and out?
I have a map of fire perimeters. They range from over 200k acres down to 1 acre. When zoomed in far enough, I'd like to display all the fires. As a user zooms out, I'd like to start collapsing polygon symbology into points for the smaller fires. I can create some categories of acreage and map scale thresholds (e.g.: 25k acres >> 1:1,000,000; 50k acres >> 1:5,000,000; over 50k acres always draw as polygons). Or maybe it's easier to calculate the ratio of acres/map_scale and have a minimum threshold that divides polygon rendering from point rendering.
I already have a solution that I really hate. It's so bad that I figure I'm missing something obvious. Heck, I could do this back in ArcIMS with a scale-dependent renderer (except maybe turning polys into points). Here is what I already know:
thanks!
Solved! Go to Solution.
I worked out a decent solution. Here is a summary of how to do it. There are plenty of rabbit trails you could go down, but this is just a simple example. I do wish ArcGIS had a way to streamline this. The solution would probably be best calculated using pixel units on screen, rather than feature area.
At certain scales, some polygons may collapse down to where they cannot be seen. In this case, we have a map of wildfire perimeters with several polygons that are barely visible at this scale. There are about 9 polygons in this screenshot that you can barely see:
The goal is to convert those into a marker symbol, so first we need to learn how to display polygons with a marker symbol.
Open the symbology and click on the symbol (the red polygon in this screenshot) to open its properties:
Click on the Wrench and then on “Add Symbol Layer”. Choose Marker Symbol type.
Go back to the layers section and click on the shape marker symbol that was added.
This just adds a point to each polygon. You can turn off or delete the fill and outline layers in the symbol to just get a marker point.
For a really basic scale setting, you could create two map layers pointing to the same feature class – one as a point and one as a polygon. Then, just set non-overlapping scale thresholds on the layers. For a limited scale range, especially if your features are of somewhat uniform size. This solution is also AGOL-friendly, if publishing to the web is a factor.
The drawback is that if we keep zooming out, all but the very largest wildfires would eventually benefit from point rendering, so we don’t want to just have a simple scale threshold. Since this dataset ranges from <1 acres to >200,000 acres, the massive size range creates a unique challenge that requires a better solution.
To convert polygons into points when they’ve collapsed down on themselves isn’t too hard. First, open the symbology for your polygon layer and choose Unique Values classification. I have a field GISAcres for the acreage in this case, so choose that for Field 1.
Next, click on the green/white “X” expression icon next to the field. For the expression, I set it to this:
if ($feature.GISAcres >= 50000) {return 'poly'}
if ((Sqrt($feature.GISAcres) / $view.scale) > 0.00003) {return 'poly'}
return "point"
In this example:
Because acreage is an aerial measure (2-D), but scale is linear (1-D), I took the square root of the acreage (Sqrt function). You could square the map scale, instead, if you wish. Then, I divide the acreage’s square root by the map scale.
The threshold I set here of 0.00003 is arbitrary. I found this out simply by experimenting with it until it looked good. If your polygons are measured in hectares, square km, etc., then you could do a unit conversion, or just play with it until you find your own setting.
Lastly, if the features’ size is not already in a field, it is possible to get the features’ area from the Arcade expression. You can also use the Calculate Field geoprocessing tool to create a new field with the area.
That’s the hardest part. Now, we have a map that looks like this. The expression can only return point or poly, so you can turn off the other values.
Using the instructions above, you can set the “point” category’s symbol to use a marker symbol instead of a polygon renderer. If you start in the Contents pane, you could just click on the pink point swatch in the screenshot above. Or from the layer’s symbology, you can click on that category to format the symbol.
Here is what I created, and if I zoom in enough, I can see the outline for any of the points on this map:
Hmmm...I know of a few workflows - ArcGIS Pro and ArcGIS Insights - that might work.
In ArcGIS Insights, there's a symbology technique called binned maps that transitions from dynamic rectangles to points based upon # of features set for the transition value. You can learn about it here.
In ArcGIS Pro, there's a workflow called feature binning that only works with an Enterprise Geodatabase point feature class. It takes a large number of points and creates dynamic polygons that change size and have a count value as the label. You could use this for the small scale extent and then use scale dependent displays that turns off the feature binning at a certain scale and then turns on the polygons once you've zoomed in. There's a good blog article here that goes into more detail.
Thanks, Robert. I'm not using Insights. We have an Enterprise Geodatabase available, and that binning looks cool, but it doesn't quite get at this particular issue (though it does possibly work for another workflow I have).
I worked out a decent solution. Here is a summary of how to do it. There are plenty of rabbit trails you could go down, but this is just a simple example. I do wish ArcGIS had a way to streamline this. The solution would probably be best calculated using pixel units on screen, rather than feature area.
At certain scales, some polygons may collapse down to where they cannot be seen. In this case, we have a map of wildfire perimeters with several polygons that are barely visible at this scale. There are about 9 polygons in this screenshot that you can barely see:
The goal is to convert those into a marker symbol, so first we need to learn how to display polygons with a marker symbol.
Open the symbology and click on the symbol (the red polygon in this screenshot) to open its properties:
Click on the Wrench and then on “Add Symbol Layer”. Choose Marker Symbol type.
Go back to the layers section and click on the shape marker symbol that was added.
This just adds a point to each polygon. You can turn off or delete the fill and outline layers in the symbol to just get a marker point.
For a really basic scale setting, you could create two map layers pointing to the same feature class – one as a point and one as a polygon. Then, just set non-overlapping scale thresholds on the layers. For a limited scale range, especially if your features are of somewhat uniform size. This solution is also AGOL-friendly, if publishing to the web is a factor.
The drawback is that if we keep zooming out, all but the very largest wildfires would eventually benefit from point rendering, so we don’t want to just have a simple scale threshold. Since this dataset ranges from <1 acres to >200,000 acres, the massive size range creates a unique challenge that requires a better solution.
To convert polygons into points when they’ve collapsed down on themselves isn’t too hard. First, open the symbology for your polygon layer and choose Unique Values classification. I have a field GISAcres for the acreage in this case, so choose that for Field 1.
Next, click on the green/white “X” expression icon next to the field. For the expression, I set it to this:
if ($feature.GISAcres >= 50000) {return 'poly'}
if ((Sqrt($feature.GISAcres) / $view.scale) > 0.00003) {return 'poly'}
return "point"
In this example:
Because acreage is an aerial measure (2-D), but scale is linear (1-D), I took the square root of the acreage (Sqrt function). You could square the map scale, instead, if you wish. Then, I divide the acreage’s square root by the map scale.
The threshold I set here of 0.00003 is arbitrary. I found this out simply by experimenting with it until it looked good. If your polygons are measured in hectares, square km, etc., then you could do a unit conversion, or just play with it until you find your own setting.
Lastly, if the features’ size is not already in a field, it is possible to get the features’ area from the Arcade expression. You can also use the Calculate Field geoprocessing tool to create a new field with the area.
That’s the hardest part. Now, we have a map that looks like this. The expression can only return point or poly, so you can turn off the other values.
Using the instructions above, you can set the “point” category’s symbol to use a marker symbol instead of a polygon renderer. If you start in the Contents pane, you could just click on the pink point swatch in the screenshot above. Or from the layer’s symbology, you can click on that category to format the symbol.
Here is what I created, and if I zoom in enough, I can see the outline for any of the points on this map: