Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 2856
1 vote
Accepted

Editing shapefile Item Description > Summary in ArcPy?

Then, the updated XML document must be saved back to the original ArcGIS item as its metadata using the Metadata Importer tool. … There is a 3rd party python library that automates this - Arcpy Metadata Editor (arcpy_metadata) Note if using ArcGIS Desktop, these metadata tools are only available in 32bit Python (i.e. not the 64bit …
user2856's user avatar
  • 69.6k
2 votes
Accepted

Figuring out aduisition dates of images from file names using Earthexplorer

The date in your example is a day of year (or julian day). The 2021.238-248 means the 238th to the 248th day of 2021 and can be converted to dd/mm/yyyy using a number of online lookups or converters. …
user2856's user avatar
  • 69.6k
5 votes
Accepted

How to read/write ENVI metadata using GDAL?

"Starting with GDAL 1.10..." "I am using the Python bindings with GDAL 1.9.2..." GDAL 1.10 hasn't been released yet. Beta 1 was released a short while ago or if you're using Windows, you can grab a …
user2856's user avatar
  • 69.6k
5 votes
Accepted

Setting metadata options for ouput GeoTIFF when using gdalwarp?

-tr 15 15 -r bilinear \ -wm 4096 -multi \ -co NUM_THREADS=ALL_CPUS \ -srcnodata "-32767" \ mosaic_dem_cded_4269.vrt dem_3005.vrt gdal_translate -mo "your metadata
user2856's user avatar
  • 69.6k
4 votes

Writing ISO 19139 compliant XML metadata from spreadsheet?

Here's some example code: from lxml import etree import os.path def list_to_xml(datalist,rootname): '''Transform a metadata record to a flat XML string''' root = etree.Element(rootname) …
user2856's user avatar
  • 69.6k
1 vote

Editing raster band metadata using GDAL?

Use gdal_edit.py -unsetstats your_raster_file arg to remove existing stats, then gdalinfo -stats your_raster_file to recalculate them. https://www.gdal.org/gdal_edit.html https://www.gdal.org/gdalin …
user2856's user avatar
  • 69.6k
3 votes
Accepted

Applying equation to a Numpy array while preserving TIFF metadata (coordinates)

You open and read the input raster as a numpy array, run your calculation, open the output raster in 'w' write mode and use the georeferencing and other metadata (aka the profile) from the input raster … with rio.open('BIOout.tif', 'w', **profile) as dst: # open raster dataset in 'w' write mode using the dst.write(bio) # georeferencing and other metadata from ndvi.tif …
user2856's user avatar
  • 69.6k
1 vote
Accepted

Updating metadata in geodatabase using fiona

fiona dataset .meta and .profile attributes are data source properties (e.g. driver, schema, crs) not content metadata. Dataset tags can be used for this purpose. …
user2856's user avatar
  • 69.6k
1 vote
Accepted

Change raster `nodata` to nan on python

Open the dataset in append mode "r+" and then set dataset.nodata (source): with rio.open(src_filename, "r+") as src: src.nodata = np.nan For example: import numpy as np import rasterio as rio …
user2856's user avatar
  • 69.6k
17 votes
Accepted

How to edit the metadata for individual bands of a multiband raster, preferably with GDAL?

You can use a simple python script that uses the Band.SetDescription method to set the band names: """ Set Band descriptions Usage: python set_band_desc.py /path/to/file.ext band desc [band desc. …
user2856's user avatar
  • 69.6k
22 votes
Accepted

Rasterio: Use case for src.meta vs. src.profile when reading and writing rasters?

The meta property contains the basic raster metadata: driver, dtype, nodata, width, height, count, crs, transform The profile property is a super set of meta which includes dataset creation options: meta …
user2856's user avatar
  • 69.6k
10 votes

Add bands' name and description to the Metadata when stacking using rasterio

If using rasterio >= 1.0, use the dataset.set_band_description(self, bidx, value) method and dataset.descriptions property. Sets the description of a dataset band. Parameters ---------- bidx : int …
user2856's user avatar
  • 69.6k