GIS Tools

Language

Made withfor the GIS community

Density Grid

Create hex or square bin density maps from points

Geoprocessing

Drop files here or click to browse

Supported formats: GeoJSON

GeoJSON
Examples::

About Density Grids

  • Aggregates point data into grid cells for visualization
  • Hexagons have uniform distance to all neighbors
  • Great for visualizing concentrations and hot spots
  • Smaller cells = more detail, larger cells = smoother patterns

What Is a Density Grid?

A density grid bins point (or line, or polygon) data into a regular grid of cells and counts how many features fall into each cell. The result is a polygon grid layer where each cell carries a count or a density value (counts per unit area). Density grids convert unstructured point clouds into a structured thematic map that can be styled with color ramps to reveal hotspots, coldspots, and spatial patterns that are hard to see in the raw points.

The Density Grid tool on gis.tools builds hexagonal or square density grids from any point layer in your browser. Drop in GeoJSON, Shapefile, KML, or CSV with lat/lon coordinates, pick cell size and bin shape, and download a polygon grid with count attributes. Everything runs client-side, and you can feed the result directly into the Graduated Styling tool for instant hotspot visualization.

Density grids are sometimes called binned point maps, hex bin maps, or fishnet density maps. They are a fast, non-parametric alternative to kernel density estimation and an easier-to-interpret alternative to raw point overlays on zoomed-out maps.

How Density Grid Binning Works

The algorithm is conceptually simple:

  1. Compute the bounding box of the input point set (or use a user-supplied extent)
  2. Generate a regular grid of cells (hex or square) covering the extent
  3. For each point, find the grid cell that contains it
  4. Increment that cell's count
  5. Optionally compute count per unit area (density)

The performance is O(n) with a spatial index, and cells with zero points can optionally be included or omitted from the output.

Hex vs Square Grids

Hexagons have three major advantages over squares for density mapping. First, every hex cell has six equidistant neighbors, whereas square cells have four orthogonal neighbors at distance d and four diagonal neighbors at distance d√2. This uniform neighbor distance makes hex grids better for modeling connectivity and flow. Second, hexagons more closely approximate circles, reducing shape bias in density calculations. Third, the human eye tends to perceive hex patterns as more organic and less grid-aligned, producing visually pleasing density maps.

Cell Size and Binning

Cell size is the dominant parameter. Too coarse, and you lose spatial detail. Too fine, and you get single-point cells with no density signal. A sensible starting point is to target 30-100 points per cell on average.

Key Parameters and Options

Cell Shape

Hexagon or square.

Cell Size

The width (square) or circumradius (hex) of each cell, in meters or CRS units.

Extent

By default the grid covers the input point extent. You can also supply a custom bounding polygon.

Include Empty Cells

Toggle whether zero-count cells appear in the output.

Density Mode

Switch between count-per-cell and count-per-square-kilometer (or other area unit).

Practical Applications

Crime Hotspot Mapping

Bin incident reports into hex cells to produce a smoothed crime density map that's more interpretable than raw point clouds for patrol planning and resource allocation.

Wildlife Occurrence Mapping

Bin species observation records (e.g., from citizen science databases like eBird or iNaturalist) into cells to reveal occupied ranges and avoid misleading "hotspot" effects from uneven observer effort.

Urban Amenity Density

Count restaurants, cafes, or shops per cell to produce a commercial intensity map for retail siting or planning analysis.

Transportation Demand

Bin taxi pickup and drop-off points into hex cells to identify demand corridors for bike share or ride-hail redistribution.

Environmental Monitoring

Count air quality sensor exceedances per cell to produce a pollution exposure map.

Social Media Geo-analytics

Bin geotagged tweets or Instagram posts into cells to find event clusters or trending locations.

Archaeology

Bin artifact findspots to visualize concentration patterns for site interpretation.

Public Health

Bin case locations into cells to produce disease incidence maps while preserving privacy (counts instead of individual points).

