Computing contour map using topological cases and classifier cases
A computing device including one or more processing devices configured to receive raster data including raster data values. The processing devices obtain classifier grid data including classification values selected from among two or more classes. The processing devices generate a contour map by, for each of the classes, generating contour segments connecting pairs of grid locations included in the raster data. Generating the contour segments includes computing respective topological cases of cells of a superimposed grid, which includes cells of the raster data that are associated with respective classification values. Generating the contour segments further includes computing respective classifier cases of the cells. The contour segments are computed based on the topological cases and classifier cases of the cells and are combined into contours. The contour map is computed as a visual representation of the contours. The processing devices output the contour map for display at a display device.
1 . A computing device comprising:
one or more processing devices configured to:
receive raster data including a plurality of raster data values;
obtain classifier grid data including a plurality of classification values selected from among two or more classes;
generate a contour map at least in part by:
for each of the classes, generating a set of contour segments connecting respective pairs of grid locations included in the raster data, wherein generating the set of contour segments includes:
computing respective topological cases of a plurality of cells of a superimposed grid, wherein;
the superimposed grid includes a plurality of cells of the raster data that are associated with respective classification values included in the classifier grid data; and
for each of the cells of the superimposed grid, the corresponding topological case indicates which of the raster data values included in the cell are greater than a current contour level;
computing respective classifier cases of the cells of the superimposed grid, wherein, for each of the cells of the superimposed grid, the corresponding classifier case includes four Boolean flags that indicate which of four neighboring-cell classification values are equal to the classification value of the cell; and
computing the contour segments based at least in part on the topological cases and classifier cases of the cells;
combining the contour segments into a plurality of contours; and
computing the contour map as a visual representation of the plurality of contours; and
output the contour map for display at a display device.
2 . The computing device of claim 1 , wherein:
in the superimposed grid, the classifier grid data is offset from the raster data by half a pixel along both a horizontal axis and a vertical axis; and
each of the cells of the superimposed grid has a height of two raster data values and a width of two raster data values.
3 . The computing device of claim 2 , wherein:
for each of the classes, the one or more processing devices are configured to generate two or more respective sets of contour segments; and
the two or more sets of contour segments correspond to different contour levels of the raster data values.
4 . The computing device of claim 2 , wherein:
the one or more processing devices are further configured to add a padding value border to the classifier grid data prior to computing the superimposed grid; and
the padding value border includes a plurality of padding classification values that are distinct from the two or more classes.
5 . The computing device of claim 1 , wherein the one or more processing devices are configured to compute the contour segments at least in part by:
based at least in part on the topological cases, computing a plurality of internal contour segments located within respective cells of the superimposed grid; and
based at least in part on the topological cases and the classifier cases, computing a plurality of edge segments located along horizontal or vertical boundaries of respective cells of the superimposed grid.
6 . The computing device of claim 5 , wherein the one or more processing devices are further configured to:
compute a plurality of intersections between respective contour segments and the horizontal or vertical boundaries of corresponding cells; and
compute the internal contour segments based at least in part on the intersections.
7 . The computing device of claim 1 , wherein:
the contour map visually represents the contours as closed polygons; and
the contour map indicates the two or more classes associated with the contours in a visually distinguishable manner.
8 . The computing device of claim 1 , wherein:
the contour map is a weather map;
the raster data is temperature data, precipitation quantity data, wind speed data, pressure data, humidity data, air quality data, pollen data, visibility data, dew point data, or wind chill data; and
the classifier grid data is precipitation type data, cloud cover data, or advisory data.
9 . A method for use with a computing device, the method comprising:
receiving raster data including a plurality of raster data values;
obtaining classifier grid data including a plurality of classification values selected from among two or more classes;
generating a contour map at least in part by:
for each of the classes, generating a set of contour segments connecting respective pairs of grid locations included in the raster data, wherein generating the set of contour segments includes:
computing respective topological cases of a plurality of cells of a superimposed grid, wherein:
the superimposed grid includes a plurality of cells of the raster data that are associated with respective classification values included in the classifier grid data; and
for each of the cells of the superimposed grid, the corresponding topological case indicates which of the raster data values included in the cell are greater than a current contour level;
computing respective classifier cases of the cells of the superimposed grid, wherein, for each of the cells of the superimposed grid, the corresponding classifier case includes four Boolean flags that indicate which of four neighboring-cell classification values are equal to the classification value of the cell; and
computing the contour segments based at least in part on the topological cases and classifier cases of the cells;
combining the contour segments into a plurality of contours; and
computing the contour map as a visual representation of the plurality of contours; and
outputting the contour map for display at a display device.
10 . The method of claim 9 , wherein:
in the superimposed grid, the classifier grid data is offset from the raster data by half a pixel along both a horizontal axis and a vertical axis; and
each of the cells of the superimposed grid has a height of two raster data values and a width of two raster data values.
11 . The method of claim 10 , further comprising, for each of the classes, generating two or more respective sets of contour segments, wherein the two or more sets of contour segments correspond to different contour levels of the raster data values.
12 . The method of claim 10 , further comprising adding a padding value border to the classifier grid data prior to computing the superimposed grid, wherein the padding value border includes a plurality of padding classification values that are distinct from the two or more classes.
13 . The method of claim 9 , wherein computing the contour segments includes:
based at least in part on the topological cases, computing a plurality of internal contour segments located within respective cells of the superimposed grid; and
based at least in part on the topological cases and the classifier cases, computing a plurality of edge segments located along horizontal or vertical boundaries of respective cells of the superimposed grid.
14 . The method of claim 13 , further comprising:
computing a plurality of intersections between respective contour segments and the horizontal or vertical boundaries of corresponding cells; and
computing the internal contour segments based at least in part on the intersections.
15 . The method of claim 9 , wherein:
the contour map visually represents the contours as closed polygons; and
the contour map indicates the two or more classes associated with the contours in a visually distinguishable manner.
16 . A computing device comprising:
one or more processing devices configured to:
receive raster data including a plurality of raster data values;
obtain classifier grid data including a plurality of classification values selected from among two or more classes;
add a padding value border to the classifier grid data;
generate a contour map at least in part by:
computing a superimposed grid in which the classifier grid data is offset from the raster data by half a pixel along both a horizontal axis and a vertical axis, wherein:
the superimposed grid includes a plurality of cells of the raster data that are associated with respective classification values included in the classifier grid data; and
each of the cells of the superimposed grid has a height of two raster data values and a width of two raster data values;
for each of the classes, generating a set of contour segments connecting respective pairs of grid locations included in the raster data, wherein generating the set of contour segments includes:
computing respective topological cases of a plurality of cells of the superimposed grid, wherein, for each of the cells of the superimposed grid, the corresponding topological case indicates which of the raster data values included in the cell are greater than a current contour level;
computing respective classifier cases of the cells of the superimposed grid wherein, for each of the cells, the corresponding classifier case includes four Boolean flags that indicate which of four neighboring-cell classification values are equal to the classification value of the cell; and
computing the contour segments based at least in part on the topological cases and classifier cases of the cells;
combining the contour segments into a plurality of contours; and
computing the contour map as a visual representation of the plurality of contours; and
output the contour map for display at a display device.
17 . The computing device of claim 16 , wherein:
for each of the classes, the one or more processing devices are configured to generate two or more respective sets of contour segments; and
the two or more sets of contour segments correspond to different contour levels of the raster data values.
18 . The computing device of claim 16 , wherein the one or more processing devices are configured to compute the contour segments at least in part by:
based at least in part on the topological cases, computing a plurality of internal contour segments located within respective cells of the superimposed grid; and
based at least in part on the topological cases and the classifier cases, computing a plurality of edge segments located along horizontal or vertical boundaries of respective cells of the superimposed grid.
19 . The computing device of claim 18 , wherein the one or more processing devices are further configured to:
compute a plurality of intersections between respective contour segments and the horizontal or vertical boundaries of corresponding cells; and
compute the internal contour segments based at least in part on the intersections.
20 . The computing device of claim 16 , wherein:
the contour map visually represents the contours as closed polygons; and
the contour map indicates the two or more classes associated with the contours in a visually distinguishable manner.