Skip to main content
deleted 30 characters in body; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How to acquire Acquiring data point coordinates from Geotiff and converting to numpy array?

I would like to use scipy.interpolate.griddata to interpolate my Sentinel-1 products (see two sample images below) taken from different orbits resulting in having the uniform datapoint coordinates.

I would like to use a similar approach as describesdescribe in link below:

Smoothing/interpolating raster in Python using GDAL?

However, I am not able to figure it how to get points at which to interpolate data from a geotiff. So far, I have this for values and for basic geographic description:

from osgeo import gdal
# Loading terrain corrected image
master = gdal.Open("S1A_TC.tif")
# Data values of master image
master_array = master.ReadAsArray()
# Getting geographic data (e.g. pixelSizeX)    
gt = master.GetGeoTransform()

For getting array of data point coordinates or points at which to interpolate data, I found this topic: https://stackoverflow.com/questions/43370069/converting-xy-co-ords-of-geotiff-to-numpy-array-positions-in-python

The GDAL link is dead and I am not able to found something useful. 

How can I read the data point coordinates as np.array?

Many thanks!

enter image description here

enter image description here

How to acquire data point coordinates from Geotiff and converting to numpy array?

I would like to use scipy.interpolate.griddata to interpolate my Sentinel-1 products (see two sample images below) taken from different orbits resulting in having the uniform datapoint coordinates.

I would like to use a similar approach as describes in link below:

Smoothing/interpolating raster in Python using GDAL?

However, I am not able to figure it how to get points at which to interpolate data from a geotiff. So far, I have this for values and for basic geographic description:

from osgeo import gdal
# Loading terrain corrected image
master = gdal.Open("S1A_TC.tif")
# Data values of master image
master_array = master.ReadAsArray()
# Getting geographic data (e.g. pixelSizeX)    
gt = master.GetGeoTransform()

For getting array of data point coordinates or points at which to interpolate data, I found this topic: https://stackoverflow.com/questions/43370069/converting-xy-co-ords-of-geotiff-to-numpy-array-positions-in-python

The GDAL link is dead and I am not able to found something useful. How can I read the data point coordinates as np.array?

Many thanks!

enter image description here

enter image description here

Acquiring data point coordinates from Geotiff and converting to numpy array

I would like to use scipy.interpolate.griddata to interpolate my Sentinel-1 products (see two sample images below) taken from different orbits resulting in having the uniform datapoint coordinates.

I would like to use a similar approach as describe in Smoothing/interpolating raster in Python using GDAL?

However, I am not able to figure it how to get points at which to interpolate data from a geotiff. So far, I have this for values and for basic geographic description:

from osgeo import gdal
# Loading terrain corrected image
master = gdal.Open("S1A_TC.tif")
# Data values of master image
master_array = master.ReadAsArray()
# Getting geographic data (e.g. pixelSizeX)    
gt = master.GetGeoTransform()

For getting array of data point coordinates or points at which to interpolate data, I found this topic: https://stackoverflow.com/questions/43370069/converting-xy-co-ords-of-geotiff-to-numpy-array-positions-in-python

The GDAL link is dead and I am not able to found something useful. 

How can I read the data point coordinates as np.array?

enter image description here

enter image description here

Off topic text
Source Link
Luckasino
  • 293
  • 2
  • 8

I would like to use scipy.interpolate.griddata to interpolate my Sentinel-1 products (see two sample images below) taken from different orbits resulting in having the uniform datapoint coordinates.

I would like to use a similar approach as describes in link below:   

Smoothing/interpolating raster in Python using GDAL?

I was testing successfully the scipy.interpolate.griddata on the sample arrays howeverHowever, I am not able to figure it how to get points at which to interpolate data from a geotiff.

  So far, I have this for values and for basic geographic description:

from osgeo import gdal
# Loading terrain corrected image
master = gdal.Open("S1A_TC.tif")
# Data values of master image
master_array = master.ReadAsArray()
# Getting geographic data (e.g. pixelSizeX)    
gt = master.GetGeoTransform()

For getting array of data point coordinates or points at which to interpolate data, I found this topic: https://stackoverflow.com/questions/43370069/converting-xy-co-ords-of-geotiff-to-numpy-array-positions-in-python

However, theThe GDAL link is dead and I am not able to found something useful. How can I read the data point coordinates as np.array?

Many thanks!

enter image description here

enter image description here

I would like to use scipy.interpolate.griddata to interpolate my Sentinel-1 products (see two sample images below) taken from different orbits resulting in having the uniform datapoint coordinates.

I would like to use a similar approach as describes in link below:  Smoothing/interpolating raster in Python using GDAL?

I was testing successfully the scipy.interpolate.griddata on the sample arrays however, I am not able to figure it how to get points at which to interpolate data from a geotiff.

  So far, I have this for values:

from osgeo import gdal
# Loading terrain corrected image
master = gdal.Open("S1A_TC.tif")
# Data values of master image
master_array = master.ReadAsArray()
# Getting geographic data (e.g. pixelSizeX)    
gt = master.GetGeoTransform()

For getting array of data point coordinates or points at which to interpolate data, I found this topic: https://stackoverflow.com/questions/43370069/converting-xy-co-ords-of-geotiff-to-numpy-array-positions-in-python

However, the GDAL link is dead and I am not able to found something useful. How can I read the data point coordinates as np.array?

Many thanks!

enter image description here

enter image description here

I would like to use scipy.interpolate.griddata to interpolate my Sentinel-1 products (see two sample images below) taken from different orbits resulting in having the uniform datapoint coordinates.

I would like to use a similar approach as describes in link below: 

Smoothing/interpolating raster in Python using GDAL?

However, I am not able to figure it how to get points at which to interpolate data from a geotiff. So far, I have this for values and for basic geographic description:

from osgeo import gdal
# Loading terrain corrected image
master = gdal.Open("S1A_TC.tif")
# Data values of master image
master_array = master.ReadAsArray()
# Getting geographic data (e.g. pixelSizeX)    
gt = master.GetGeoTransform()

For getting array of data point coordinates or points at which to interpolate data, I found this topic: https://stackoverflow.com/questions/43370069/converting-xy-co-ords-of-geotiff-to-numpy-array-positions-in-python

The GDAL link is dead and I am not able to found something useful. How can I read the data point coordinates as np.array?

Many thanks!

enter image description here

enter image description here

Source Link
Luckasino
  • 293
  • 2
  • 8

How to acquire data point coordinates from Geotiff and converting to numpy array?

I would like to use scipy.interpolate.griddata to interpolate my Sentinel-1 products (see two sample images below) taken from different orbits resulting in having the uniform datapoint coordinates.

I would like to use a similar approach as describes in link below: Smoothing/interpolating raster in Python using GDAL?

I was testing successfully the scipy.interpolate.griddata on the sample arrays however, I am not able to figure it how to get points at which to interpolate data from a geotiff.

So far, I have this for values:

from osgeo import gdal
# Loading terrain corrected image
master = gdal.Open("S1A_TC.tif")
# Data values of master image
master_array = master.ReadAsArray()
# Getting geographic data (e.g. pixelSizeX)    
gt = master.GetGeoTransform()

For getting array of data point coordinates or points at which to interpolate data, I found this topic: https://stackoverflow.com/questions/43370069/converting-xy-co-ords-of-geotiff-to-numpy-array-positions-in-python

However, the GDAL link is dead and I am not able to found something useful. How can I read the data point coordinates as np.array?

Many thanks!

enter image description here

enter image description here