{"id":15569016,"url":"https://github.com/timwaters/gdal_gdaladdo_issue","last_synced_at":"2026-02-09T02:32:01.533Z","repository":{"id":66706986,"uuid":"105913510","full_name":"timwaters/gdal_gdaladdo_issue","owner":"timwaters","description":"Bunch of files etc to help debug a gdaladdo error with transparency and nodata. now fixed.","archived":false,"fork":false,"pushed_at":"2017-10-06T12:13:57.000Z","size":1698,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T02:32:47.080Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timwaters.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-05T16:26:22.000Z","updated_at":"2017-10-06T12:12:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"6062be85-cd6e-4793-ae98-e4402d0160f0","html_url":"https://github.com/timwaters/gdal_gdaladdo_issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timwaters/gdal_gdaladdo_issue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwaters%2Fgdal_gdaladdo_issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwaters%2Fgdal_gdaladdo_issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwaters%2Fgdal_gdaladdo_issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwaters%2Fgdal_gdaladdo_issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timwaters","download_url":"https://codeload.github.com/timwaters/gdal_gdaladdo_issue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwaters%2Fgdal_gdaladdo_issue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29254316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T01:52:29.835Z","status":"online","status_checked_at":"2026-02-09T02:00:09.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T17:21:50.811Z","updated_at":"2026-02-09T02:32:01.513Z","avatar_url":"https://github.com/timwaters.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"A repo to help work out what was going on with a sequence of commands to add overviews to rasters.\nThe **fix** was to add add `-dstnodata none` to the gdalwarp call. Thanks to Even Rouault, lead of the GDAL project for helping me with this.\n\n\n```\n#set up\ncp treasure_island.orig.tif treasure_island.tif\nrm treasure_island_warped.tif\n\n#Apply overviews to ungeoreferenced raster\ngdaladdo -r average treasure_island.tif 2 4 8 16\n\n#Rasterise ungeoreferenced raster with the cropping mask \ngdal_rasterize -i  -b 1 -b 2 -b 3 -burn 17 -burn 17 -burn 17  20.gml -l features treasure_island.tif\n\n#Georeference the raster\ngdal_translate -a_srs '+init=epsg:4326' -of VRT treasure_island.tif temp.vrt  -gcp 100.38, 83.096, -122.377, 37.830 -gcp 430.1966, 370.08, -122.363, 37.8207 -gcp 313.69, 61.68, -122.368, 37.831\ngdalwarp -rn  -dstalpha -srcnodata '17 17 17' -s_srs 'EPSG:4326' temp.vrt treasure_island_warped.tif -co TILED=YES -co COMPRESS=LZW\n\n#Apply overviews to georeferenced raster\ngdaladdo -r average treasure_island_warped.tif 2 4 8 16\n\n#Expected - transparent areas in overviews should be 17,17,17 with alpha of 0\n#Observed - transparent areas in overviews are 17,17,17 with alpha also set to 17\n\ngdaladdo -r nearest treasure_island_warped.tif 2 4 8 16\n#Expected - transparent areas in overviews should be 17,17,17 with alpha of 0\n#Observed - transparent areas in overviews are 17,17,17 with alpha of 0\n```\nScreenshots from Gimp\n\nWith average:\n\n ![wrong](observed_wrong.png)\n \n \nWith nearest:\n\n ![correct](observed_nearest_correct.png)\n\n\nShowing what it looks like in mapwarper\n ![](in_mapwarper.png)\n\n # FIX\n\nadd -dstnodata none to the gdalwarp call.\n```\ngdalwarp -rn  -dstalpha -srcnodata '17 17 17' -dstnodata none -s_srs 'EPSG:4326' temp.vrt treasure_island_warped.tif -co TILED=YES -co COMPRESS=LZW\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimwaters%2Fgdal_gdaladdo_issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimwaters%2Fgdal_gdaladdo_issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimwaters%2Fgdal_gdaladdo_issue/lists"}