poly2grid_untiled
Geometric functions poly2grid_untiled

syntax
- poly2grid_untiled(polygon_data_item, gridunit)
definition
The poly2grid_untiled function results in a Grid Data item with a relation to the Domain unit of the polygon_data_item.
The resulting data item has:
- as Domain unit the gridunit argument
- as Values unit the Domain unit of the polygon_data_item Argument
description
This function is the same as Poly2grid but writes single-threaded on a single mutable shadow tile that is then split into separate tiles after rendering all polygons. Compared to Poly2grid, this poly2grid_untiled function will:
- take longer to calculate (as it doesn’t process tiles in parallel),
- use more memory (to store the intermediate mutable shadow tile),
- but use less CPU time (as polygon preparation is not repeated for each tile with which their bounding box intersects),
- the results are independent of the actual tiling (which is not always true for Poly2grid as the conversion to a tile-local coordinate system might cause tiling-dependent flip-cases).
applies to
- data item polygon_data_item with a wpoint, spoint, upoint, ipoint, fpoint or dpoint Value type
- Unit gridunit with a wpoint, spoint, upoint, ipoint, fpoint, dpoint value type
conditions
- The composition type type of the polygon_data_item needs to be polygon.
- The Domain unit of the polygon_data_item must be of value type uint32.
since version
8.7.0
performance
Same complexity as Poly2grid: O(n * log(n) + x) per polygon where n = number of vertices and x = number of pixels. Single-threaded execution uses more wall-clock time but less total CPU time than tiled version. Memory usage is higher due to full shadow tile allocation.
example
attribute<source/district> DistrictGrid (gridunit/gridcel_10m) :=
poly2grid_untiled(Source/District/border, gridunit/gridcel_10m);