ee.Blob.string

Gibt den Inhalt des Blobs als String zurück.

NutzungAusgabe
Blob.string(encoding)String
ArgumentTypDetails
So gehts: blobBlob
encodingString, Standard: nullDie Zeichencodierung, die beim Decodieren des BLOB verwendet werden soll. Mögliche Optionen sind unter anderem „US-ASCII“, „UTF-8“ und „UTF-16“.

Beispiele

Code-Editor (JavaScript)

// Parse a SpatioTemporal Asset Catalog (STAC) entry from Google Cloud
// Storage (GCS). This is a non-traditional use of ee.Blob.
var url = 'gs://ee-docs-demos/vector/geojson/point.json';
var blob = ee.Blob(url);
var entry = ee.Dictionary(blob.string().decodeJSON());
print(entry);  // Point (1.00, 2.00)...
print(entry.get('a_field'));  // "a demo field"

Python einrichten

Informationen zur Python API und zur Verwendung von geemap für die interaktive Entwicklung finden Sie auf der Seite Python-Umgebung.

import ee
import geemap.core as geemap

Colab (Python)

# Parse a SpatioTemporal Asset Catalog (STAC) entry from Google Cloud
# Storage (GCS). This is a non-traditional use of ee.Blob.
url = 'gs://ee-docs-demos/vector/geojson/point.json'
blob = ee.Blob(url)
entry = ee.Dictionary(blob.string().decodeJSON())
print(entry.getInfo())  # Point (1.00, 2.00)...
print(entry.get('a_field').getInfo())  # "a demo field"