I downloaded the terrain data from the site (example https://drive.google.com/file/d/1OiFy-vLq9CvVeqNg9VogmxSPOMcpcD1W/view?usp=sharing ) and got the data. Specifically interested in the format *_DCM.tif, which, as I understand it, stores data on point - longitude, latitude and altitude.
With gdal I can convert a file to .XYZ file and take the data, but the file size becomes too large.
In this regard, 2 questions:
- Is it possible to parse the tif file somehow and get this data?
- Is it possible to convert programmatically .tif in .XYZ and work with the received data?
Which libraries have I already reviewed:
https://github.com/chai2010/tiff/tree/master/examples
https://github.com/lukeroth/gdal/blob/master/examples/tiff/tiff.go
https://github.com/airbusgeo/godal/blob/main/doc_test.go
https://pkg.go.dev/github.com/rwcarlsen/goexif/exif
https://pkg.go.dev/github.com/evanoberholster/imagemeta
UPDATE:
I found the gdallocationinfo method. For example, I have converted all tiff files to VRT and am working with it: gdallocationinfo -xml -wgs84 dsm-mosaic.vrt 28.000139 50.999861
I need "Value" - altitude
But I couldn't find an implementation on Golang in any way. I also tried to rewrite the code in Python, but without success.
I was told that calling a console command from code is a bad idea.
If anyone knows how to get information on latitude and longitude, then I will be gdal :)