Did you know you can aggregate your data into bins Map Viewer? If you’ve read Kristian’s blog you will know that binning aggregates data to predefined cells, effectively representing point data as a gridded polygon layer. Binning in Map Viewer can show the aggregated data with a defined bin boundary which is different from the other clustering styles available. Binning your point features can help you identify patterns in your data that may be missed when viewing individual features.
A couple of important points as we dive into binning
- You do not need to run the analysis tool to create these bins
- You do not need to have a service that supports server-side binning.
What does this mean?
To create these bins you do not need to think about the credit usage when using the binning functionality in Map Viewer. These bins are static and are not dynamic which means they do not change as you zoom in or out in the map. Next, you do not need to worry about your service configuration to see if you published it in a certain way to support binning. Map Viewer binning takes place client-side and is supported across Feature Layers, CSV by URL, GeoJSON by URL, WFS, and OGC Feature layer.
How does it work?
When you enable binning through the Aggregation panel in Map Viewer the point features will be aggregated into predefined cells at a suggested size for the current map scale. As mentioned above the bin shape are static but can be changed easily in the binning panel. By default, the bins are styled with a counts and amounts color style showing a continuous color representing the number of features within each bin. Bins can easily be styled using statistic fields you create within the binning panel and begin styling them just like polygons from a feature layer.
How to enable Binning in Map Viewer
Here is an example map showing motor vehicle accidents in New York in 2020. The layer hasn’t been styled and is just showing basic point features. In the aggregation panel, you will see two different aggregation methods: clustering & binning (chart clustering will be displayed when using types or counts and amounts color styles). To generate the bins simply click on the Binning card and the map will be updated to show your point features in geohash bins.
How to configure your bins
When binning is enabled you will have a set of properties available that you can configure to adjust how the bins appear in your map. This means you can change the bin size, fields, labels, or style at any time during the authoring process for your map.
Bin size – The size of the bin representing the aggregated data. This is set to a default size to best suit the scale the map view is at during the time it was enabled. Moving the slider to small or large will change the number of features that are aggregated within a bin. When the bins are small you will probably see more bins within your map while moving the slider to the large end will create larger bins covering a larger area.
Bin fields – When opening the fields section for binning there will be an autogenerated sum field for the number of features within a bin. This field can be used for labeling and popups. By default, it is used for styling the bins. You can also add your bin fields by clicking on the Add Field button in the panel and selecting the field from the dataset you would like to calculate a statistic on. This will create a “virtual field” that can be used in the bins for the selected statistic and will not be added to your dataset. A field in the layer can be used multiple times to view multiple different statistics like in the instance of this dataset we may want to know the mean and median value of a field for crash counts in a bin along with the sum of crashes within a bin. Numeric fields can be used to calculate sum, mean, median & predominant values. String fields will be used to find the predominant value of the aggregated features.
Bin label – Labels can be enabled on bins to show the values from the bin fields. Arcade expressions can also be used along with the fields and you have the same label filtering and styling support that you see in those respective panels.
Bin Pop-ups – Just like popups used on the features you can create and further customize popups. The different popup elements are available and you can use them with the fields that we added within the binning fields panel.
Bin style – Editing your bin style can help create a visual styling of your bins that can help determine the patterns within your aggregated data using the fields you generated for the bins. You can use the default aggregation count field and change the style use or leverage any of the fields you create to generate a new style like showing a predominant value within your bin. In the gif below I use the statistic fields to style my pins to show the average and the predominant value of the bins. Just like with other layer styling you can leverage effects as well to make adjustments to your bin appearance.
Here are some additional notes to think about while you look at your different aggregation methods. Just like clustering in Map Viewer binning is supported across different projections. Currently, bins are static and will not recalculate at different bin levels like clusters will. Server-side binning is still being evaluated for larger datasets.