Hierarchical pentagonial indexing for geospatial data that is equal-area and millimeter accurate.
Maintainer(s):
rustyconover
Installing and Loading
INSTALL a5 FROM community;
LOAD a5;
About a5
For more information regarding usage, see the documentation.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| a5_cell_area | scalar | Returns the area in square meters of an A5 cell at the specified resolution level | NULL | [a5_cell_area(10)] |
| a5_cell_edge_length_avg | scalar | Returns the average edge length in meters of an A5 cell at the specified resolution level; individual edges vary from the average by roughly +/-10% | NULL | [a5_cell_edge_length_avg(10)] |
| a5_cell_to_boundary | scalar | Returns the boundary vertices of an A5 cell as a closed ring of [lon, lat] points | NULL | [a5_cell_to_boundary(a5_lonlat_to_cell(-122.4, 37.8, 5))] |
| a5_cell_to_boundary | scalar | Returns the boundary vertices of an A5 cell with configurable ring closure and edge interpolation segments | NULL | [a5_cell_to_boundary(a5_lonlat_to_cell(-122.4, 37.8, 5), true, 4)] |
| a5_cell_to_boundary | scalar | Returns the boundary vertices of an A5 cell, optionally as an open or closed ring | NULL | [a5_cell_to_boundary(a5_lonlat_to_cell(-122.4, 37.8, 5), false)] |
| a5_cell_to_children | scalar | Returns all child A5 cells at the specified finer resolution | NULL | [a5_cell_to_children(a5_lonlat_to_cell(-122.4, 37.8, 5), 6)] |
| a5_cell_to_children | scalar | Returns the immediate child A5 cells (one resolution finer) | NULL | [a5_cell_to_children(a5_lonlat_to_cell(-122.4, 37.8, 5))] |
| a5_cell_to_geometry | scalar | Returns an A5 cell as a POLYGON geometry of its boundary | NULL | [a5_cell_to_geometry(a5_lonlat_to_cell(-122.4, 37.8, 5))] |
| a5_cell_to_geometry | scalar | Returns an A5 cell as a POLYGON geometry, with each edge interpolated into the given number of segments | NULL | [a5_cell_to_geometry(a5_lonlat_to_cell(-122.4, 37.8, 5), 4)] |
| a5_cell_to_lonlat | scalar | Returns the center point [longitude, latitude] of an A5 cell | NULL | [a5_cell_to_lonlat(a5_lonlat_to_cell(-122.4, 37.8, 10))] |
| a5_cell_to_parent | scalar | Returns the parent A5 cell at the specified coarser resolution | NULL | [a5_cell_to_parent(a5_lonlat_to_cell(-122.4, 37.8, 10), 5)] |
| a5_cell_to_point | scalar | Returns the center of an A5 cell as a POINT geometry | NULL | [a5_cell_to_point(a5_lonlat_to_cell(-122.4, 37.8, 5))] |
| a5_compact | scalar | Compacts a list of A5 cells by merging complete sets of sibling cells into parent cells | NULL | [a5_compact(a5_cell_to_children(a5_lonlat_to_cell(-122.4, 37.8, 5)))] |
| a5_geometry_to_cells | scalar | Returns the A5 cells covering an arbitrary geometry at the given resolution, as above. For polygon parts, setting overlapping to true additionally includes every cell that touches the polygon boundary, giving gap-free coverage instead of the default cell-center containment | NULL | [a5_geometry_to_cells('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))'::GEOMETRY, 8, true)] |
| a5_geometry_to_cells | scalar | Returns the A5 cells covering an arbitrary geometry at the given resolution. Points map to their containing cell, lines are traced, and polygons are filled with cell-center containment (holes excluded); MULTI* and GEOMETRYCOLLECTION inputs are unioned. Polygon coverings are compacted - use a5_uncompact to expand to a uniform resolution | NULL | [a5_geometry_to_cells('MULTIPOINT((0 0), (10 10))'::GEOMETRY, 8)] |
| a5_get_num_cells | scalar | Returns the total number of A5 cells at the specified resolution level (0-30) | NULL | [a5_get_num_cells(5)] |
| a5_get_num_children | scalar | Returns the number of child cells at child_resolution that fit within a cell at parent_resolution | NULL | [a5_get_num_children(0, 1)] |
| a5_get_res0_cells | scalar | Returns all 12 resolution 0 (root) A5 cells covering the entire globe | NULL | [a5_get_res0_cells()] |
| a5_get_resolution | scalar | Returns the resolution level (0-30) of an A5 cell | NULL | [a5_get_resolution(a5_lonlat_to_cell(-122.4, 37.8, 10))] |
| a5_grid_disk | scalar | Returns all A5 cells within k edge-steps of the given cell (edge adjacency) | NULL | [a5_grid_disk(a5_lonlat_to_cell(-122.4, 37.8, 10), 1)] |
| a5_grid_disk_vertex | scalar | Returns all A5 cells within k vertex-steps of the given cell (vertex adjacency) | NULL | [a5_grid_disk_vertex(a5_lonlat_to_cell(-122.4, 37.8, 10), 1)] |
| a5_hex_to_u64 | scalar | Converts an A5 hex string representation to a UBIGINT cell ID | NULL | [a5_hex_to_u64('1600000000000000')] |
| a5_is_valid_cell | scalar | Returns true if the value is a valid A5 cell ID (a canonically-encoded cell). The world cell (0) is considered valid | NULL | [a5_is_valid_cell(a5_lonlat_to_cell(-122.4, 37.8, 5))] |
| a5_lonlat_to_cell | scalar | Converts a longitude/latitude coordinate to an A5 cell at the specified resolution | NULL | [a5_lonlat_to_cell(-122.4194, 37.7749, 10)] |
| a5_spherical_cap | scalar | Returns all A5 cells within the specified radius (in meters) of the given cell | NULL | [a5_spherical_cap(a5_lonlat_to_cell(-122.4, 37.8, 10), 1000.0)] |
| a5_u64_to_hex | scalar | Converts a UBIGINT A5 cell ID to its hex string representation | NULL | [a5_u64_to_hex(a5_lonlat_to_cell(-122.4, 37.8, 10))] |
| a5_uncompact | scalar | Expands a compacted list of A5 cells to the specified target resolution | NULL | [a5_uncompact([a5_lonlat_to_cell(-122.4, 37.8, 5)], 7)] |
| a5_world_cell | scalar | Returns the A5 world cell, the root cell that covers the entire globe and is the ancestor of all resolution-0 cells | NULL | [a5_world_cell()] |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
This extension does not add any settings.