Earth Engine ha introdotto
livelli di quota non commerciali per salvaguardare le risorse di calcolo condivise e garantire prestazioni affidabili per tutti. I progetti non commerciali utilizzano il livello Community per impostazione predefinita, anche se puoi modificare il livello di un progetto in qualsiasi momento.
Google utilizza la tecnologia AI per tradurre i contenuti nella tua lingua preferita. Le traduzioni generate dall'AI potrebbero contenere errori.
ee.Geometry
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Crea una geometria.
| Utilizzo | Resi |
|---|
ee.Geometry(geoJson, proj, geodesic, evenOdd) | Geometria |
| Argomento | Tipo | Dettagli |
|---|
geoJson | Oggetto | L'oggetto GeoJSON che descrive la geometria o un ComputedObject da reinterpretare come geometria. Supporta le specifiche CRS in base alla specifica GeoJSON, ma consente solo CRS denominati
(anziché CRS "collegati"). Se include un campo "geodetico" e opt_geodesic non è specificato, verrà utilizzato come opt_geodesic. |
proj | Proiezione, facoltativa | Una specifica di proiezione facoltativa, come codice ID CRS o come stringa WKT. Se specificato, esegue l'override di qualsiasi CRS trovato nel parametro geoJson. Se non specificato e il file GeoJSON non dichiara un CRS, il valore predefinito è "EPSG:4326" (x=longitudine, y=latitudine). |
geodesic | Booleano, facoltativo | Indica se i segmenti di linea devono essere interpretati come geodetiche sferiche. Se è false, indica che i segmenti di linea devono essere interpretati come linee planari nel sistema di riferimento specificato. Se assente, il valore predefinito è true se il CRS è geografico (incluso EPSG:4326 predefinito) o false se il CRS è proiettato. |
evenOdd | Booleano, facoltativo | Se true, gli interni del poligono saranno determinati dalla regola pari/dispari, in base alla quale un punto si trova all'interno se attraversa un numero dispari di bordi per raggiungere un punto all'infinito. In caso contrario, i poligoni utilizzano la regola sinistra-interna, in cui gli interni si trovano sul lato sinistro dei bordi della shell quando si percorrono i vertici nell'ordine specificato. Se non specificato, il valore predefinito è true. |
Esempi
Editor di codice (JavaScript)
// A GeoJSON object for a triangular polygon.
var geojsonObject = {
"type": "Polygon",
"coordinates": [
[
[
-122.085,
37.423
],
[
-122.092,
37.424
],
[
-122.085,
37.418
],
[
-122.085,
37.423
]
]
]
};
print('ee.Geometry accepts a GeoJSON object', ee.Geometry(geojsonObject));
// GeoJSON strings need to be converted to an object.
var geojsonString = JSON.stringify(geojsonObject);
print('A GeoJSON string needs to be converted to an object',
ee.Geometry(JSON.parse(geojsonString)));
// Use ee.Geometry to cast computed geometry objects into the ee.Geometry
// class to access their methods. In the following example an ee.Geometry
// object is stored as a ee.Feature property. When it is retrieved with the
// .get() function, a computed geometry object is returned. Cast the computed
// object as a ee.Geometry to get the geometry's bounds, for instance.
var feature = ee.Feature(null, {geom: ee.Geometry(geojsonObject)});
print('Cast computed geometry objects to ee.Geometry class',
ee.Geometry(feature.get('geom')).bounds());
Configurazione di Python
Consulta la pagina
Ambiente Python per informazioni sull'API Python e sull'utilizzo di
geemap per lo sviluppo interattivo.
import ee
import geemap.core as geemap
Colab (Python)
import json
# A GeoJSON object for a triangular polygon.
geojson_object = {
'type': 'Polygon',
'coordinates': [
[
[
-122.085,
37.423
],
[
-122.092,
37.424
],
[
-122.085,
37.418
],
[
-122.085,
37.423
]
]
]
}
display(
'ee.Geometry accepts a GeoJSON object:',
ee.Geometry(geojson_object)
)
# GeoJSON strings need to be converted to an object.
geojson_string = json.dumps(geojson_object)
display('A GeoJSON string needs to be converted to an object:',
ee.Geometry(json.loads(geojson_string)))
# Use ee.Geometry to cast computed geometry objects into the ee.Geometry
# class to access their methods. In the following example an ee.Geometry
# object is stored as a ee.Feature property. When it is retrieved with the
# .get() function, a computed geometry object is returned. Cast the computed
# object as a ee.Geometry to get the geometry's bounds, for instance.
feature = ee.Feature(None, {'geom': ee.Geometry(geojson_object)})
display('Cast computed geometry objects to ee.Geometry class:',
ee.Geometry(feature.get('geom')).bounds())
[null,null,["Ultimo aggiornamento 2025-10-30 UTC."],[],[]]