|
152 | 152 | "source": [ |
153 | 153 | "Planet's products are categorized as **items** and **assets**: an item is a single picture taken by a satellite at a certain time. Items have multiple asset types including the image in different formats, along with supporting metadata files.\n", |
154 | 154 | "\n", |
155 | | - "For this demonstration, let's get a satellite image that is best suited for visual applications; e.g., basemaps or visual analysis. Since we're not doing any spectral analysis outside of the visual range, we only need a 3-band (RGB) image. To get the image we want, we will specify an item type of `PSScene3Band`, and asset type `visual`.\n", |
| 155 | + "For this demonstration, let's get a satellite image that is best suited for analytic applications; i.e., a 4-band image with spectral data for Red, Green, Blue and Near-infrared values. To get the image we want, we will specify an item type of `PSScene4Band`, and asset type `analytic`.\n", |
156 | 156 | "\n", |
157 | 157 | "You can learn more about item & asset types in Planet's Data API [here](https://planet.com/docs/reference/data-api/items-assets/).\n", |
158 | 158 | "\n", |
|
173 | 173 | "# API Key stored as an env variable\n", |
174 | 174 | "PLANET_API_KEY = os.getenv('PL_API_KEY')\n", |
175 | 175 | "\n", |
176 | | - "item_type = \"PSScene3Band\"\n", |
| 176 | + "item_type = \"PSScene4Band\"\n", |
177 | 177 | "\n", |
178 | 178 | "# API request object\n", |
179 | 179 | "search_request = {\n", |
|
246 | 246 | " \n", |
247 | 247 | "The Data API does not pre-generate assets, so they are not always immediately availiable to download. In order to download an asset, we first have to **activate** it.\n", |
248 | 248 | "\n", |
249 | | - "Remember, earlier we decided we wanted a color-corrected image best suited for *visual* applications. We can check the status of the visual asset we want to download like so:\n", |
| 249 | + "Remember, earlier we decided we wanted a color-corrected image best suited for *analytic* applications. We can check the status of the analytic asset we want to download like so:\n", |
250 | 250 | " " |
251 | 251 | ] |
252 | 252 | }, |
|
256 | 256 | "metadata": {}, |
257 | 257 | "outputs": [], |
258 | 258 | "source": [ |
259 | | - "# This is \"inactive\" if the \"visual\" asset has not yet been activated; otherwise 'active'\n", |
260 | | - "print(result.json()['visual']['status'])" |
| 259 | + "# This is \"inactive\" if the \"analytic\" asset has not yet been activated; otherwise 'active'\n", |
| 260 | + "print(result.json()['analytic']['status'])" |
261 | 261 | ] |
262 | 262 | }, |
263 | 263 | { |
|
274 | 274 | "outputs": [], |
275 | 275 | "source": [ |
276 | 276 | "# Parse out useful links\n", |
277 | | - "links = result.json()[u\"visual\"][\"_links\"]\n", |
| 277 | + "links = result.json()[u\"analytic\"][\"_links\"]\n", |
278 | 278 | "self_link = links[\"_self\"]\n", |
279 | 279 | "activation_link = links[\"activate\"]\n", |
280 | 280 | "\n", |
281 | | - "# Request activation of the 'visual' asset:\n", |
| 281 | + "# Request activation of the 'analytic' asset:\n", |
282 | 282 | "activate_result = \\\n", |
283 | 283 | " requests.get(\n", |
284 | 284 | " activation_link,\n", |
|
0 commit comments