Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
ee.Image.regexpRename
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Rinomina le bande di un'immagine applicando una sostituzione di espressione regolare ai nomi delle bande correnti. Le bande non corrispondenti all'espressione regolare verranno copiate senza essere rinominate.
Utilizzo | Resi |
---|
Image.regexpRename(regex, replacement, all) | Immagine |
Argomento | Tipo | Dettagli |
---|
questo: input | Immagine | L'immagine contenente le bande da rinominare. |
regex | Stringa | Un'espressione regolare per trovare corrispondenze in ogni nome della band. |
replacement | Stringa | Il testo con cui sostituire ogni corrispondenza. Supporta la sintassi $n per i valori acquisiti. |
all | Booleano, valore predefinito: true | Se il valore è true, tutte le corrispondenze in una determinata stringa verranno sostituite. In caso contrario, verrà sostituita solo la prima corrispondenza in ogni stringa. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003eApplies a regular expression to rename image bands, leaving unmatched bands unchanged.\u003c/p\u003e\n"],["\u003cp\u003eOffers flexibility to replace all regex matches or only the first match in each band name using the \u003ccode\u003eall\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eUses \u003ccode\u003e$n\u003c/code\u003e syntax in the 'replacement' argument to utilize captured values from the regex.\u003c/p\u003e\n"],["\u003cp\u003eOperates directly on the provided input image and returns a modified image with the renamed bands.\u003c/p\u003e\n"]]],["This functionality renames image bands using regular expressions. It takes an image, a `regex` to match band names, and a `replacement` string (supporting captured groups via `$n`). Bands not matching the `regex` remain unchanged. An optional `all` parameter (defaulting to `true`) determines whether to replace all regex matches or just the first one per band name. The function returns a new image with the updated band names.\n"],null,["# ee.Image.regexpRename\n\nRenames the bands of an image by applying a regular expression replacement to the current band names. Any bands not matched by the regex will be copied over without renaming.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------|---------|\n| Image.regexpRename`(regex, replacement, `*all*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|------------------------|---------------------------------------------------------------------------------------------------------------------------|\n| this: `input` | Image | The image containing the bands to rename. |\n| `regex` | String | A regular expression to match in each band name. |\n| `replacement` | String | The text with which to replace each match. Supports $n syntax for captured values. |\n| `all` | Boolean, default: true | If true, all matches in a given string will be replaced. Otherwise, only the first match in each string will be replaced. |"]]