///////////////Finding image projection information////////////////////Find projection information for a Landsat image// Point to a particular Landsat 5 image scene varimage=ee.Image('LANDSAT/LT05/C01/T1_TOA/LT05_015030_20100531');//Print the projection information for the selected image to your Console tab print('Projectionandtransformationinformation:',image.projection());//Print the nominal pixel size of the image (in meters) at the lowest level of the image pyramidprint('Pixelsizeinmeters:',image.projection().nominalScale());/////////////////Reprojecting images///////////////////// Point to a MODIS vegetation index image productvarimage=ee.Image('MODIS/MOD13A1/MOD13A1_005_2014_05_09');//Print the projection information for the MODIS image to the Console print(image.projection());//Display the imagevarvisParams={min:0.15,max:0.7};//Define visualization parameters Map.setCenter(-77.5127,43.2642,11);//Zoom to location near Rochester at level 11Map.addLayer(image,visParams,'original');//Add the original image to the map.//The pixels in the image look somewhat distorted, but can be reprojected to Maps Mercatorvarreprojected=image.reproject('EPSG:4326');//EPSG:4326 is the code for ellipsoidal coordinates based on WGS 84 Map.addLayer(reprojected,visParams,'Reprojected');
Image registration
//Load two images to be registered.varimage1=ee.Image('SKYSAT/GEN-A/PUBLIC/ORTHO/MULTISPECTRAL/s01_20150502T082736Z');varimage2=ee.Image('SKYSAT/GEN-A/PUBLIC/ORTHO/MULTISPECTRAL/s01_20150305T081019Z');//Resampling in GEE can use nearest neighbor, bilinear or bicubic interpolationvarimage1Orig=image1.resample('bicubic');//This forces the resampling method to bicubicvarimage2Orig=image2.resample('bicubic');//Without using resample, the default is nearest neighbor//Choose to register using only the 'R' band.varimage1RedBand=image1Orig.select('R');//Create a new image that contains only the red bandvarimage2RedBand=image2Orig.select('R');//Approach 1 //Determine the displacement needed to register image2 to image1 (using the selected red bands).vardisplacement=image2RedBand.displacement({referenceImage:image1RedBand,maxOffset:50.0,//defines the maximum displacement between the two imagespatchWidth:100.0//size of patch used to determine image offsets.});// Use the computed displacement to register all original bands.varregistered=image2Orig.displace(displacement);// Show the results of co-registering the images.varvisParams={bands:['R','G','B'],max:4000};Map.centerObject(image1Orig);Map.addLayer(image1Orig,visParams,'Reference');Map.addLayer(image2Orig,visParams,'BeforeRegistration');Map.addLayer(registered,visParams,'AfterRegistration');//Approach 2 // /*If you don't need to know what the displacement is, Earth Engine provides the register() method, which combines calls to displacement() and displace(). The register() function uses all bands of the image in performing the registration. */varalsoRegistered=image2Orig.register({referenceImage:image1Orig,maxOffset:50.0,patchWidth:100.0});Map.addLayer(alsoRegistered,visParams,'AlsoRegistered');