<div dir="ltr"><div>Lars, <div><br></div><div>Sorry! My apologies. Despite double checking, there was a copy and paste error in the script. The second gdalwarp with the -te was outputting to the same path as the no sliced version. Corrected script below. I appreciate you looking into this with me! </div><div><br></div><div>*additionally, My original reply directly to you also included a typo. This script should be good!</div><div><br></div></div><div>-jr<br><div><div><br></div><div><span class="gmail-im" style="color:rgb(80,0,80)"><div>---snip---</div><div>#!/bin/bash</div><div><br></div><div>wget -SN <a href="https://aeronav.faa.gov/content/aeronav/Planning/AK_WallPlan_2.zip" target="_blank">https://aeronav.faa.gov/content/aeronav/Planning/AK_WallPlan_2.zip</a> && unzip -xo AK_WallPlan_2.zip <br></div></span><div><span class="gmail-im" style="color:rgb(80,0,80)">mv "Alaska Wall Planning Chart 2.tif" Alaska_Wall_Planning_Chart_2.tif<br>gdal_translate  -expand rgb  -strict  -co TILED=YES -co COMPRESS=LZW  -co BIGTIFF=YES Alaska_Wall_Planning_Chart_2.tif alaska_expanded_rgb.vrt<br>gdalwarp -t_srs EPSG:3857 -r lanczos -overwrite -multi -wo NUM_THREADS=ALL_CPUS -wm 1024 --config GDAL_CACHEMAX 1024 -co TILED=YES alaska_expanded_rgb.vrt alaska_warped.vrt<br></span>gdalwarp -t_srs EPSG:3857 -te -19979999 6016546 -13438444 11497579 -r lanczos -overwrite -multi -wo NUM_THREADS=ALL_CPUS -wm 1024 --config GDAL_CACHEMAX 1024 -co TILED=YES alaska_expanded_rgb.vrt alaska_warped_sliced_at_180.vrt<span class="gmail-im" style="color:rgb(80,0,80)"><br>rm -rf alaska_tiles_no_slice<br>rm -rf alaska_tiles_sliced_at_180<br>gdalinfo alaska_warped.vrt<br>time gdal2tiles.py -vvv -z 0-9 --processes=16 -r lanczos -w leaflet alaska_warped.vrt alaska_tiles_no_slice<br>gdalinfo alaska_warped_sliced_at_180.vrt<br>time gdal2tiles.py -vvv -z 0-9 --processes=16 -r lanczos -w leaflet alaska_warped_sliced_at_180.vrt alaska_tiles_sliced_at_180<br></span></div><div><br></div><div>---snip---</div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 26, 2020 at 9:55 AM <<a href="mailto:lars.schylberg@blixtmail.se">lars.schylberg@blixtmail.se</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u><div><div style="font-family:arial,sans-serif;font-size:13px">Hi,<br><br>I tried to reproduce your experiment. It seems like the command that produces "alaska_warped_sliced_at_180.vrt" is missing in your script.<br>I guess that step could be vital to understand what is going on.<br><br>Best regards<br><br>/Lars Schylberg<br><br>26 november 2020 kl. 03:42, "James Russo" <<a href="mailto:jr@halo3.net?to=%22James%20Russo%22%20%3Cjr@halo3.net%3E" target="_blank">jr@halo3.net</a>> skrev:<br> <blockquote><div><div> <div dir="ltr"> <div>Good Evening,</div> <div></div> <div>I'm just following up on this question from a few days ago with some more information and the script I am using which reproduces this issue.</div> <div></div> <div>The example results can be found here at the s3 links below and are all generated from the same original GeoTIFF. The only difference is that on one of them I slice off all data left of the 180, the other one the map is left complete. The html files are set to the same example point and zoom level to show how that without slicing the file, the image quality is very poor. The one thing I notice is that if I include the 180 meridian, the number of tiles generated is far larger (46k vs 8k).</div> <div></div> <div>Bad Results:</div> <blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"> <div><a rel="external nofollow noopener noreferrer" href="http://halo3.net/alaska_tiles_no_slice/leaflet.html" target="_blank">http://halo3.net/alaska_tiles_no_slice/leaflet.html</a></div> <div></div> </blockquote> <div>Good Results:</div> <blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><a rel="external nofollow noopener noreferrer" href="http://halo3.net/alaska_tiles_sliced_at_180/leaflet.html" target="_blank">http://halo3.net/alaska_tiles_sliced_at_180/leaflet.html</a></div></blockquote> <div></div> <div>Below is the script I use to generate both tile sets. It will automatically download, unzip and process the input file I am using producing the same results shown at the links above.</div> <div></div> <div>I'd appreciate any insight into the issue and how I might be able to get it resolved? I'm still quite a novice at all this GIS stuff, but it has been a fun experience so far.</div> <div></div> <div>Thanks,</div> <div></div> <div>-jr</div> <div></div> <div></div> <div>---snip---</div> <div>#!/bin/bash</div> <div></div> <div>wget -SN <a rel="external nofollow noopener noreferrer" href="https://aeronav.faa.gov/content/aeronav/Planning/AK_WallPlan_2.zip" target="_blank">https://aeronav.faa.gov/content/aeronav/Planning/AK_WallPlan_2.zip</a> && unzip -xo AK_WallPlan_2.zip</div> <div>mv "Alaska Wall Planning Chart 2.tif" Alaska_Wall_Planning_Chart_2.tif<br>gdal_translate -expand rgb -strict -co TILED=YES -co COMPRESS=LZW -co BIGTIFF=YES Alaska_Wall_Planning_Chart_2.tif alaska_expanded_rgb.vrt<br>gdalwarp -t_srs EPSG:3857 -r lanczos -overwrite -multi -wo NUM_THREADS=ALL_CPUS -wm 1024 --config GDAL_CACHEMAX 1024 -co TILED=YES alaska_expanded_rgb.vrt alaska_warped.vrt<br>gdalwarp -t_srs EPSG:3857 -te -19979999 6016546 -13438444 11497579 -r lanczos -overwrite -multi -wo NUM_THREADS=ALL_CPUS -wm 1024 --config GDAL_CACHEMAX 1024 -co TILED=YES alaska_expanded_rgb.vrt alaska_warped.vrt<br>rm -rf alaska_tiles_no_slice<br>rm -rf alaska_tiles_sliced_at_180<br>gdalinfo alaska_warped.vrt<br>time gdal2tiles.py -vvv -z 0-9 --processes=16 -r lanczos -w leaflet alaska_warped.vrt alaska_tiles_no_slice<br>gdalinfo alaska_warped_sliced_at_180.vrt<br>time gdal2tiles.py -vvv -z 0-9 --processes=16 -r lanczos -w leaflet alaska_warped_sliced_at_180.vrt alaska_tiles_sliced_at_180</div> <div></div> <div>---snip---</div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> <div> <div dir="ltr">On Tue, Nov 24, 2020 at 6:20 AM James Russo <<a rel="external nofollow noopener noreferrer" href="mailto:jr@halo3.net" target="_blank">jr@halo3.net</a>> wrote:</div> <blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Good Evening,<div></div> <div>GIS novice here. I have a GEOTiff that I'm trying to create tiles from which crosses the 180. It's a FAA sectional chart from the US used for aviation. If I slice off anything west of the 180, I can generate the tiles and they look good. If I don't the area of the tiles is super large and the resulting tile set is very pixelated.</div> <div></div> <div>The source file is located here in zip form (<a rel="external nofollow noopener noreferrer" href="https://aeronav.faa.gov/content/aeronav/Planning/AK_WallPlan_2.zip" target="_blank">https://aeronav.faa.gov/content/aeronav/Planning/AK_WallPlan_2.zip</a>)</div> <div></div> <div>I've tried some of the solutions that specify to use the CONFIG_LONG option, but that doesn't seem to be impacting anything. The only solution I have come up with is to cut off the area which crosses the 180 which yields good results.</div> <div></div> <div>I've included below the commands I've been using. I'm looking for any suggestions/guidance. I realize this is somewhat of a common problem. Even MapTiler had the problem, but they have sent an updated version which supposedly fixes it, but I can't afford that solution at this point so I'd like to stick to GDAL if possible.</div> <div></div> <div>Thanks,</div> <div></div> <div>-jr</div> <div></div> <div></div> <div>--- snip --</div> <div></div> <div>gdal_translate \</div> <div>-expand rgb \<br>-strict \<br>-co TILED=YES \<br>-co COMPRESS=LZW \<br>-co BIGTIFF=YES \<br>alaska.tif alaska_expanded_rgb.vrt<br><br>gdalwarp \<br>-overwrite \<br>-cutline "Alaska_Wall_Planning_Chart.shp" \<br>-crop_to_cutline \<br>-cblend 10 \<br>-r lanczos \<br>-dstalpha \<br>-co ALPHA=YES \<br>-co TILED=YES \<br>-multi \<br>-wo NUM_THREADS=ALL_CPUS \<br>-wm 1024 \<br>--config GDAL_CACHEMAX 1024 \<br>"alaska_expanded_rgb.vrt" \<br>"alaska_clipped.vrt"<br><br>gdalwarp \<br>-t_srs EPSG:3857 \<br>-te -19497422 6016546 -13438444 11497579 \<br>-r lanczos \<br>-overwrite \<br>-multi \<br>-wo NUM_THREADS=ALL_CPUS \<br>-wm 1024 \<br>--config GDAL_CACHEMAX 1024 \<br>-co TILED=YES \<br>"alaska_clipped.vrt" \<br>"alaska_warped.vrt"</div> <div></div> <div>gdal2tiles.py -z 0-8 --processes=16 -r lanczos -w leaflet alaska_warped.vrt</div> <div></div> <div></div> <div></div> </div></blockquote> </div> </div></div></blockquote> <br><br><u></u><u></u> </div></div>
</blockquote></div>