-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
folium to geemap in guide pages and notebooks
PiperOrigin-RevId: 568655626
- Loading branch information
1 parent
47c96bf
commit ed071b8
Showing
33 changed files
with
907 additions
and
871 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,134 +1,148 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#@title Copyright 2021 The Earth Engine Community Authors { display-mode: \"form\" }\n", | ||
"#\n", | ||
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n", | ||
"# you may not use this file except in compliance with the License.\n", | ||
"# You may obtain a copy of the License at\n", | ||
"#\n", | ||
"# https://www.apache.org/licenses/LICENSE-2.0\n", | ||
"#\n", | ||
"# Unless required by applicable law or agreed to in writing, software\n", | ||
"# distributed under the License is distributed on an \"AS IS\" BASIS,\n", | ||
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", | ||
"# See the License for the specific language governing permissions and\n", | ||
"# limitations under the License." | ||
] | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#@title Copyright 2021 The Earth Engine Community Authors { display-mode: \"form\" }\n", | ||
"#\n", | ||
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n", | ||
"# you may not use this file except in compliance with the License.\n", | ||
"# You may obtain a copy of the License at\n", | ||
"#\n", | ||
"# https://www.apache.org/licenses/LICENSE-2.0\n", | ||
"#\n", | ||
"# Unless required by applicable law or agreed to in writing, software\n", | ||
"# distributed under the License is distributed on an \"AS IS\" BASIS,\n", | ||
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", | ||
"# See the License for the specific language governing permissions and\n", | ||
"# limitations under the License." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Image Information and Metadata\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Print image objects to explore band names, projection information, properties, and other metadata. The following examples demonstrate printing the entire set of image metadata as well as requesting specific metadata elements programmatically." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Setup" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Earth Engine setup" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import ee\n", | ||
"ee.Authenticate()\n", | ||
"ee.Initialize()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Import `geemap`" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import geemap" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Getting metadata" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Load an image.\n", | ||
"image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318')\n", | ||
"\n", | ||
"# All metadata.\n", | ||
"display('All metadata:', image)\n", | ||
"\n", | ||
"# Get information about the bands as a list.\n", | ||
"band_names = image.bandNames()\n", | ||
"display('Band names:', band_names) # ee.List of band names\n", | ||
"\n", | ||
"# Get projection information from band 1.\n", | ||
"b1_proj = image.select('B1').projection()\n", | ||
"display('Band 1 projection:', b1_proj) # ee.Projection object\n", | ||
"\n", | ||
"# Get scale (in meters) information from band 1.\n", | ||
"b1_scale = image.select('B1').projection().nominalScale()\n", | ||
"display('Band 1 scale:', b1_scale) # ee.Number\n", | ||
"\n", | ||
"# Note that different bands can have different projections and scale.\n", | ||
"b8_scale = image.select('B8').projection().nominalScale()\n", | ||
"display('Band 8 scale:', b8_scale) # ee.Number\n", | ||
"\n", | ||
"# Get a list of all metadata properties.\n", | ||
"properties = image.propertyNames()\n", | ||
"display('Metadata properties:', properties) # ee.List of metadata properties\n", | ||
"\n", | ||
"# Get a specific metadata property.\n", | ||
"cloudiness = image.get('CLOUD_COVER')\n", | ||
"display('CLOUD_COVER:', cloudiness) # ee.Number\n", | ||
"\n", | ||
"# Get version number (ingestion timestamp as microseconds since Unix epoch).\n", | ||
"version = image.get('system:version')\n", | ||
"display('Version:', version) # ee.Number\n", | ||
"display(\n", | ||
" 'Version (as ingestion date):',\n", | ||
" ee.Date(ee.Number(version).divide(1000)).format(),\n", | ||
") # ee.Date\n", | ||
"\n", | ||
"# Get the timestamp.\n", | ||
"ee_date = ee.Date(image.get('system:time_start'))\n", | ||
"display('Timestamp:', ee_date) # ee.Date\n", | ||
"\n", | ||
"# Date objects transferred to the client are milliseconds since UNIX epoch;\n", | ||
"# convert to human readable date with ee.Date.format().\n", | ||
"display('Datetime:', ee_date.format()) # ISO standard date string" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"colab": { | ||
"name": "Image Information and Metadata" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Image Information and Metadata\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Print image objects to explore band names, projection information, properties, and other metadata. The following examples demonstrate printing the entire set of image metadata as well as requesting specific metadata elements programmatically." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Setup" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Earth Engine setup" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import ee\n", | ||
"ee.Authenticate()\n", | ||
"ee.Initialize()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Getting metadata" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pprint\n", | ||
"\n", | ||
"# Load an image.\n", | ||
"image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318')\n", | ||
"\n", | ||
"# All metadata.\n", | ||
"print('All metadata:')\n", | ||
"pprint.pprint(image.getInfo())\n", | ||
"\n", | ||
"# Get information about the bands as a list.\n", | ||
"band_names = image.bandNames()\n", | ||
"print('Band names:', band_names.getInfo()) # ee.List of band names\n", | ||
"\n", | ||
"# Get projection information from band 1.\n", | ||
"b1_proj = image.select('B1').projection()\n", | ||
"print('Band 1 projection:', b1_proj.getInfo()) # ee.Projection object\n", | ||
"\n", | ||
"# Get scale (in meters) information from band 1.\n", | ||
"b1_scale = image.select('B1').projection().nominalScale()\n", | ||
"print('Band 1 scale:', b1_scale.getInfo()) # ee.Number\n", | ||
"\n", | ||
"# Note that different bands can have different projections and scale.\n", | ||
"b8_scale = image.select('B8').projection().nominalScale()\n", | ||
"print('Band 8 scale:', b8_scale.getInfo()) # ee.Number\n", | ||
"\n", | ||
"# Get a list of all metadata properties.\n", | ||
"properties = image.propertyNames()\n", | ||
"print('Metadata properties:',\n", | ||
" properties.getInfo()) # ee.List of metadata properties\n", | ||
"\n", | ||
"# Get a specific metadata property.\n", | ||
"cloudiness = image.get('CLOUD_COVER')\n", | ||
"print('CLOUD_COVER:', cloudiness.getInfo()) # ee.Number\n", | ||
"\n", | ||
"# Get version number (ingestion timestamp as microseconds since Unix epoch).\n", | ||
"version = image.get('system:version')\n", | ||
"print('Version:', version.getInfo()) # ee.Number\n", | ||
"print('Version (as ingestion date):',\n", | ||
" ee.Date(ee.Number(version).divide(1000)).format().getInfo()) # ee.Date\n", | ||
"\n", | ||
"# Get the timestamp.\n", | ||
"ee_date = ee.Date(image.get('system:time_start'))\n", | ||
"print('Timestamp:', ee_date.getInfo()) # ee.Date\n", | ||
"\n", | ||
"# Date objects transferred to the client are milliseconds since UNIX epoch;\n", | ||
"# convert to human readable date with ee.Date.format().\n", | ||
"print('Datetime:', ee_date.format().getInfo()) # ISO standard date string" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"colab": { | ||
"name": "Image Information and Metadata" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.