TransWikia.com

Manifest upload of multiple tiles to GEE and projection issues

Geographic Information Systems Asked on January 12, 2021

I am trying to upload multiple tiles to Google Earth Engine using the manifest option:
earthengine upload image --manifest manifest.json

I am having issues into understanding and implementing the CRS and affine transformation options. Below a summary of what I tried.

I can not get the right combination of options for mosaiking together the tiles into one asset.

1. Upload a single tile

Manually (browser graphical interface) or using the manifest: no problems
See for example this image

2. Upload multiple tiles

Projection 4326

"crs" : "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"]]"

Manifest without affine transformation

"sources": [
        {
          "uris": [
            "gs://sg20-upload-gee/phh2o_0-5cm_mean_tileSG-004-046_1-3.tif"
          ]
        },
        {
          "uris": [
            "gs://sg20-upload-gee/phh2o_0-5cm_mean_tileSG-004-046_3-2.tif"
          ]
        }
      ]
  • Error:
    FAILED Affine mismatch: found AffineTransform[[0.004193911810302, 0.0, -7.424748120676926], [0.0, -0.004193911810302, 58.51536655102318]] in phh2o_0-5cm_mean_tileSG-004-046_3-2.tif, previously saw AffineTransform[[0.004696413740213, 0.0, -7.912014673168407], [0.0, -0.004696413740213, 62.38737075514959]]. Difference in X scale exceeds 8.673617379884035E-13.

Manifest with affine transformation

The parameters were obtained from python gdal GetGeoTransform()

      "sources": [
        {
          "uris": [
            "gs://sg20-upload-gee/phh2o_0-5cm_mean_tileSG-004-046_1-3.tif"
          ]
          "affine_transform": {
            "scale_x": 0.0046964137402130185,
            "shear_x": 0.0,
            "translate_x": -7.912014673168407,
            "shear_y": 0.0,
            "scale_y": -0.0046964137402130185,
            "translate_y": 62.38737075514959
          }
        },
        {
          "uris": [
            "gs://sg20-upload-gee/phh2o_0-5cm_mean_tileSG-004-046_3-2.tif"
          ],
          "affine_transform": {
            "scale_x": 0.004193911810301575,
            "shear_x": 0.0,
            "translate_x": -7.424748120676926,
            "shear_y": 0.0,
            "scale_y": -0.004193911810301575,
            "translate_y": 58.51536655102318
          }
        }
      ]
  • Error:
    FAILED Affine mismatch: found AffineTransform[[0.004193911810302, 0.0, -7.424748120676926], [0.0, -0.004193911810302, 58.51536655102318]] in phh2o_0-5cm_mean_tileSG-004-046_3-2.tif, previously saw AffineTransform[[0.004696413740213, 0.0, -7.912014673168407], [0.0, -0.004696413740213, 62.38737075514959]]. Difference in X scale exceeds 8.673617379884035E-13.

The same happens with scale_x and scale_y set at 1.0

Manifest without CRS or affine transformation

  • Error:
    FAILED Affine mismatch: found AffineTransform[[0.004193911810302, 0.0, -7.424748120676926], [0.0, -0.004193911810302, 58.51536655102318]] in phh2o_0-5cm_mean_tileSG-004-046_3-2.tif, previously saw AffineTransform[[0.004696413740213, 0.0, -7.912014673168407], [0.0, -0.004696413740213, 62.38737075514959]]. Difference in X scale exceeds 8.673617379884035E-13.

GDAL info of the two tiles

Tile 1

Driver: GTiff/GeoTIFF
Files: ./upld/phh2o_0-5cm_mean_tileSG-004-046_1-3.tif
Size is 504, 212
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-7.912014673168407,62.387370755149590)
Pixel Size = (0.004696413740213,-0.004696413740213)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  -7.9120147,  62.3873708) (  7d54'43.25"W, 62d23'14.53"N)
Lower Left  (  -7.9120147,  61.3917310) (  7d54'43.25"W, 61d23'30.23"N)
Upper Right (  -5.5450221,  62.3873708) (  5d32'42.08"W, 62d23'14.53"N)
Lower Right (  -5.5450221,  61.3917310) (  5d32'42.08"W, 61d23'30.23"N)
Center      (  -6.7285184,  61.8895509) (  6d43'42.67"W, 61d53'22.38"N)
Band 1 Block=504x8 Type=Int16, ColorInterp=Gray
  NoData Value=-32768

Tile 2

Driver: GTiff/GeoTIFF
Files: ./upld/phh2o_0-5cm_mean_tileSG-004-046_3-2.tif
Size is 496, 113
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-7.424748120676926,58.515366551023178)
Pixel Size = (0.004193911810302,-0.004193911810302)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  -7.4247481,  58.5153666) (  7d25'29.09"W, 58d30'55.32"N)
Lower Left  (  -7.4247481,  58.0414545) (  7d25'29.09"W, 58d 2'29.24"N)
Upper Right (  -5.3445679,  58.5153666) (  5d20'40.44"W, 58d30'55.32"N)
Lower Right (  -5.3445679,  58.0414545) (  5d20'40.44"W, 58d 2'29.24"N)
Center      (  -6.3846580,  58.2784105) (  6d23' 4.77"W, 58d16'42.28"N)
Band 1 Block=496x8 Type=Int16, ColorInterp=Gray
  NoData Value=-32768

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP