Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sbas.export_geojson() problem #152

Open
georgeboldeanu opened this issue Jul 22, 2024 · 5 comments
Open

Sbas.export_geojson() problem #152

georgeboldeanu opened this issue Jul 22, 2024 · 5 comments

Comments

@georgeboldeanu
Copy link

Hello, @AlexeyPechnikov ! I think that there is a problem with the sbas.export_geojson() function. The results from the function are a little bit odd, from a misalignment point of view. Exporting the same data as a raster with sbas.export_geotiff() and as a vector with sbas.export_geojson() provides 2 shifted outputs (See attachement).
image

The raster is the original result exported sbas.export_geotiff(displacement_ps_mm2[9:10], 'cop_fin_exps/displacement_ps_mm2_') and the vector is exported with sbas.export_geojson(displacement_ps_mm2[9:10],'cop_fin_exps/displacement_ps_mm2_vect_6iunie').
In QGIS i didnt understand why the points from GeoJson were that concentrated, like 2points per pixel. I converted the raster to vector and it seems that there are 2 extra vectors (6 polygons per 4 cells). The red values are the values from the PyGMTSAR and the yellow values are extracted from SAGA GIS, same behaviour, 6 values on 4 cells. The red geometry is the converted raster to vector using basic QGIS functions.
What can cause such a behaviour?

@AlexeyPechnikov
Copy link
Owner

This is a QGIS issue with GeoTIFF files displaying: the shape of the files is distorted, so for example, a 5x5 pixel raster is shown as 4x6. You can resolve the problem by converting the GeoTIFF files to GeoNetCDF and opening them in QGIS without the issue:

gdal_translate disp.2015-03-10.tif disp.2015-03-10.nc

After that, you should see your GeoJSON points at the centers of the raster cells.

image

@georgeboldeanu
Copy link
Author

Yes, after doing gdal_translate the computed points where corectly put on the centroid of the pixels. The problem is that the pixels remain the same. Why is that, is there an asumption or any logic behind it?

@AlexeyPechnikov
Copy link
Owner

What problem?

@georgeboldeanu
Copy link
Author

georgeboldeanu commented Jul 23, 2024

They have the shape from S1 original data, aprox 4x15. They are still in range x azimuth? I export the raster with export_geotiff function. Also, from this there is a very high concentration of points..with some of them being duplicates, like 7.1 on the left side of the screenshot I provided.
image

@AlexeyPechnikov
Copy link
Owner

The results are, of course, exported in geographic coordinates, not radar coordinates. The grid spacing is chosen to be approximately equal to the average radar grid spacing. Note that radar pixels projected onto topography have very different shapes and areas. It is possible to produce the exact shapes of radar pixels in geographic coordinates, although these shapes can be complex. I have shared screenshots on LinkedIn and provided examples in the PyGMTSAR video lectures.

Rather than filtering out neighboring pixels with the same results, PyGMTSAR takes the opposite approach by merging them to produce precise shapes for homogeneously displaced areas.

Screenshot 2024-07-20 at 13 46 44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants