Harmonized Landsat Sentinel Service

API change history

The Harmonized Landsat-Sentinel Service API produces high-resolution imagery and NDVI data for a desired area-of-interest. From NASA, the Harmonized Landsat-Sentinel-2 project is an initiative to produce a consistent, harmonized surface reflectance product from Landsat and Sentinel-2 data.

Detect tiles




This Service identifies the precise tileID of the given area of interest according to NASA tiling system for Harmonized Landsat Sentinel2.



Click the Jupyter Notebook Static Sample to view a static rendition of this APIs Jupyter Notebook.
Click the Jupyter Notebook Github Repo to access the Jupyter Notebook .ipynb files and
instructions needed in order to run this APIs Jupyter Notebook.

Try it

Request

Request URL

Request headers

  • (optional)
    string
    Media type of the body sent to the API.

Request body

Request Payload

aoi: "{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-79.686546,41.78304],[-79.686533,41.782839],[-79.68684,41.782599],[-79.687885,41.781732],[-79.688636,41.781147],[-79.689531,41.780429],[-79.69046,41.779711],[-79.690827,41.779434],[-79.691645,41.778854],[-79.69182,41.778718],[-79.692253,41.779078],[-79.692508,41.779297],[-79.692567,41.779379],[-79.692592,41.77945],[-79.692527,41.779657],[-79.692452,41.779944],[-79.69237,41.78057],[-79.692333,41.780677],[-79.692288,41.780767],[-79.692165,41.780895],[-79.69211,41.781027],[-79.692045,41.781272],[-79.692041,41.781472],[-79.692029,41.781608],[-79.691868,41.781904],[-79.691715,41.782199],[-79.691598,41.782405],[-79.691478,41.782805],[-79.691406,41.782924],[-79.691335,41.783033],[-79.691238,41.783129],[-79.691107,41.783202],[-79.690743,41.783236],[-79.690137,41.783291],[-79.689834,41.78332],[-79.689652,41.783311],[-79.689411,41.783273],[-79.689204,41.783264],[-79.688927,41.783261],[-79.688676,41.783284],[-79.688382,41.783281],[-79.688288,41.783267],[-79.688038,41.783238],[-79.687969,41.783218],[-79.687822,41.783216],[-79.687597,41.783226],[-79.687424,41.783224],[-79.687262,41.783145],[-79.687082,41.783065],[-79.686857,41.783063],[-79.686546,41.78304]]]},"properties":{"OBJECTID":22751350,"CALCACRES":32.43000031,"CALCACRES2":null},"id":22751350}"

aoi=%7B%22type%22%3A%22Feature%22%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-93.531133%2C42.209365%5D%2C%5B-93.531193%2C42.216571%5D%2C%5B-93.521469%2C42.216616%5D%2C%5B-93.521532%2C42.209364%5D%2C%5B-93.525625%2C42.209368%5D%2C%5B-93.525637%2C42.21082%5D%2C%5B-93.527329%2C42.210813%5D%2C%5B-93.527317%2C42.20936%5D%2C%5B-93.531133%2C42.209365%5D%5D%5D%7D%2C%22properties%22%3A%7B%22OBJECTID%22%3A3352084%2C%22CALCACRES%22%3A152.63000488%2C%22CALCACRES2%22%3Anull%7D%2C%22id%22%3A3352084%7D

Code samples

@ECHO OFF

curl -v -X POST "https://aganalyticsapimanagementservice.azure-api.net/hls/detect_tiles"
-H "Content-Type: application/x-www-form-urlencoded"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers

            var uri = "https://aganalyticsapimanagementservice.azure-api.net/hls/detect_tiles?" + queryString;

            HttpResponseMessage response;

            // Request body
            byte[] byteData = Encoding.UTF8.GetBytes("{body}");

            using (var content = new ByteArrayContent(byteData))
            {
               content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
               response = await client.PostAsync(uri, content);
            }

        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://aganalyticsapimanagementservice.azure-api.net/hls/detect_tiles");


            URI uri = builder.build();
            HttpPost request = new HttpPost(uri);
            request.setHeader("Content-Type", "application/x-www-form-urlencoded");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://aganalyticsapimanagementservice.azure-api.net/hls/detect_tiles?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
            },
            type: "POST",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://aganalyticsapimanagementservice.azure-api.net/hls/detect_tiles";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"POST"];
    // Request headers
    [_request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://aganalyticsapimanagementservice.azure-api.net/hls/detect_tiles');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Content-Type' => 'application/x-www-form-urlencoded',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_POST);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Content-Type': 'application/x-www-form-urlencoded',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('aganalyticsapimanagementservice.azure-api.net')
    conn.request("POST", "/hls/detect_tiles?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Content-Type': 'application/x-www-form-urlencoded',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('aganalyticsapimanagementservice.azure-api.net')
    conn.request("POST", "/hls/detect_tiles?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://aganalyticsapimanagementservice.azure-api.net/hls/detect_tiles')


request = Net::HTTP::Post.new(uri.request_uri)
# Request headers
request['Content-Type'] = 'application/x-www-form-urlencoded'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body