Geo Grid
Synopsis
Transforms geo-grid definitions (geohash, geotile) into standard geometric shapes (bounding boxes or polygons) for spatial indexing and operations.
Schema
geo_grid:
- field: <ident>
- tile_type: <enum>
- children_field: <ident>
- description: <text>
- if: <script>
- ignore_failure: <boolean>
- ignore_missing: <boolean>
- non_children_field: <ident>
- on_failure: <processor[]>
- on_success: <processor[]>
- parent_field: <ident>
- precision_field: <ident>
- tag: <string>
- target_field: <ident>
- target_format: <enum>
Configuration
Field | Required | Default | Description |
---|---|---|---|
field | Y | - | Field containing the geo-grid cell identifier |
tile_type | Y | - | Grid system type: geohash or geotile |
children_field | N | - | Store child cell identifiers in this field |
description | N | - | Documentation note |
if | N | - | Conditional expression |
ignore_failure | N | false | Skip errors in processing |
ignore_missing | N | false | Skip if input field is missing |
non_children_field | N | - | Store intersecting non-child cells here |
on_failure | N | - | Error handling processors |
on_success | N | - | Success handling processors |
parent_field | N | - | Store parent cell identifier here |
precision_field | N | - | Store zoom level/precision here |
tag | N | - | Identifier for logging |
target_field | N | field | Output field for the shape |
target_format | N | GeoJSON | Output format: WKT or GeoJSON |
Details
The processor converts string-based grid cell identifiers into actual geometric shapes that can be used for spatial operations, e.g.
- a geohash such as "
sn4ph
" becomes a polygon with precise coordinates - a geotile such as "
4/8/5
" becomes an envelope with defined boundaries
This transformation enables spatial indexing of grid cells, geometric operations (intersection, containment, etc.), visual representation of grid cells, and integration with geo-shape-capable systems.
The processor handles different precision levels for both geohash
and geotile
formats automatically, adjusting the output shape as necessary.
Geohash cells that contain poles cannot be converted to polygons due to coordinate system limitations.
Formats
GeoJSON
For geohash cells, outputs a GeoJSON Polygon:
{
"type": "Polygon",
"coordinates": [
[
[lon1, lat1],
[lon2, lat2],
[lon3, lat3],
[lon4, lat4],
[lon1, lat1] // Closing point
]
]
}
For geotile cells, outputs a GeoJSON Envelope:
{
"type": "Envelope",
"coordinates": [
[minLon, maxLat], // Top-left
[maxLon, minLat] // Bottom-right
]
}
WKT
For geohash cells, outputs a WKT POLYGON:
POLYGON((lon1 lat1, lon2 lat2, lon3 lat3, lon4 lat4, lon1 lat1))
For geotile cells, outputs a WKT ENVELOPE:
ENVELOPE(minLon, maxLon, maxLat, minLat)
Examples
Basic
Converting a geohash to a polygon... |
|
creates a GeoJSON polygon: |
|
Geotile to WKT
Converting a geotile to WKT... |
|
produces a WKT envelope: |
|
Conditionals
Processing based on a specific state... |
|
transforms the shape only conditionally: |
|
Error Handling
Handling invalid grid cell values... |
|
continues the execution: |
|