Geographic Information Systems Asked by Carlos Eduardo Carvalho on April 7, 2021
I have bathymetry data for a river in numpy array format. Unfortunately, I do not have the coordinates for each value of this array, but only the central line where the boat passed (x2). I decided to draw a maximum line 100 meters after the boat’s path (x1).
To georeference those I used xmin, ymin, xmax, ymax. Here is a part of the Python script
xmin,ymin,xmax,ymax = [track.coords[-1][0],track.coords[-1][1],up.coords[0][0],up.coords[0][1]]
xres = (xmax-xmin)/float(ncols)
yres = (ymax-ymin)/float(nrows)
geotransform=(xmin,xres,0,ymax,0, -yres)
output_raster = gdal.GetDriverByName('GTiff').Create('/content/myraster.tif',ncols, nrows, 1 ,gdal.GDT_Float32) # Open the file
output_raster.SetGeoTransform(geotransform) # Specify its coordinates
srs = osr.SpatialReference() # Establish its coordinate encoding
srs.ImportFromEPSG(4326) # This one specifies WGS84 lat long.
output_raster.SetProjection( srs.ExportToWkt() ) # Exports the coordinate system
output_raster.GetRasterBand(1).WriteArray(np_chan1) # Writes my array to the raster
output_raster.FlushCache()
With that I managed to geo-reference, but the river curve was ignored. Would like to know how to do to consider this curve of the boat.
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP