2

I have a software package that requires "Unprojected GeoTIFFs" and no matter what I try I cannot get them accepted. Ive been trying GDAL but to no avail. I have an example of a working file and one I have exported ie that I want to use so can see th edifference, just dont know how to modify it, any advice? Here is the gdalinfo outputs,

i:\PNG_DATA>gdalinfo workingexample.tif Driver: GTiff/GeoTIFF Files: workingexample.tif Size is 1624, 1083 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]] Origin = (10.477938743014445,59.473562724738137) Pixel Size = (0.000007736964863,-0.000003930129367) Metadata: AREA_OR_POINT=Area TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) TIFFTAG_XRESOLUTION=96
TIFFTAG_YRESOLUTION=96 Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 10.4779387, 59.4735627) ( 10d28'40.58"E, 59d28'24.83"N) Lower Left ( 10.4779387, 59.4693064) ( 10d28'40.58"E, 59d28' 9.50"N) Upper Right ( 10.4905036, 59.4735627) ( 10d29'25.81"E, 59d28'24.83"N) Lower Right ( 10.4905036, 59.4693064) ( 10d29'25.81"E, 59d28' 9.50"N) Center ( 10.4842212, 59.4714346) ( 10d29' 3.20"E, 59d28'17.16"N) Band 1 Block=1624x1 Type=Byte, ColorInterp=Red Band 2 Block=1624x1 Type=Byte, ColorInterp=Green Band 3 Block=1624x1 Type=Byte, ColorInterp=Blue Band 4 Block=1624x1 Type=Byte, ColorInterp=Undefined

i:\PNG_DATA>gdalinfo Overviewtiff.tif Driver: GTiff/GeoTIFF Files: Overviewtiff.tif Size is 1536, 928 Coordinate System is: PROJCS["WGS 84 / UTM zone 55S", GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]], PROJECTION["Transverse_Mercator"], PARAMETER["latitude_of_origin",0], PARAMETER["central_meridian",147], PARAMETER["scale_factor",0.9996], PARAMETER["false_easting",500000], PARAMETER["false_northing",10000000], UNIT["metre",1, AUTHORITY["EPSG","9001"]], AUTHORITY["EPSG","32755"]] Origin = (500200.000000000000000,9258575.000000000000000) Pixel Size = (25.000000000000000,-25.000000000000000) Image Structure Metadata:
COMPRESSION=LZW INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 500200.000, 9258575.000) (147d 0' 6.51"E, 6d42'27.35"S) Lower Left ( 500200.000, 9235375.000) (147d 0' 6.52"E, 6d55' 2.88"S) Upper Right ( 538600.000, 9258575.000) (147d20'57.34"E, 6d42'26.90"S) Lower Right ( 538600.000, 9235375.000) (147d20'57.89"E, 6d55' 2.41"S) Center ( 519400.000, 9246975.000) (147d10'32.07"E, 6d48'45.00"S) Band 1 Block=1536x1 Type=Byte, ColorInterp=Red Mask Flags: PER_DATASET ALPHA Band 2 Block=1536x1 Type=Byte, ColorInterp=Green Mask Flags: PER_DATASET ALPHA Band 3 Block=1536x1 Type=Byte, ColorInterp=Blue
Mask Flags: PER_DATASET ALPHA Band 4 Block=1536x1 Type=Byte, ColorInterp=Alpha

i:\PNG_DATA>

Anyone got any idea on what command to use to remove the projection info?

1
  • What kind of software package do you need this data for? What kind of data are you trying to provide? How did you use gdal when you unsuccessfully tried to remove the projection? Commented Oct 20, 2018 at 3:32

3 Answers 3

1

Read the GDAL GeoTIFF manual page http://www.gdal.org/frmt_gtiff.html. Pay attention to this creation option:

PROFILE=[GDALGeoTIFF/GeoTIFF/BASELINE]: Control what non-baseline tags are emitted by GDAL.

All you need to do is to copy your tiff into a new one with gdal_translate as

gdal_translate -of GTiff -co PROFILE=BASELINE input.tif output.tif

Depending on the software that you use it may be good to use other creation options (TILED=, COMPRESS=) as well.

0

So the first one is in WGS84 and the second is in UTM 55S.

If the first one is working with that software (which one?), you have to reproject the second to WGS84 too:

gdalwarp -t_srs EPSG:4326 Overviewtiff.tif OverviewDeg.tif

Or use a software that can handle (most of) all CRS like QGIS.

0

If you are a python user and are not very comfortable with gdal API from command line, you could use a script like the following:

import gdal
for original_tiff_name in os.listdir(tiff_folder):
    original_tiff = gdal.Open(original_tiff_name)
    band = tiff_file.GetRasterBand(1)    
    x_size = band.XSize
    y_size = band.YSize
    array = band.ReadAsArray()
    tiff_file = None #close it
    band = None #close it
    driver = gdal.GetDriverByName('GTiff')
    tiff_copy = driver.Create(output_raster_name, xsize, ysize, 1, gdal.GDT_Int16)# assuming int16 is your target data type
    tiff_copy.GetRasterBand(1).WriteArray(array)
    tiff_copy.FlushCache() #Saves to disk 
    tiff_copy = None #closes the file
1
  • I just noticed you have a multiband tiff, the method would be slightly different at GetRasterBand(). Let me know if you are interested and I can develop the answer more. Commented Oct 20, 2018 at 3:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.