Skip to content
Snippets Groups Projects
Commit f69d9f57 authored by Clemens Berteld's avatar Clemens Berteld
Browse files

Minor changes

parent ae58b45c
No related branches found
No related tags found
No related merge requests found
...@@ -34,13 +34,10 @@ with psycopg2.connect(database=db_name, user=user, password=pw, host=param_postg ...@@ -34,13 +34,10 @@ with psycopg2.connect(database=db_name, user=user, password=pw, host=param_postg
geotransform = (xmin, xres, 0, ymax, 0, -yres) geotransform = (xmin, xres, 0, ymax, 0, -yres)
output_raster = gdal.GetDriverByName('GTiff').Create('D:/Uni/Master/01_SS2021/Automatisierte_Geodatenprozessierung/temperaturverteilung/dataacquisition/output/myraster.tif', ncols, nrows, 1, gdal.GDT_Float32) # Open the file output_raster = gdal.GetDriverByName('GTiff').Create('D:/Uni/Master/01_SS2021/Automatisierte_Geodatenprozessierung/temperaturverteilung/dataacquisition/output/myraster.tif', ncols, nrows, 1, gdal.GDT_Float32) # Open the file
output_raster.SetGeoTransform(geotransform) # Specify its coordinates output_raster.SetGeoTransform(geotransform)
srs = osr.SpatialReference() # Establish its coordinate encoding srs = osr.SpatialReference()
srs.ImportFromEPSG(4326) # This one specifies WGS84 lat long. srs.ImportFromEPSG(4326)
# Anyone know how to specify the output_raster.SetProjection(srs.ExportToWkt())
# IAU2000:49900 Mars encoding? output_raster.GetRasterBand(1).WriteArray(np_pixel_array)
output_raster.SetProjection(srs.ExportToWkt()) # Exports the coordinate system
# to the file
output_raster.GetRasterBand(1).WriteArray(np_pixel_array) # Writes my array to the raster
output_raster.FlushCache() output_raster.FlushCache()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment