Geographic Information Systems Asked by abonney on March 16, 2021
I’m trying to convert a .sid to .tif in OSGeo and was left this script by a former co-worker. I’m not very savvy in scripting, so I’m unsure of my translation.
First, I set the directory. The conversion command includes "-tr ": set output file resolution (in target georeferenced units). Does “target georeferenced units” here mean the units of the source data? The .sid I am trying to convert is in degrees.
If I wanted the output to be the same resolution as the source, wouldn’t the following numbers be 1 and 1? Or is it asking what the size (in the units specified in the source data) of each pixel should be in the output?
If it’s the latter, then if the source data was in degrees, with 30 cm resolution, this script:
for /r %a in (*.sid) do gdalwarp -tr .000005 .000005 %a %~dnpa.vrt && for /r %b in (*.vrt) do gdal_translate -co COMPRESS=JPEG -co TILES=YES %b %~dpnb.tif && del %a && del %b
…would mean each pixel in the output is .000005 degrees?
How can I calculate what the -tr resolution needs to be to keep the output as the same resolution as the input?
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP