|
47 | 47 | "metadata": {}, |
48 | 48 | "outputs": [], |
49 | 49 | "source": [ |
50 | | - "import hypercoast" |
| 50 | + "import hypercoast\n", |
| 51 | + "import geopandas as gpd" |
51 | 52 | ] |
52 | 53 | }, |
53 | 54 | { |
|
67 | 68 | "source": [ |
68 | 69 | "## Display Tanager footprints\n", |
69 | 70 | "\n", |
70 | | - "Use `tanager_footprints()` to collect STAC item footprints as a GeoDataFrame. By default, duplicate scenes that appear in multiple thematic collections are merged and their collection names are preserved in the `collections` and `collection_titles` columns.\n" |
| 71 | + "The [planet-open-data](https://github.com/opengeos/planet-open-data) repository provides GeoJSON files containing the footprints of Tanager products, which are being updated daily. The following code reads the GeoJSON file and visualizes the footprints on a map." |
71 | 72 | ] |
72 | 73 | }, |
73 | 74 | { |
|
77 | 78 | "metadata": {}, |
78 | 79 | "outputs": [], |
79 | 80 | "source": [ |
80 | | - "footprints = hypercoast.tanager_footprints()\n", |
81 | | - "len(footprints), footprints[[\"id\", \"collection_titles\", \"datetime\"]].head()" |
| 81 | + "url = \"https://raw.githubusercontent.com/opengeos/planet-open-data/refs/heads/main/data/planet-tanager-sample-products/footprints.geojson\"\n", |
| 82 | + "gdf = gpd.read_file(url)\n", |
| 83 | + "print(f\"Number of footprints: {len(gdf)}\")" |
82 | 84 | ] |
83 | 85 | }, |
84 | 86 | { |
|
87 | 89 | "id": "8", |
88 | 90 | "metadata": {}, |
89 | 91 | "outputs": [], |
| 92 | + "source": [ |
| 93 | + "gdf.head()" |
| 94 | + ] |
| 95 | + }, |
| 96 | + { |
| 97 | + "cell_type": "code", |
| 98 | + "execution_count": null, |
| 99 | + "id": "9", |
| 100 | + "metadata": {}, |
| 101 | + "outputs": [], |
90 | 102 | "source": [ |
91 | 103 | "m = hypercoast.Map()\n", |
92 | | - "m.add_tanager_footprints(info_mode=\"on_click\")\n", |
| 104 | + "m.add_gdf(gdf, layer_name=\"Tanager Footprints\")\n", |
93 | 105 | "m" |
94 | 106 | ] |
95 | 107 | }, |
96 | 108 | { |
97 | 109 | "cell_type": "markdown", |
98 | | - "id": "9", |
| 110 | + "id": "10", |
99 | 111 | "metadata": {}, |
100 | 112 | "source": [ |
101 | | - "Draw a rectangle on the map. " |
| 113 | + "## Search Tanager STAC items\n", |
| 114 | + "\n", |
| 115 | + "To search Tanager STAC items, draw a rectangle on the map. " |
102 | 116 | ] |
103 | 117 | }, |
104 | 118 | { |
105 | 119 | "cell_type": "code", |
106 | 120 | "execution_count": null, |
107 | | - "id": "10", |
| 121 | + "id": "11", |
108 | 122 | "metadata": {}, |
109 | 123 | "outputs": [], |
110 | 124 | "source": [ |
|
114 | 128 | " bbox = [-123.0, 37.0, -122.0, 38.1]" |
115 | 129 | ] |
116 | 130 | }, |
| 131 | + { |
| 132 | + "cell_type": "markdown", |
| 133 | + "id": "12", |
| 134 | + "metadata": {}, |
| 135 | + "source": [ |
| 136 | + "Search for Tanager data from the [Tanager STAC catalog](https://www.planet.com/data/stac/browser/tanager-core-imagery/catalog.json): " |
| 137 | + ] |
| 138 | + }, |
117 | 139 | { |
118 | 140 | "cell_type": "code", |
119 | 141 | "execution_count": null, |
120 | | - "id": "11", |
| 142 | + "id": "13", |
121 | 143 | "metadata": {}, |
122 | 144 | "outputs": [], |
123 | 145 | "source": [ |
|
132 | 154 | { |
133 | 155 | "cell_type": "code", |
134 | 156 | "execution_count": null, |
135 | | - "id": "12", |
| 157 | + "id": "14", |
136 | 158 | "metadata": {}, |
137 | 159 | "outputs": [], |
138 | 160 | "source": [ |
|
142 | 164 | }, |
143 | 165 | { |
144 | 166 | "cell_type": "markdown", |
145 | | - "id": "13", |
| 167 | + "id": "15", |
146 | 168 | "metadata": {}, |
147 | 169 | "source": [ |
148 | 170 | "## Visualize the ortho visual COG\n", |
|
153 | 175 | { |
154 | 176 | "cell_type": "code", |
155 | 177 | "execution_count": null, |
156 | | - "id": "14", |
| 178 | + "id": "16", |
157 | 179 | "metadata": {}, |
158 | 180 | "outputs": [], |
159 | 181 | "source": [ |
|
164 | 186 | { |
165 | 187 | "cell_type": "code", |
166 | 188 | "execution_count": null, |
167 | | - "id": "15", |
| 189 | + "id": "17", |
168 | 190 | "metadata": {}, |
169 | 191 | "outputs": [], |
170 | 192 | "source": [ |
|
176 | 198 | }, |
177 | 199 | { |
178 | 200 | "cell_type": "markdown", |
179 | | - "id": "16", |
| 201 | + "id": "18", |
180 | 202 | "metadata": {}, |
181 | 203 | "source": [ |
182 | 204 | "## Add a STAC item with spectral signatures\n", |
|
187 | 209 | { |
188 | 210 | "cell_type": "code", |
189 | 211 | "execution_count": null, |
190 | | - "id": "17", |
| 212 | + "id": "19", |
191 | 213 | "metadata": {}, |
192 | 214 | "outputs": [], |
193 | 215 | "source": [ |
|
200 | 222 | }, |
201 | 223 | { |
202 | 224 | "cell_type": "markdown", |
203 | | - "id": "18", |
| 225 | + "id": "20", |
204 | 226 | "metadata": {}, |
205 | 227 | "source": [ |
206 | 228 | "## Download and read the spectral HDF5 asset\n", |
|
211 | 233 | { |
212 | 234 | "cell_type": "code", |
213 | 235 | "execution_count": null, |
214 | | - "id": "19", |
| 236 | + "id": "21", |
215 | 237 | "metadata": {}, |
216 | 238 | "outputs": [], |
217 | 239 | "source": [ |
|
226 | 248 | { |
227 | 249 | "cell_type": "code", |
228 | 250 | "execution_count": null, |
229 | | - "id": "20", |
| 251 | + "id": "22", |
230 | 252 | "metadata": {}, |
231 | 253 | "outputs": [], |
232 | 254 | "source": [ |
|
242 | 264 | ], |
243 | 265 | "metadata": { |
244 | 266 | "kernelspec": { |
245 | | - "display_name": "hyper", |
| 267 | + "display_name": "geo", |
246 | 268 | "language": "python", |
247 | 269 | "name": "python3" |
248 | 270 | }, |
|
256 | 278 | "name": "python", |
257 | 279 | "nbconvert_exporter": "python", |
258 | 280 | "pygments_lexer": "ipython3", |
259 | | - "version": "3.10.14" |
| 281 | + "version": "3.12.12" |
260 | 282 | } |
261 | 283 | }, |
262 | 284 | "nbformat": 4, |
|
0 commit comments