Grid
| Input |
1 Continuous data
on a working map composed by points or surfaces
OR
1 Continuous data on a working map composed by points or surfaces
and 1 working map with 1 closed polygon |
| Output |
Continuous data |
Description:
The module draws up a new working map containing only a grid of squares. It then calculates the value associated with
each square.
The squares are all the same size, defined in the Size entry field, which you can modify by unchecking the
Automatic size box.
The Squares origin point indicates the squares position, you can modify it by unchecking the Automatic
origin box. The first square will have it as its center, unless its coordinates are out of the map: in this case,
no square will have it as its center, but the squares will however be relative to this point.
You may choose between the following : "Standard Method" or "Points Interpolation".
But you must indicate first the type of input data, because the calculation will be different according to
this type:
- absolute data : it is commonly a number of elements (ex: 100 persons, 2000 tons, 70 000 vehicle),
etc...
- relative data : it is commonly a rate (division of two absolute data), etc...
Standard Method tab
The processing depends on the initial working map composition:
- If the map contains only surfaces, the formula used is indicated below.
- If the map contains only points, you have the choice between 3 operations: sum total,
average or number of entities. The formula used are indicated below.
-
If the map contains both points and surfaces, which is STRONGLY DISCOURAGED, then the type of the first entity on
the map determines the type of calculation to be carried out:
- if the first entity is a point, then all surfaces will be ignored and the calculation will be made only on
points.
- if the first entity is a surface, then all points will be ignored and the calculation will be made only on
surfaces.
The value associated with each square is defined as follows:
-
If the initial working map contains only surfaces:
Let:
- Ri be region number i
- Vi be the value for the region
- Si be the surface of the square filled by Ri
- V be the value associated with the square
Then,
-
If the initial working map contains only points:
Let:
- Pi be point number i
- Vi be the value for the point
- V be the value associated with the square
Then for all the Pi of the initial working map contained in this square:
- sum total: V = sum total(Vi)
- average: V = sum total(Vi)/(number of points of the initial working map contained
in the square)
- number of entities: V = (number of points of the initial working map contained in the
square)
Comments:
- if the input data is relative, only the number of entities method is available.
- the squares created can be separated (because a square must contains at least one point of the initial
working map to be created).
Smoothing enables unusually high values to be removed. You can choose the desired blur level (1, 3, 5,
7 or 9). If the smoothing level is other than 1, the value V obtained for each square is the average of the 9, 25, 49,
or 81 surrounding squares.
If the input is an absolute data smoothing is not allowed (its value will be automatically set to 1). In fact,
in the case of an absolute data, a theoretical value is calculated for each square, so it is impossible to apply a
smoothing which will still change this value. It is not a problem with a relative data because it is already modified
and is depending on another data.
The threshold of visibility enables all the squares not completely filled by the intersecting areas to be
removed. The value that you enter is a percentage, so the threshold varies from 0 to 100.
For example, if a square placed on the edge of the map only touches one region, and the region fills 30% of the square
whereas the threshold has been set at 40%, the square is not used.
Points Interpolation tab
This method is available only if the input data is absolute.
This method deals only with points. Hence an automatic pre-process is made on all surfaces of the initial working
map to work on their centroids.
The main idea is that an approximative value of the data is calculated, not on the points of the initial working map
(yellow points below), but on the points of a regular grid (blue points below). The approximation calculation used is a
"distance-based weighted average" interpolation method (formula is indicated below).
Then a square (red below) is constructed around each blue points, and the output map will contain only the squares
which have an intersection with the convex boundary of the initial working map.
The advantage of this method is that the neighbourhood is taken into account in the approximative value of squares,
which is not possible in the "Standard Method".
where the yellow points are the points of the initial working map
the black squares represent the interpolation
grid
the blue points are the nodes of the
interpolation grid
the red squares represent the new working map
supplied as output of this module
The interpolation formula depends on the composition of the working map.
Let:
- Pi be point number i
- Vi be the value for the point
- Vk be the value associated to the node k of the interpolation grid
- Vp be the value of the nearest point of node k
- dik be the distance between point i and node k
- m be the number of neighbours points of node k
Then:
- In case of a regular points map
The points are evenly distributed on the map, the map doesn't contain a lot of empty zones or this zones are very
small.
- In case of a points map with large empty spaces
Some large empty zones exist on the map, or data are unavailable for a lot of points. In this case, the formula will
be different: the average with the nearest point will be added to the calculation. This will provide a value closer
to the supposed reality for this empty zones. But this process make a smoothing on the values, so we will calculated
the squared distance instead of the cubic distance in order to compensate this unwanted smoothing.
You can choose the number of neighbours to be used in the interpolation formula. It is difficult to specify a
number of neighbours which will provided the best map because it depends notably on the space between points in the
initial working map.
However we can say that if more than 12 points are used, the result will be highly smoothed, and if less than 4 points
are used, the result will have a lot of discontinuities.
The best value seems to be between 6 and 9.
It is advised to work on a grid larger than the initial working map to avoid discontinuities on boundaries, so a
grid enlargement is at your disposal (it is applied in the 4 directions).
Attention: the squares which are outside the map represent an "extrapolation" of the initial working map and then are
to consider with precaution.
Comment: the map created is a regular grid and then cannot have any hole.
Square bound :
By linking a map module with one closed polygon to the grid module, it's possible to define the bounds of the interpolated points.
Export:
You can export the working map together with the associated data using the appropriate button (this possibility
is limited in certain versions of the software, especially on the encrypted CDROMs such as European populations).
Script:
2 module untyped_list ""
3 mod_type integer "103"
3 mod_subtype integer "504"
3 mod_name string "Carroyage"
3 mod_dads integer_list ""
4 ? integer "4"
3 with_interpol boolean "F"
3 threshold double "99"
3 size double "2"
3 is_auto_size boolean "F"
3 is_auto_origin boolean "T"
3 blur_level integer "3"
3 origin vector ""
4 x_val double "476.84999"
4 y_val double "2248.15"
4 z_val double "0"
3 pt_calc_type integer "0"
3 neighb_count integer "6"
3 margin_percent integer "5"
3 is_regular_map boolean "T"
Values for pt_calc_type :
Sum total 0
Average 1
Number of entities 2
Samples
|