|
7 | 7 | "# Rendering Techniques\n", |
8 | 8 | "---\n", |
9 | 9 | "\n", |
10 | | - "Since Unstructured Grids are significantly more complex than Structured (a.k.a. Regular) Grids, the choice of rendering technique plays an important role in obtaining high-resolution, accurate, and scalable visualizations. \n", |
| 10 | + "Since Unstructured Grids require significantly more overhead to represent compared to Structured (a.k.a. Regular) grids, the choice of rendering technique plays an important in obtaining high-resolution, accurate, and scalable visualuations. \n", |
| 11 | + "\n", |
11 | 12 | "\n", |
12 | 13 | "This notebook introduces relevant concepts and techniques that will be mentioned and used throughout this Cookbook." |
13 | 14 | ] |
14 | 15 | }, |
15 | 16 | { |
16 | 17 | "cell_type": "markdown", |
| 18 | + "metadata": { |
| 19 | + "collapsed": false |
| 20 | + }, |
17 | 21 | "source": [ |
18 | 22 | "## Vector (Shape) Geometries\n", |
19 | 23 | "\n", |
|
26 | 30 | "Rendering each face as a polygon will lead to visuals that look like this, which are extremely high-quality and represent the exact geometry of each face.\n", |
27 | 31 | "\n", |
28 | 32 | "\n", |
29 | | - "<img src=\"../images/rendering/polygons.png\" alt=\"Continents\" width=\"800\"/>" |
30 | | - ], |
31 | | - "metadata": { |
32 | | - "collapsed": false |
33 | | - } |
| 33 | + "<img src=\"../images/rendering/polygons.png\" alt=\"Continents\" width=\"400\"/>" |
| 34 | + ] |
34 | 35 | }, |
35 | 36 | { |
36 | 37 | "cell_type": "markdown", |
| 38 | + "metadata": { |
| 39 | + "collapsed": false |
| 40 | + }, |
37 | 41 | "source": [ |
38 | 42 | "Another example of Vector Geometries is encountered when adding features to a visualization, such as Contents or Borders. The geometries of these features are drawn onto our screen.\n", |
39 | 43 | "\n", |
40 | 44 | "\n", |
41 | | - "<img src=\"../images/rendering/contients.jpg\" alt=\"Continents\" width=\"800\"/>" |
42 | | - ], |
43 | | - "metadata": { |
44 | | - "collapsed": false |
45 | | - } |
| 45 | + "<img src=\"../images/rendering/contients.jpg\" alt=\"Continents\" width=\"600\"/>" |
| 46 | + ] |
46 | 47 | }, |
47 | 48 | { |
48 | 49 | "cell_type": "markdown", |
49 | | - "source": [ |
50 | | - "The following examples show examples of how different elements of an unstructured grid can be represented geometrically." |
51 | | - ], |
52 | 50 | "metadata": { |
53 | 51 | "collapsed": false |
54 | | - } |
| 52 | + }, |
| 53 | + "source": [ |
| 54 | + "The following code snippets show how we can represent each of the main unstructured grid geometries.\n" |
| 55 | + ] |
55 | 56 | }, |
56 | 57 | { |
57 | 58 | "cell_type": "code", |
58 | 59 | "execution_count": null, |
59 | | - "outputs": [], |
60 | | - "source": [ |
61 | | - "import shapely as sp" |
62 | | - ], |
63 | | - "metadata": { |
64 | | - "collapsed": false |
65 | | - } |
66 | | - }, |
67 | | - { |
68 | | - "cell_type": "markdown", |
69 | | - "source": [ |
70 | | - "A point is represented using a pair of Longitude and Latitude Values" |
71 | | - ], |
72 | 60 | "metadata": { |
73 | 61 | "collapsed": false |
74 | | - } |
75 | | - }, |
76 | | - { |
77 | | - "cell_type": "markdown", |
78 | | - "source": [ |
79 | | - "sp.Point([0.0, 0.0])" |
80 | | - ], |
81 | | - "metadata": { |
82 | | - "collapsed": false |
83 | | - } |
84 | | - }, |
85 | | - { |
86 | | - "cell_type": "markdown", |
| 62 | + }, |
| 63 | + "outputs": [], |
87 | 64 | "source": [ |
88 | | - "An Edge is represented using a pair of points. " |
89 | | - ], |
90 | | - "metadata": { |
91 | | - "collapsed": false |
92 | | - } |
| 65 | + "import shapely as sp" |
| 66 | + ] |
93 | 67 | }, |
94 | 68 | { |
95 | 69 | "cell_type": "code", |
|
102 | 76 | "collapsed": false |
103 | 77 | } |
104 | 78 | }, |
105 | | - { |
106 | | - "cell_type": "markdown", |
107 | | - "source": [ |
108 | | - "A Polygon is represented in terms of it's exterior coordinates, each of which are points." |
109 | | - ], |
110 | | - "metadata": { |
111 | | - "collapsed": false |
112 | | - } |
113 | | - }, |
114 | 79 | { |
115 | 80 | "cell_type": "code", |
116 | 81 | "execution_count": null, |
| 82 | + "metadata": { |
| 83 | + "collapsed": false |
| 84 | + }, |
117 | 85 | "outputs": [], |
118 | 86 | "source": [ |
119 | 87 | "sp.Polygon([[100, 40], [100, 50], [90, 50], [90, 40], [100, 40]])" |
120 | | - ], |
121 | | - "metadata": { |
122 | | - "collapsed": false |
123 | | - } |
| 88 | + ] |
124 | 89 | }, |
125 | 90 | { |
126 | 91 | "cell_type": "markdown", |
| 92 | + "metadata": { |
| 93 | + "collapsed": false |
| 94 | + }, |
127 | 95 | "source": [ |
128 | 96 | "## Rasterization\n", |
129 | 97 | "\n", |
130 | | - "Rendering each geometry directly is an expensive operation for even moderately large datasets. \n", |
| 98 | + "While there is definitely merit in rendering each geometric shape directly, this operation is extremely computationally expensive for large datasets.\n", |
131 | 99 | "\n", |
132 | | - "Rasterization todo..\n", |
| 100 | + "Rasterization is a technique in computer graphics that converts vector (a.k.a geometric shapes) graphics into a raster image, which is simply a series of pixels.\n", |
133 | 101 | "\n", |
| 102 | + "The figure below shows how rasterization approximates the geometry of geometries.\n", |
134 | 103 | "\n", |
135 | | - "<img src=\"../images/rendering/raster_example.png\" alt=\"Rasterization Example\" width=\"800\"/>" |
136 | | - ], |
137 | | - "metadata": { |
138 | | - "collapsed": false |
139 | | - } |
| 104 | + "\n", |
| 105 | + "<img src=\"../images/rendering/raster_example.png\" alt=\"Rasterization Example\" width=\"1000\"/>" |
| 106 | + ] |
140 | 107 | }, |
141 | 108 | { |
142 | 109 | "cell_type": "markdown", |
143 | | - "source": [ |
144 | | - "Below is an example of rastered polygons plotted against the expected geometry.\n", |
145 | | - "\n", |
146 | | - "<img src=\"../images/rendering/raster-vs-vector.png\" alt=\"raster and vector\" width=\"800\"/>" |
147 | | - ], |
148 | 110 | "metadata": { |
149 | 111 | "collapsed": false |
150 | | - } |
| 112 | + }, |
| 113 | + "source": [ |
| 114 | + "Below is an example of rasterized polygons plotted against the expected geometry.\n", |
| 115 | + "\n", |
| 116 | + "<img src=\"../images/rendering/raster-vs-vector.png\" alt=\"raster and vector\" width=\"400\"/>" |
| 117 | + ] |
151 | 118 | }, |
152 | 119 | { |
153 | 120 | "cell_type": "markdown", |
154 | | - "source": [], |
155 | 121 | "metadata": { |
156 | 122 | "collapsed": false |
157 | | - } |
| 123 | + }, |
| 124 | + "source": [] |
158 | 125 | } |
159 | 126 | ], |
160 | 127 | "metadata": { |
|
173 | 140 | "name": "python", |
174 | 141 | "nbconvert_exporter": "python", |
175 | 142 | "pygments_lexer": "ipython3", |
176 | | - "version": "3.10.11" |
| 143 | + "version": "3.11.5" |
177 | 144 | }, |
178 | 145 | "nbdime-conflicts": { |
179 | 146 | "local_diff": [ |
|
0 commit comments