hmad
hmad

Reputation: 33

Earth Engine getThumbURL blurry image

I'm trying to find a way to specify a lat and long and retrieve a close up image. The code below allows me to enter a lat and long but the image is very blurry. Is there a simple way to get a higher resolution image? My main issue is specifying the zoom level and I haven't found any examples of people retrieving close up images.

var image = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20140318').select(['B4','B3','B2']);

    // Create a circle with buffer around a point.
    var roi = ee.Geometry.Point([-122.4481, 37.7599]).buffer(3000);
    Map.centerObject(image, 15)

    var a = image.getThumbURL({
    image: image,
    region:roi.getInfo()
    });

   //print URL 
    print(a);

Upvotes: 2

Views: 861

Answers (2)

Etore Marcari Jr.
Etore Marcari Jr.

Reputation: 582

If you just want to see an image on the map (as displayed), you can do it using the UI facilities.

like:

var textbox = ui.Textbox({
    placeholder: 'Point coordinates: long, lat',
    onChange: function(text) {
        var splitStr = text.split(",");
        var lon = parseFloat(splitStr[0]);
        var lat = parseFloat(splitStr[1]);

        var p = ee.Geometry.Point(lon, lat);
        Map.addLayer(p);
        Map.centerObject(p, 12);
    }
});
print(textbox);

This code will move the map to the given point coordinates and draw it.

Upvotes: 0

Kel Markert
Kel Markert

Reputation: 837

You can add a dimensions parameter to the .getThumbURL() that will define the number of pixels in the output image. Here is the your example with a 2000x2000 output thumb:

var image = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20140318').select(['B4','B3','B2']);

// Create a circle with buffer around a point.
var roi = ee.Geometry.Point([-122.4481, 37.7599]).buffer(3000);
Map.centerObject(image, 15)

var a = image.getThumbURL({
image: image,
dimensions:[2000,2000], // specify output thumb size here
region:roi.getInfo()
});

//print URL 
print(a);

Upvotes: 1

Related Questions