hotosm / oam-dynamic-tiler

Dynamic tiling of raster data for OpenAerialMap + others
Other
35 stars 12 forks source link

White and black tiles #48

Open smit1678 opened 7 years ago

smit1678 commented 7 years ago

Via report form on website from @ragnvald:

Coastal ortophoto for the whole coastline is available. Just tried uploading one section. Looking at white and black areas on the sides of actual images. Any suggestions for preprocessing before uploading? File used for the upladed tile is available here: ftp://ftp.miljodirektoratet.no/miljodata/leveranse_ut/

Image on OAM: https://map.openaerialmap.org/#/-0.11981964111328125,5.5619986997627,11/03333311110/598d829d46e19904aab0a92a?_k=qrpy46

@mojodna suggestions?

image

mojodna commented 7 years ago

The source file is 18GB on a slow FTP connection, so I can only go off of what it was transcoded into. (Though if @ragnvald has access to the original, I'd like to see what the output of gdalinfo against it is.)

The transcoded version has 3 bands and no NODATA values (per gdalinfo /vsicurl/http://oin-hotosm.s3.amazonaws.com/598d7c5aa260c700113db24d/0/e77bbf55-a505-4a25-9de1-7ed667b88bfa.tif). The white areas are white (255, 255, 255) and the black areas black (0, 0, 0), so I suspect that the same may be true for the source.

The black and white areas need to be masked out either by creating a mask or alpha band. (Since the band types are all Byte, NODATA values are problematic (they need to be in the range of 0-255, which are also valid colors).

Unfortunately, I don't have any quick/simple solutions for adding mask bands.

ragnvald commented 7 years ago

This is the GDAL info from a similar file:

Driver: GTiff/GeoTIFF Files: E:/ghana_coast/norkart_fiksa/output_qgis_merger/phase-6_modified_2.tif Size is 80016, 37806 Coordinate System is: PROJCS["unnamed", GEOGCS["Clarke 1880 mod.", DATUM["unknown", SPHEROID["clrk80",6378249.145,293.4663], TOWGS84[-130,29,364,0,0,0,0]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433]], PROJECTION["Transverse_Mercator"], PARAMETER["latitude_of_origin",4.666666666666667], PARAMETER["central_meridian",-1], PARAMETER["scale_factor",0.99975], PARAMETER["false_easting",274319.51], PARAMETER["false_northing",0], UNIT["metre",1, AUTHORITY["EPSG","9001"]]] Origin = (207999.849344947375357,58396.820743878321082) Pixel Size = (0.499910369967251,-0.499910369967251) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 207999.849, 58396.821) ( 1d35'53.98"W, 5d11'40.73"N) Lower Left ( 207999.849, 39497.209) ( 1d35'53.41"W, 5d 1'25.28"N) Upper Right ( 248000.678, 58396.821) ( 1d14'14.82"W, 5d11'41.59"N) Lower Right ( 248000.678, 39497.209) ( 1d14'14.59"W, 5d 1'26.11"N) Center ( 228000.263, 48947.015) ( 1d25' 4.21"W, 5d 6'33.52"N) Band 1 Block=80016x1 Type=Byte, ColorInterp=Red Band 2 Block=80016x1 Type=Byte, ColorInterp=Green Band 3 Block=80016x1 Type=Byte, ColorInterp=Blue

ragnvald commented 7 years ago

I guess if I could automate the selection (wand-type select) for both bigger black and white areas I could create a mask which is then used as an alpha-channel. I am however some of a novice in raster data handling, so if you know someone which could describe a procedure in QGIS it would be grand.