Step-by-Step Workflow in gis.tools

  1. Open the Density Grid tool
  2. Drag in a point layer
  3. Choose hex or square cell shape
  4. Set the cell size in meters (or CRS units)
  5. Optionally pick a custom extent polygon
  6. Toggle empty cells on/off and density mode on/off
  7. Click "Generate Grid"
  8. Review the resulting polygon layer on the map
  9. Style with Graduated Styling by count
  10. Export as GeoJSON, KML, or Shapefile

Worked Example

A city safety analyst has 18,500 pedestrian-vehicle collision points from the past five years. She drops the points into the Density Grid tool, picks 200-meter hex cells, and enables density mode. The output has 2,340 cells (empty cells hidden), each carrying a collisions-per-kmΒ² value. She styles with a yellow-to-red Jenks color ramp and immediately spots three hot corridors along arterial streets that account for 40% of collisions. The map goes into the safety task force report.

Common Pitfalls and Gotchas

  • Modifiable Areal Unit Problem (MAUP): results depend on cell size and grid origin. Different choices can produce meaningfully different "hotspots".
  • CRS choice: hex and square cells are computed in the CRS's units, so WGS84 degrees produce distorted cells. Reproject first.
  • Edge cells at the extent boundary can have artificially low counts because they cover partial data. Clip to a meaningful boundary first.
  • Uneven sampling effort: apparent hotspots may reflect sampling bias, not true density. Normalize by effort where possible.
  • Memory pressure: very fine grids over large extents produce millions of cells. Start coarser.
  • Zero-count cells should usually be filtered for cleaner maps unless you need the full grid for downstream raster-like analysis.
  • Point vs centroid vs vertex inputs: the tool bins point coordinates, so polygon or line inputs must be reduced to centroids or vertices first.

Tips for Best Results

  • Reproject to a metric CRS before generating the grid
  • Start with a cell size aimed at 30-100 points per cell on average
  • Use hex grids for visually smoother outputs
  • Filter empty cells to avoid cluttering the map
  • Normalize by area (density mode) for comparisons across different cell sizes
  • Pair with Graduated Styling using Jenks or quantile classification

Comparison with Other GIS Approaches

QGIS provides Count Points in Polygon with a pre-generated grid layer. ArcGIS Pro has Summarize Within and Generate Tessellation. PostGIS uses ST_Hexagon or ST_Square grids with a JOIN count. Kepler.gl and Deck.gl can render GPU-based hex bins interactively. The browser-based gis.tools Density Grid is the quickest path to a static output grid for export.

Performance Considerations

Binning is O(n) with a spatial index. A million points into a few thousand cells takes a second or two. Output size scales with cell count, not input size.

Data Privacy and Browser-Based Processing

Density grids are often used to anonymize point data before publication (showing aggregate counts rather than individual locations). The gis.tools Density Grid runs in your browser, so even the intermediate step of holding raw points stays on your machine.

Related GIS Concepts

Kernel Density Estimation (KDE) produces smooth continuous density surfaces and is a more sophisticated alternative to grid binning. Hex binning is the hex-cell variant of density grids, popular for social media geo-analytics. Fishnet grids are square-cell density grids. H3 hexagonal grid is Uber's hierarchical hex index (see the Hex Grid & Fishnet Grid Generator). Heat maps visualize the same information with a different rendering pass.

Frequently Asked Questions

What cell size should I use?

Target 30-100 points per cell on average. Too coarse loses detail; too fine produces noisy output.

Are hex or square bins better?

Hex bins are visually smoother and have uniform neighbor distances. Squares are easier to compute and snap to existing rasters.

Can I bin lines or polygons?

Convert them to centroids or vertices first with the Centroid / Point-on-Surface or Line to Points tool.

How do I normalize for uneven area in geographic CRS?

Reproject to an equal-area CRS before binning.

Related Tools on gis.tools

100% client-side processing - your data stays private and never leaves your device