0

I'm working on a program to determine the line of site that a particular point will have using the ALOS data set from JAXA. So far I've managed to download a data set, and am a confused on where to go from here. Here's what I'm trying so far:

  1. I would like to use Python as a tool to calculate the data, because I'm familiar with it already
  2. From my research, gdal seems like an ideal tool.
  3. There are a large number of data files. I beleive I should be looking at the DSM file type, which should give elevation data.
  4. I have been able to calculate statistics for the data, and load the DSM with ArcGIS, which seems to work reasonably well in that tool.
  5. I'm a bit concerned about the edge cases, ALOS data is available in 1 degree blocks, what do I do when I want to see the elevation profile across 2 or even 3 blocks?

I have figured out how I can determine the line of site of a particular point assuming that I can see what the elevation value is at a point, or even better, a line. I'm struggling to figure out how to do this with the data set, and I feel like I'm missing some critical piece. Speed is not a huge concern for me, so long as I can collect the data for each line in a few seconds I should be okay, this can run in the background on my computer for a while.

What am I missing exactly? So far I have the following, but I don't seem to be able to get the data that I want, some piece of this whole thing is missing to me...

from osgeo import gdal
gdal.UseExceptions()

ds = gdal.Open('Japan\\N030E130_AVE_DSM.tif', gdal.GA_ReadOnly)

print(ds.GetMetadata())

print(ds.GetDescription())
print (ds.GetLayer(0))

for band in range(ds.RasterCount):
    band+=1
    srcband = ds.GetRasterBand(band)
    if srcband is None:
        continue

    print(band,srcband.GetStatistics(True,True))

I should add that I'm not fully sold on gdal, if there's a better library to do what I want, I'd take it in a second, so long as I can figure out what I'm trying to do here. Python support is required, however.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.