Skip to main content
100%

Order polygons by size/height

✓ Published0🌍 Public
Aandrewxhill
Last edited Oct 11, 2012
Created on Oct 11, 2012

This example arranges OpenStreetMap polygon features—such as buildings or land parcels—into a tidy, space-filling grid ordered by each shape’s vertical height. A recursive SQL query computes cumulative row offsets, placing taller polygons first and wrapping shorter ones to new rows while preserving their original geometries. It then translates each polygon to its grid position and reprojects the result to Web Mercator using PostGIS functions like `ST_Translate` and `ST_Transform`. The final output is a compact, non-overlapping layout that reveals size distribution patterns at a glance.

AI-generated description

Similar vizzes