Skip to content

Commit 0beb57a

Browse files
committed
latest
1 parent de9dec5 commit 0beb57a

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

labs/deck/deck.zip

117 KB
Binary file not shown.

labs/deck/tereo-name-pydeck-example.ipynb

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,20 @@
2525
"Then you'll need to make a new environment. These instructions are from [here](https://pydeck.gl/installation.html). \n",
2626
"\n",
2727
"+ Open the **Anaconda console** and make a new environment as follows:\n",
28-
" conda create -n deck -c conda-forge pydeck jupyter\n",
28+
" \n",
29+
" `conda create -n deck -c conda-forge pydeck jupyter`\n",
30+
"\n",
2931
"+ Next start the environment:\n",
30-
" conda activate deck\n",
32+
"\n",
33+
" `conda activate deck`\n",
34+
"\n",
3135
"+ Then issue these two commands:\n",
32-
" jupyter nbextension install --sys-prefix --symlink --overwrite --py pydeck\n",
33-
" jupyter nbextension enable --sys-prefix --py pydeck\n",
3436
"\n",
35-
"That's it. You should be able to start a notebook as usual, this time in the `deck` environment, and the code below should work."
37+
" `jupyter nbextension install --sys-prefix --symlink --overwrite --py pydeck`\n",
38+
" \n",
39+
" `jupyter nbextension enable --sys-prefix --py pydeck`\n",
40+
"\n",
41+
"That's it. You should be able to start a notebook as usual, this time in the `deck` environment, and the code below should work. Note that the example may not work in VSCode---I think due to security settings of the HTML viewer (it's not insecure... all the data are local, it's some setting associated with 'cross-origin' resources)."
3642
]
3743
},
3844
{
@@ -55,7 +61,8 @@
5561
"metadata": {},
5662
"outputs": [],
5763
"source": [
58-
"import pydeck"
64+
"import pydeck\n",
65+
"import string"
5966
]
6067
},
6168
{
@@ -82,6 +89,7 @@
8289
"outputs": [],
8390
"source": [
8491
"DATA_URL = \"tnames.json\"\n",
92+
"chars = string.ascii_letters + \"āēīōūĀĒŌĪŪ1234567890/ \"\n",
8593
"\n",
8694
"INITIAL_VIEW_STATE = pydeck.ViewState(\n",
8795
" latitude = -41,\n",
@@ -97,14 +105,13 @@
97105
" DATA_URL,\n",
98106
" opacity = 0.65,\n",
99107
" get_text = \"name\",\n",
100-
" size_units = \"meter\",\n",
108+
" size_units = \"meters\",\n",
101109
" get_size = 1000,\n",
102110
" size_max_pixels = 32,\n",
103111
" get_position = [\"lng\", \"lat\"],\n",
104-
" get_color = 'reo > 0 ? [153, 0, 0] : [0, 0, 153]',\n",
112+
" get_color = 'reo > 0 ? [204, 0, 0] : [0, 0, 204]',\n",
105113
" billboard = True,\n",
106-
" character_set = pydeck.types.String(\n",
107-
" \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZāēīōūĀĒŌĪŪ1234567890/ \"),\n",
114+
" character_set = pydeck.types.String(chars),\n",
108115
" font_family = pydeck.types.String(\"Times, serif\"),\n",
109116
" pickable = True\n",
110117
")"
@@ -142,7 +149,7 @@
142149
"source": [
143150
"Because we are running this in a notebook we just get a locally viewable web page. If we run the code as a script we can also save to a web page.\n",
144151
"\n",
145-
"I suggest experimenting with other options in the `pydeck.Layer()` constructor function. Also make sure to take a look at the generated HTML code (it's surprisingly simple, but it won't open in a browser again, because we generated it in a notebook).\n",
152+
"I suggest experimenting with other options in the `pydeck.Layer()` constructor function. Also make sure to take a look at the generated HTML code (it's surprisingly simple, but it won't open in a browser, because we generated it in a notebook).\n",
146153
"\n",
147154
"Try visualising a different dataset, using a different deck layer format. For example, you can take a look at something simple like the California counties data from weeks ago, using the [GeoJsonLayer](https://deck.gl/docs/api-reference/layers/geojson-layer). You'll need to convert those files to GeoJSON format and also latitude-longitude format (EPSG code 4326)."
148155
]
@@ -175,13 +182,16 @@
175182
"\n",
176183
"You can use [`kepler.gl`](https://kepler.gl/) to [make simple similar apps](https://southosullivan.com/misc/loi.html) without any code at all.\n",
177184
"\n",
178-
"If you have to make a custom user interface, then there's no realy way to avoid... web development... and there aren't enough hours in the month to cover that in the context of this course. \n",
185+
"If you have to make a custom user interface, then there's no real way to avoid... web development... and there aren't enough hours in the month to cover that in the context of this course. \n",
179186
"\n",
180187
"Suffice to say, web development is a field worth investing some time and energy in, especially if your interests lie in the direction of high interaction graphical applications."
181188
]
182189
}
183190
],
184191
"metadata": {
192+
"interpreter": {
193+
"hash": "ebc44b48f8bab08f577aeb2e1dce152bdc30f81c7b302646e686ad24258b8930"
194+
},
185195
"kernelspec": {
186196
"display_name": "Python 3 (ipykernel)",
187197
"language": "python",
Binary file not shown.

labs/pyqgis/transit/route-29.gpkg

0 Bytes
Binary file not shown.

labs/pyqgis/transit/route-29.qgz

5.65 KB
Binary file not shown.

labs/pyqgis/voronoi/buildings.gpkg

0 Bytes
Binary file not shown.

labs/web-scraping/web-scraping-in-python.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,11 @@
502502
}
503503
],
504504
"metadata": {
505+
"interpreter": {
506+
"hash": "b9476ba453617cf67dc901a6664618619892412b6f80972fafe3f677f6bd1d4c"
507+
},
505508
"kernelspec": {
506-
"display_name": "Python 3 (ipykernel)",
509+
"display_name": "Python 3.9.7 ('g420')",
507510
"language": "python",
508511
"name": "python3"
509512
},

0 commit comments

Comments
 (0)