Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ProjectPythia/unstructured-grid-viz…
Browse files Browse the repository at this point in the history
…-cookbook
  • Loading branch information
erogluorhan committed Dec 7, 2023
2 parents 4de1096 + cf91510 commit 52c2244
Showing 1 changed file with 18 additions and 54 deletions.
72 changes: 18 additions & 54 deletions notebooks/02-methods/02-rendering-techniques.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"\n",
"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",
"\n",
"![Rasterization Example](../images/rendering/polygons.png)"
"\n",
"<img src=\"../images/rendering/polygons.png\" alt=\"Continents\" width=\"800\"/>"
],
"metadata": {
"collapsed": false
Expand All @@ -36,7 +37,8 @@
"source": [
"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",
"\n",
"![Rasterization Example](../images/rendering/contients.jpg)"
"\n",
"<img src=\"../images/rendering/contients.jpg\" alt=\"Continents\" width=\"800\"/>"
],
"metadata": {
"collapsed": false
Expand All @@ -53,17 +55,13 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"outputs": [],
"source": [
"import shapely as sp"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-12-07T04:28:15.239081600Z",
"start_time": "2023-12-07T04:28:15.145149300Z"
}
"collapsed": false
}
},
{
Expand Down Expand Up @@ -95,27 +93,13 @@
},
{
"cell_type": "code",
"execution_count": 2,
"outputs": [
{
"data": {
"text/plain": "<LINESTRING (0 0, 180 -90)>",
"image/svg+xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"194.39999999999998\" height=\"104.4\" viewBox=\"-7.2 -97.2 194.39999999999998 104.4\" preserveAspectRatio=\"xMinYMin meet\"><g transform=\"matrix(1,0,0,-1,0,-90.0)\"><polyline fill=\"none\" stroke=\"#66cc99\" stroke-width=\"2.0\" points=\"0.0,0.0 180.0,-90.0\" opacity=\"0.8\" /></g></svg>"
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"outputs": [],
"source": [
"sp.LineString([[0.0, 0.0], [180, -90]])"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-12-07T04:28:15.246966500Z",
"start_time": "2023-12-07T04:28:15.240587600Z"
}
"collapsed": false
}
},
{
Expand All @@ -129,27 +113,13 @@
},
{
"cell_type": "code",
"execution_count": 3,
"outputs": [
{
"data": {
"text/plain": "<POLYGON ((100 40, 100 50, 90 50, 90 40, 100 40))>",
"image/svg+xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"100.0\" height=\"100.0\" viewBox=\"89.6 39.6 10.800000000000011 10.799999999999997\" preserveAspectRatio=\"xMinYMin meet\"><g transform=\"matrix(1,0,0,-1,0,90.0)\"><path fill-rule=\"evenodd\" fill=\"#66cc99\" stroke=\"#555555\" stroke-width=\"0.21600000000000022\" opacity=\"0.6\" d=\"M 100.0,40.0 L 100.0,50.0 L 90.0,50.0 L 90.0,40.0 L 100.0,40.0 z\" /></g></svg>"
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"outputs": [],
"source": [
"sp.Polygon([[100, 40], [100, 50], [90, 50], [90, 40], [100, 40]])"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-12-07T04:28:15.252216900Z",
"start_time": "2023-12-07T04:28:15.248966900Z"
}
"collapsed": false
}
},
{
Expand All @@ -159,18 +129,10 @@
"\n",
"Rendering each geometry directly is an expensive operation for even moderately large datasets. \n",
"\n",
"Rasterization \n",
"Rasterization todo..\n",
"\n",
"![Rasterization Example](../images/rendering/raster_example.png)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "raw",
"source": [
"Below is an example of how rasterization looks like when applied to an unstructrued grid represented in terms of polygons."
"\n",
"<img src=\"../images/rendering/raster_example.png\" alt=\"Rasterization Example\" width=\"800\"/>"
],
"metadata": {
"collapsed": false
Expand All @@ -179,7 +141,9 @@
{
"cell_type": "markdown",
"source": [
"![Rasterization Example](../images/rendering/raster-vs-vector.png)"
"Below is an example of rastered polygons plotted against the expected geometry.\n",
"\n",
"<img src=\"../images/rendering/raster-vs-vector.png\" alt=\"raster and vector\" width=\"800\"/>"
],
"metadata": {
"collapsed": false
Expand Down

0 comments on commit 52c2244

Please sign in to comment.