1

I am generating maps as TIFFs using the raster package (writeRaster) in R to generate small tiles, then as a final step, combining the tiles via the GDAL script gdal_merge.py.

I thought the resulting files were georeferenced. However, I sent a file to a colleague who is trying to import into ArcMap, and he indicated that the software doesn't recognize the georeferencing.

Here is the result of gdalinfo on one of the problematic files. Can anyone tell me if there's an important metadata component missing, and if so, how best to fix it?

% gdalinfo VERSION18.5_MVN_Vs30_NZGD00_allNZ_AhdiYongWeighted1_noisyT_minDist0.0km_v3_crp1.5.tif 
Driver: GTiff/GeoTIFF
Files: VERSION18.5_MVN_Vs30_NZGD00_allNZ_AhdiYongWeighted1_noisyT_minDist0.0km_v3_crp1.5.tif
Size is 11264, 16384
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["GRS 1980(IUGG, 1980)",
        DATUM["unknown",
            SPHEROID["GRS80",6378137,298.257222101],
            TOWGS84[0,0,0,0,0,0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",173],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",1600000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (1000000.000000000000000,6338400.000000000000000)
Pixel Size = (100.000000000000000,-100.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 1000000.000, 6338400.000) (166d35'16.17"E, 32d55'40.74"S)
Lower Left  ( 1000000.000, 4700000.000) (165d 1'10.46"E, 47d34'29.83"S)
Upper Right ( 2126400.000, 6338400.000) (178d37'44.88"E, 32d57'57.08"S)
Lower Right ( 2126400.000, 4700000.000) (179d59'25.56"W, 47d38'19.50"S)
Center      ( 1563200.000, 5519200.000) (172d33'57.05"E, 40d28'37.45"S)
Band 1 Block=11264x1 Type=Float64, ColorInterp=Gray
  NoData Value=-1.69999999999999994e+308
7
  • 1
    When they say not georeferenced do they mean not where they expect it or located at Null Island (with no geolocation at all).. your projection is "unnamed" but looks like it should be "custom" with the nonstandard false easting and central meridian but that shouldn't be a problem for ArcMap - is there a possibility that you could export this map in a more standard coordinate system like WGS84 UTM (EPSG:32759 (south) or EPSG:32659 (north))? That might make it a bit easier to transform or redefine properly. Commented Jul 31, 2018 at 2:14
  • @MichaelStimson thanks. It wasn't entirely clear but I inferred the latter from their reply (i.e. no geolocation at all); I am waiting for clarification from them. It would be ideal if I can rewrite the metadata but leave the actual TIF as-is, since it's quite large. Is that what you meant by export? Or did you mean apply a coordinate tranformation/warp step? (Can give that a try but hoping to avoid as in my experience it's somewhat time-consuming). Thanks for your help.
    – nivek
    Commented Jul 31, 2018 at 3:32
  • 1
    I mean before exporting with writeraster in R compile your map in WGS84 UTM Zone 59 (north or south); a standard coordinate system is less likely to cause problems. Can you get a screen shot of the catalog properties in ArcGIS from your colleague? Did you send the .tfw file with it? The GDALInfo isn't clear if it's a world TIFF or GeoTIFF (same driver) but GDAL_merge should produce GeoTIFF which embeds geolocation so (theoretically) the image can't loose geolocation - at the very worst it should fail to co-align, which is easier to fix than no geolocation at all. Commented Jul 31, 2018 at 3:57
  • Thanks. Hoping not to deal with it in R primarily because it's processor-intensive. I just discovered GDALWARP does the job pretty quick (somehow I thought it was slower).
    – nivek
    Commented Jul 31, 2018 at 4:07
  • 1
    Just a thought, how are you sending the file? Is it by Dropbox, google drive etc.. by FTP or as an attachment in an email? If you are emailing the image your ever helpful system may be resampling/compressing the raster to help keep your email small, if this is happening your GeoTags most likely are being voided.. I know from experience editing GeoTIFF files in GIMP or Photoshop (or even paint) destroy the tags they don't recognize which renders the file unreferenced. Check the size of the sent file, if it has been reduced find a different way to transport the file. Commented Jul 31, 2018 at 23:14

1 Answer 1

1

You can have a try by saving this first into a text file

PROJCS["unnamed",
    GEOGCS["GRS 1980(IUGG, 1980)",
        DATUM["unknown",
            SPHEROID["GRS80",6378137,298.257222101],
            TOWGS84[0,0,0,0,0,0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",173],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",1600000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]

Then use gdalsrsinfo https://www.gdal.org/gdalsrsinfo.html with ESRI style output for the saved file gdalsrsinfo proj.wkt -o wkt_esri. The result should look like this

PROJCS["Transverse_Mercator",
    GEOGCS["GCS_GRS 1980(IUGG, 1980)",
        DATUM["D_unknown",
            SPHEROID["GRS80",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",173],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",1600000],
    PARAMETER["false_northing",10000000],
    UNIT["Meter",1]]

Save the result as .prj with the same base name as the image file and try if ArcMap could understand it.

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.