I am running into an interesting bug where the wkt returned from dataset.getProjection() does not match the wkt returned from gdalinfo.
(simplified) code:
final Dataset dataset = gdal.open(".tif")...String wkt = dataset.getProjection()returns:
LOCAL_CS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["unknown",SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],AUTHORITY["EPSG","3857"],UNIT["metre",1]]whereas running gdalinfo on the SAME file returns:
Driver: GTiff/GeoTIFFFiles: testRaster.tifSize is 718, 720Coordinate System is
ROJCS["WGS 84 / Pseudo-Mercator",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["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1, AUTHORITY["EPSG","9001"]],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]Origin = (-15042794.839973239228129,8590031.386050270870328)Pixel Size = (0.512485836989726,-0.512485836989726)Metadata: AREA_OR_POINT=Area COLORSPACE=RGB COMPRESSION_RATE_TARGET=4 VERSION=2Image Structure Metadata: INTERLEAVE=PIXELCorner Coordinates:Upper Left (-15042794.840, 8590031.386) (135d 7'54.21"W, 60d50'37.46"N)Lower Left (-15042794.840, 8589662.396) (135d 7'54.21"W, 60d50'31.65"N)Upper Right (-15042426.875, 8590031.386) (135d 7'42.31"W, 60d50'37.46"N)Lower Right (-15042426.875, 8589662.396) (135d 7'42.31"W, 60d50'31.65"N)Center (-15042610.858, 8589846.891) (135d 7'48.26"W, 60d50'34.56"N)Band 1 Block=718x2 Type=Byte, ColorInterp=Red NoData Value=0Band 2 Block=718x2 Type=Byte, ColorInterp=Green NoData Value=0Band 3 Block=718x2 Type=Byte, ColorInterp=Blue NoData Value=0Band 4 Block=718x2 Type=Byte, ColorInterp=Alpha NoData Value=0My question is: Why am i getting the "LOCAL_CS" value from the java api vs the PROJCS value from gdalinfo?
أكثر...
(simplified) code:
final Dataset dataset = gdal.open(".tif")...String wkt = dataset.getProjection()returns:
LOCAL_CS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["unknown",SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],AUTHORITY["EPSG","3857"],UNIT["metre",1]]whereas running gdalinfo on the SAME file returns:
Driver: GTiff/GeoTIFFFiles: testRaster.tifSize is 718, 720Coordinate System is
أكثر...