I have tiled png files and those projection is EPSG:4326. I convert projection to EPSG:3857 with below 2 commands:
gdal_translate -of Gtiff -a_ullr 135.00000000000003 36.59788913307022 140.62500000000003 31.952162238024975 -a_srs EPSG:4326 4326.png 4326.tiff
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 4326.tiff 3857.png
Can I make it with 1 command ?
I don't know how to do it with one command, but if you are working on a Unix-like environment, you can use a pipe to avoid creating an intermediate file.
gdal_translate -of VRT -a_ullr 135.00000000000003 36.59788913307022 140.62500000000003 31.952162238024975 -a_srs EPSG:4326 4326.png /vsistdout/ | \
gdalwarp -t_srs EPSG:3857 /vsistdin/ 3857.png
/vsistdin/ and /vsistdout/ are part of a feature called "GDAL Virtual File Systems", which represents a virtual file that represents standard input and standard output. The output format of gdal_translate
could be GTiff, but I tried to use VRT which contains only metadata. If this doesn't work, try changing VRT to GTiff.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With