Select to view content in your preferred language

ArcGIS Pro - collapse small polygons to points as I zoom out

5885
3
Jump to solution
01-07-2021 09:15 PM
Labels (1)
davedoesgis
Frequent Contributor

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:

  • I have the acres in a field. 
  • I know how to set the scale ranges for the classes. This is almost useful, but it just turns them on or off, whereas I need them to change into something else. 
  • I know how to scale the symbol size based on map scale, but I want to change the symbol altogether, not just make the symbol bigger/smaller. 
  • I know how to apply a marker symbol to a polygon (wrench icon > Add Symbol Layer > marker symbol > Layers icon > Marker Placement > Placement > At Center). My data change often, so I don't want some data management nightmare creating a separate centroids layer. 
  • I guess I could do this with multiple layers pointing to the same feature class, but that seems kinda lame. 

thanks!

 

 

1 Solution

Accepted Solutions
davedoesgis
Frequent Contributor

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. 

Display Collapsed Polygons As Points

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:

01 small polys.png

The goal is to convert those into a marker symbol, so first we need to learn how to display polygons with a marker symbol.

Display Polygons as Markers

Open the symbology and click on the symbol (the red polygon in this screenshot) to open its properties:

02 open symbology.png

Click on the Wrench and then on “Add Symbol Layer”. Choose Marker Symbol type.

03 add symbol layer.png

Go back to the layers section and click on the shape marker symbol that was added.

  • Set its symbol, size, shape, color, etc. as you normally would
  • Scroll down to “Marker Placement” and choose “At Center” from the Placement option
  • Just below that, you may also wish to play with the Method option to determine where to place it.
  • Click Apply

04 set as marker symbol.png

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.

Scale-Based Marker Display

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. 

05 unique values.png

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:

  • Line 1: Anything over 50k acres always draws as a polygon. This was specific to my solution, but you can remove this first line if you wish.
  • Line 2: This where we figure out if the feature is large enough to draw as a polygon at this map scale (more on this later).
  • Line 3: If we’re still running, it’s below the threshold for a polygon, so draw as a point.

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.06 point-poly.png

 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:

07 final solution.png

 

View solution in original post

3 Replies
Robert_LeClair
Esri Notable Contributor

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.

davedoesgis
Frequent Contributor

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). 

0 Kudos
davedoesgis
Frequent Contributor

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. 

Display Collapsed Polygons As Points

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:

01 small polys.png

The goal is to convert those into a marker symbol, so first we need to learn how to display polygons with a marker symbol.

Display Polygons as Markers

Open the symbology and click on the symbol (the red polygon in this screenshot) to open its properties:

02 open symbology.png

Click on the Wrench and then on “Add Symbol Layer”. Choose Marker Symbol type.

03 add symbol layer.png

Go back to the layers section and click on the shape marker symbol that was added.

  • Set its symbol, size, shape, color, etc. as you normally would
  • Scroll down to “Marker Placement” and choose “At Center” from the Placement option
  • Just below that, you may also wish to play with the Method option to determine where to place it.
  • Click Apply

04 set as marker symbol.png

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.

Scale-Based Marker Display

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. 

05 unique values.png

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:

  • Line 1: Anything over 50k acres always draws as a polygon. This was specific to my solution, but you can remove this first line if you wish.
  • Line 2: This where we figure out if the feature is large enough to draw as a polygon at this map scale (more on this later).
  • Line 3: If we’re still running, it’s below the threshold for a polygon, so draw as a point.

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.06 point-poly.png

 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:

07 final solution.png