GeoscienceAustralia / PyRate

A Python tool for estimating velocity and time-series from Interferometric Synthetic Aperture Radar (InSAR) data.
https://geoscienceaustralia.github.io/PyRate/
Apache License 2.0
199 stars 69 forks source link

Add metadata to output files #369

Closed adeane-ga closed 2 years ago

adeane-ga commented 2 years ago

This is a small PR that adds some simple metadata to the output files in the velocity directory.

Specifically Here are the three changes and their associated GitHub issues:

  1. Add latitude and longitude coordinates of reference pixel to the output GeoTIFFs in velocity_dir (https://github.com/GeoscienceAustralia/PyRate/issues/358).

  2. Add median azimuth of the LOS vector to the output GeoTIFFS in velocity_dir (https://github.com/GeoscienceAustralia/PyRate/issues/359).

  3. Just a small correction to an error message which was stating the wrong condition (https://github.com/GeoscienceAustralia/PyRate/issues/362)

Recommended Review Strategy In addition to checking that none of these break your processing workflow, here are some things to check regarding the above points.

  1. Confirm that the reference pixel coordinates are in the output GeoTIFF metadata at the end of processing.
  2. At the end of processing, check that the median azimuth is in the output GeoTIFF metadata, or that NOT COMPUTED is there in the case that the geometry files are not created.
  3. Just read over the code and confirm if the conditional logic is correct.
s-m-t-c commented 2 years ago

I have tested this and it generates the correct metadata when inspected via gdalinfo however I noticed that the azimuth metadata doesn't appear when inspecting the velocity outputs in QGIS. Let's look into this before we merge.

adeane-ga commented 2 years ago

GeoTIFF metadata that is viewable with gdalinfo in Linux, is still not viewable with QGIS GUI interface right click on raster layer => properties => information.

Here is one thread which looks like a similar problem, but I still can't determine the issue from it: https://gis.stackexchange.com/questions/214247/set-raster-metadata-in-gdal-and-view-in-gis-software

This is yet to be resolved, so I guess we could keep this PR open until we figure it is resolved, or we could merge and then list the metadata discrepancy in the issues page so we can come back to it.

Not sure of the best action. I'm happy to keep looking into when I get time, but if anyone has ideas, let me know :).

adeane-ga commented 2 years ago

One thought:

is there a difference between using SetMetadata() compared to gdal_edit()?

adu461386118 commented 2 years ago

I confirm I can see the reference pixel coordinates within the metadata of output files in velocity directory, also, I think both SetMetadata() and gdal_edit() can do pretty much the same thing, that is to set/edit various information of an existing GDAL dataset, don't really know the difference between them,

s-m-t-c commented 2 years ago

I'm going to merge this and document the qgis issue.