|
11 | 11 | "\n",
|
12 | 12 | "## Getting started\n",
|
13 | 13 | "\n",
|
14 |
| - "### If this is your first time using a notebook like this: \n", |
| 14 | + "### If this is your first time using a notebook like this:\n", |
15 | 15 | "\n",
|
16 | 16 | "1. You can use the up/down arrow keys of your keyboard to move between the different \"cells\" or regions of this notebook. The currently selected one will be highlighed on the left with a colour bar.\n",
|
17 | 17 | "2. You can \"run\" each of these cells/regions by either pressing the \"play\" button in the menu above, or by pressing CTRL+ENTER on your keyboard.\n",
|
18 |
| - "3. If you are in the \"editing\" mode where you type into a cell, pressing ESC will take you back to the mode where the arrow keys work. \n", |
| 18 | + "3. If you are in the \"editing\" mode where you type into a cell, pressing ESC will take you back to the mode where the arrow keys work.\n", |
19 | 19 | "\n",
|
20 | 20 | "### Uploading the OSM history file\n",
|
21 | 21 | "\n",
|
22 |
| - "Before we can do the rest of the steps in this notebook, you will have to upload an OSM history file that covers your region of interest. You can find the corresponding files on [Geofabrik's internal download server](https://osm-internal.download.geofabrik.de/?landing_page=true). Login with your OSM account to get to the `internal` files, and then find the page for the your region of interest. Ideally, find the smallest region that covers your area of interest to minimize the filesize you need to upload. \n", |
| 22 | + "Before we can do the rest of the steps in this notebook, you will have to upload an OSM history file that covers your region of interest. You can find the corresponding files on [Geofabrik's internal download server](https://osm-internal.download.geofabrik.de/?landing_page=true). Login with your OSM account to get to the `internal` files, and then find the page for the your region of interest. Ideally, find the smallest region that covers your area of interest to minimize the filesize you need to upload.\n", |
23 | 23 | "\n",
|
24 | 24 | "**The right file**: When you've picked your region, you will likely see two similarly named files listed: `regionname-internal.osh.pbf` and `regionname-latest-internal.osm.pbf`. The file you will want to download is the `regionname-internal.osh.pbf` (i.e. the one that includes `osh` and **no `latest`**).\n",
|
25 | 25 | "\n",
|
26 | 26 | "Once you have downloaded your file onto your computer, you need to upload it into your container:\n",
|
27 | 27 | "\n",
|
28 |
| - "* If you've launched this notebook in _MyBinder_, you can then open up the filebrowser on the top of the left hand side (The _file_ icon, or by pressing CTRL+SHIFT+F). \n", |
29 |
| - "* If you've launched this notebook locally, you're likely in the _notebook_ interface, switch back to the _tree_ view and upload your file there (or put it into the shared folder which is accessible by both the container and your normal operating system). \n", |
| 28 | + "* If you've launched this notebook in _MyBinder_, you can then open up the filebrowser on the top of the left hand side (The _file_ icon, or by pressing CTRL+SHIFT+F).\n", |
| 29 | + "* If you've launched this notebook locally, you're likely in the _notebook_ interface, switch back to the _tree_ view and upload your file there (or put it into the shared folder which is accessible by both the container and your normal operating system).\n", |
30 | 30 | "\n",
|
31 | 31 | "\n",
|
32 |
| - "## Starting to make the comparison images. \n", |
| 32 | + "## Starting to make the comparison images.\n", |
33 | 33 | "\n",
|
34 |
| - "When you run the code-cell below, it will generate some \"forms\" that will feel familiar form other web-forms, which you can use to enter all the necessary parameters to create your images. These forms allow you to add the _history file_ you have just uploaded, the two time-points you want to compare, the bounding box (i.e. the area you're interested in, which you can find e.g. [via bboxfinder](https://bboxfinder.com)) and the minimum/maximum zoom levels, if you want to create images at different zoom levels. \n", |
| 34 | + "When you run the code-cell below, it will generate some \"forms\" that will feel familiar form other web-forms, which you can use to enter all the necessary parameters to create your images. These forms allow you to add the _history file_ you have just uploaded, the two time-points you want to compare, the bounding box (i.e. the area you're interested in, which you can find e.g. [via bboxfinder](https://bboxfinder.com)) and the minimum/maximum zoom levels, if you want to create images at different zoom levels.\n", |
35 | 35 | "\n",
|
36 | 36 | "Now, run the cell below and then enter all the necessary information in the forms:"
|
37 | 37 | ]
|
38 | 38 | },
|
39 | 39 | {
|
40 |
| - "cell_type": "code", |
41 |
| - "execution_count": 3, |
42 |
| - "id": "cf6cc023-ea39-46eb-885e-86a184dc1850", |
43 | 40 | "metadata": {},
|
44 |
| - "outputs": [ |
45 |
| - { |
46 |
| - "data": { |
47 |
| - "application/vnd.jupyter.widget-view+json": { |
48 |
| - "model_id": "405e31685af24471838cd6587a52f032", |
49 |
| - "version_major": 2, |
50 |
| - "version_minor": 0 |
51 |
| - }, |
52 |
| - "text/plain": [ |
53 |
| - "VBox(children=(Dropdown(description='File:', options=('external/argentina-internal.osh.pbf', 'external/argenti…" |
54 |
| - ] |
55 |
| - }, |
56 |
| - "execution_count": 3, |
57 |
| - "metadata": {}, |
58 |
| - "output_type": "execute_result" |
59 |
| - } |
60 |
| - ], |
| 41 | + "cell_type": "code", |
| 42 | + "outputs": [], |
| 43 | + "execution_count": null, |
61 | 44 | "source": [
|
62 | 45 | "import ipywidgets as widgets\n",
|
63 | 46 | "import glob\n",
|
|
76 | 59 | "bbox = widgets.Text(\n",
|
77 | 60 | " placeholder='-61.975228,-33.749067,-61.953167,-33.733014',\n",
|
78 | 61 | " description='BBox:',\n",
|
79 |
| - " disabled=False \n", |
| 62 | + " disabled=False\n", |
80 | 63 | ")\n",
|
81 | 64 | "\n",
|
82 | 65 | "\n",
|
|
100 | 83 | " disabled=False,\n",
|
101 | 84 | ")\n",
|
102 | 85 | "\n",
|
103 |
| - "\n", |
| 86 | + "num_frames = widgets.BoundedIntText(\n", |
| 87 | + " min=2,\n", |
| 88 | + " step=1,\n", |
| 89 | + " value=2,\n", |
| 90 | + " description='Number of frames:',\n", |
| 91 | + " disabled=False\n", |
| 92 | + ")\n", |
104 | 93 | "\n",
|
105 | 94 | "widgets.VBox([\n",
|
106 | 95 | " filename,\n",
|
|
110 | 99 | " end_date,\n",
|
111 | 100 | " date_label,\n",
|
112 | 101 | " min_zoom_level,\n",
|
113 |
| - " max_zoom_level])" |
114 |
| - ] |
| 102 | + " max_zoom_level,\n", |
| 103 | + " num_frames,\n", |
| 104 | + "])" |
| 105 | + ], |
| 106 | + "id": "1b57c91aa6a007a6" |
115 | 107 | },
|
116 | 108 | {
|
117 | 109 | "cell_type": "markdown",
|
118 | 110 | "id": "0fa54f42-e3f7-428b-b604-9450f4c659d7",
|
119 | 111 | "metadata": {},
|
120 | 112 | "source": [
|
121 |
| - "Once you have set your parameters, you can run the cell below in the same way that you ran the cell above for creating the forms. \n", |
| 113 | + "Once you have set your parameters, you can run the cell below in the same way that you ran the cell above for creating the forms.\n", |
122 | 114 | "\n",
|
123 |
| - "Running the cell below will take a while, in particular if it's the first time you execute it, as it needs to download some external resources first. Subsequent runs will be faster. You can re-run it as many times as you want, and change any of the parameters using the forms above. \n", |
| 115 | + "Running the cell below will take a while, in particular if it's the first time you execute it, as it needs to download some external resources first. Subsequent runs will be faster. You can re-run it as many times as you want, and change any of the parameters using the forms above.\n", |
124 | 116 | "\n",
|
125 |
| - "Once you run the cell below, it will print a lot of output into this notebook, including some warnings. If everything works, the last things printed out will read *Generating comparison image for zoom XXX*, according to the zoom levels you picked. \n", |
| 117 | + "Once you run the cell below, it will print a lot of output into this notebook, including some warnings. If everything works, the last things printed out will read *Generating comparison image for zoom XXX*, according to the zoom levels you picked.\n", |
126 | 118 | "\n",
|
127 | 119 | "The resulting images will be saved as \"progress.filename.*parameters*.png/gif."
|
128 | 120 | ]
|
|
160 | 152 | "}\n",
|
161 | 153 | "\n",
|
162 | 154 | "\n",
|
163 |
| - "\u001b[K\u001b[?25h \u001b[27m] | reify:lodash: \u001b[32;40mhttp\u001b[0m \u001b[35mfetch\u001b[0m GET 200 https://registry.npmjs.\u001b[0m\u001b[K.o\u001b[0m\u001b[K\n", |
| 155 | + "\u001B[K\u001B[?25h \u001B[27m] | reify:lodash: \u001B[32;40mhttp\u001B[0m \u001B[35mfetch\u001B[0m GET 200 https://registry.npmjs.\u001B[0m\u001B[K.o\u001B[0m\u001B[K\n", |
164 | 156 | "added 64 packages, and audited 65 packages in 5s\n",
|
165 | 157 | "\n",
|
166 | 158 | "1 package is looking for funding\n",
|
167 | 159 | " run `npm fund` for details\n",
|
168 | 160 | "\n",
|
169 |
| - "\u001b[31m\u001b[1m5\u001b[22m\u001b[39m vulnerabilities (2 \u001b[33m\u001b[1mmoderate\u001b[22m\u001b[39m, 3 \u001b[31m\u001b[1mhigh\u001b[22m\u001b[39m)\n", |
| 161 | + "\u001B[31m\u001B[1m5\u001B[22m\u001B[39m vulnerabilities (2 \u001B[33m\u001B[1mmoderate\u001B[22m\u001B[39m, 3 \u001B[31m\u001B[1mhigh\u001B[22m\u001B[39m)\n", |
170 | 162 | "\n",
|
171 | 163 | "To address all issues, run:\n",
|
172 | 164 | " npm audit fix\n",
|
|
1562 | 1554 | ]
|
1563 | 1555 | }
|
1564 | 1556 | ],
|
1565 |
| - "source": [ |
1566 |
| - "!./make.sh {filename.value} {start_date.value.isoformat()}Z {end_date.value.isoformat()}Z {bbox.value} {min_zoom_level.value} {max_zoom_level.value}" |
1567 |
| - ] |
| 1557 | + "source": "!./make.sh {filename.value} {start_date.value.isoformat()}Z {end_date.value.isoformat()}Z {bbox.value} {min_zoom_level.value} {max_zoom_level.value} {num_frames.value}" |
1568 | 1558 | },
|
1569 | 1559 | {
|
1570 | 1560 | "cell_type": "markdown",
|
|
1573 | 1563 | "source": [
|
1574 | 1564 | "Enjoy mapping and visualizing!\n",
|
1575 | 1565 | "\n",
|
1576 |
| - "If this all worked you should be able to see the output files in the filebrowser/file tree, named `progress.filename.parameters.png/gif.`. \n", |
| 1566 | + "If this all worked you should be able to see the output files in the filebrowser/file tree, named `progress.filename.parameters.png/gif.`.\n", |
1577 | 1567 | "\n",
|
1578 | 1568 | "If you are running this in the MyBinder, you should download them to your computer to keep them permanently.\n",
|
1579 | 1569 | "\n",
|
1580 |
| - "If you are running this locally, you can do this as well or alternatively move them into the shared \"output\" folder that is accessible from your host computer. \n", |
1581 |
| - "\n" |
| 1570 | + "If you are running this locally, you can do this as well or alternatively move them into the shared \"output\" folder that is accessible from your host computer." |
1582 | 1571 | ]
|
1583 | 1572 | }
|
1584 | 1573 | ],
|
|
0 commit comments