Loading

GEOSHAPE->

geo

The GEOSHAPE-> function converts GEOSHAPE to a list of LONG geocells or STRING HHCode prefixes. Conversion to list of BYTES is not supported, because this representation only supports resolution multiple of 4.

GEOSHAPE-> is available since version 2.6.0.

See also

Signatures

Examples

// Zone in GeoJSON '{"type":"Polygon","coordinates":[[[-4.574435,48.641404],[-4.565680,48.641404],[-4.565680,48.636101],[-4.574435,48.636101],[-4.574435,48.641404]]]}' // Precision (10% of the bounding box diagonal) 0.1 // Consider all cells covering the area false GEO.JSON 'geoshape' STORE // Convert shape to list of STRING HHCode prefixes $geoshape T GEOSHAPE-> // Remove the last character of these prefixes, effectively // decreasing the resolution of the cell by 2. <% 'hhprefix' STORE $hhprefix 0 $hhprefix SIZE 1 - SUBSTRING %> F LMAP // Rebuild the GEOSHAPE from the list of trimmed prefixes. ->GEOSHAPE // Convert to GeoJSON for visualization ->GEOJSON JSON-> // Also visualize the original GEOSHAPE $geoshape ->GEOJSON JSON->