I am trying to reproject a tiff file from MODIS in unknown sinusoidal projection to wgs84. I found a script here
from osgeo import gdal
# Change the following variables to the file you want to convert (inputfile)
# and what you want to name your output file (outputfile)
inputfile = "LST_day.tif"
outputfile = "LST_output.tif"
#Do not change the following line, it will reproject the geotiff file
ds = gdal.Warp(outputfile, inputfile, dstSRS="+proj=longlat +datum=WGS84 +no_defs")
When I opened the output in ArcGIS it is blank. Why does this occur and what can be done? This is the data I used
I read the crs information of the TIFF file using rasterio and it says this:
CRS.from_wkt('PROJCS["Unknown_datum_based_upon_the_custom_spheroid_Sinusoidal",GEOGCS["GCS_Unknown_datum_based_upon_the_custom_spheroid",DATUM["Not_specified_based_on_custom_spheroid",SPHEROID["Custom_spheroid",6371007.181,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Sinusoidal"],PARAMETER["longitude_of_center",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]')
I am new to python, I need files or links to refer to alter this: +proj=longlat +datum=WGS84 +no_defs
-
It looks like you have literaly taken the code as is and used it. Did you change the script at all? The MODIS Imagery uses a geographic sinusoidal projection: spatialreference.org/ref/sr-org/modis-sinusoidal-3/html You need to tell the transform what you want to transform from and then to. Have a look at this: gis.stackexchange.com/questions/272639/… and this: gis.stackexchange.com/questions/194533/…Keagan Allan– Keagan Allan2022年12月12日 23:32:55 +00:00Commented Dec 12, 2022 at 23:32
-
@KeaganAllan But my data's crs data is different from the one you suggested me to look into. Is this weird in this particular image case?SVpk– SVpk2022年12月12日 23:47:42 +00:00Commented Dec 12, 2022 at 23:47