Polaris Soils Data Layers

The POLARIS Soils Data Layers API provides a spatially continuous, internally consistent, quantitative prediction of soil series at a 30 m spatial resolution for the contiguous United States.

Get Request Polaris Soils Data Layers

Please note, this API has been deprecated. Please use the new version.



Polaris is a recently developed soil data set that provides additional soil attributes. The POLARIS Soils Data Layers API provides a spatially continuous, internally consistent, quantitative prediction of soil series at a 30 m spatial resolution for the contiguous United States.


Polaris Soils in Ag-Analytics FarmScope.


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.

Request Parameter Details


Parameter Data Type Required? Options Description
inputShape Esri Geometry Yes See esriGeometryType
Constants
The shape information for the field,
as an Esri Geometry object
SoilValue String Yes See SoilValue
Details Table
Soil property to generate map of.
Statistics String Yes min, max,mean, and var Statistics options
SoilHorizon String Yes '0-5','5-15','15-30',
'30-60', '60-100', '100-200'
Soil depth in cm

SoilValue Details

The following variables can be used for the "SoilValue" parameter


Variable Units Description Variable Units Description
silt % Silt percentage ksat cm/hr Saturated hydraulic conductivity
sand % Sand percentage resdt cm Depth to restriction layer
clay % Clay Percentage ph N/A Soil pH in H2O
bd g/cm3 Bulk Density om % Organic matter percentage
awc m3/m3 Available water content caco3 % Calcium carbonate percentage
theta_s m3/m3 Saturated soil water content cec meq/100g Cation exchange capacity in soil
theta_r m3/m3 Residual soil water content lambda N/A Pore size distribution index
(brooks-corey)
theta_33 m3/m3 Soil water content at field
capacity
hb cm Bubbling pressure
(brooks-corey)
theta_1500 m3/m3 Soil water content at the
wilting point
n N/A Measure of the pore size
distribution (van genuchten)
alpha cm-1 Scale parameter inversely
proportional to mean pore
diameter (van genuchten)



Call API

Request

Request URL

Request parameters

  • The shape information for field in esriGeometryPolygon format.

  • e.g. pH, Organic Matter

  • Statistics options are: min, max, mean, and variance

  • Soil depth in CM.

Request headers

  • string

Request body

Responses

200 OK

Representations

Code samples

@ECHO OFF

curl -v -X GET "https://ag-analytics.azure-api.net/PolarisSoilsDataLayers/get?inputShape={"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}&SoilValue=ph&Statistics=mean&SoilHorizon=0_5"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--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
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["inputShape"] = "{"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}";
            queryString["SoilValue"] = "ph";
            queryString["Statistics"] = "mean";
            queryString["SoilHorizon"] = "0_5";
            var uri = "https://ag-analytics.azure-api.net/PolarisSoilsDataLayers/get?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // 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://ag-analytics.azure-api.net/PolarisSoilsDataLayers/get");

            builder.setParameter("inputShape", "{"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}");
            builder.setParameter("SoilValue", "ph");
            builder.setParameter("Statistics", "mean");
            builder.setParameter("SoilHorizon", "0_5");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // 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
            "inputShape": "{"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}",
            "SoilValue": "ph",
            "Statistics": "mean",
            "SoilHorizon": "0_5",
        };
      
        $.ajax({
            url: "https://ag-analytics.azure-api.net/PolarisSoilsDataLayers/get?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // 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://ag-analytics.azure-api.net/PolarisSoilsDataLayers/get";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"inputShape={"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}",
                         @"SoilValue=ph",
                         @"Statistics=mean",
                         @"SoilHorizon=0_5",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // 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://ag-analytics.azure-api.net/PolarisSoilsDataLayers/get');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'inputShape' => '{"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}',
    'SoilValue' => 'ph',
    'Statistics' => 'mean',
    'SoilHorizon' => '0_5',
);

$url->setQueryVariables($parameters);

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

// 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
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'inputShape': '{"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}',
    'SoilValue': 'ph',
    'Statistics': 'mean',
    'SoilHorizon': '0_5',
})

try:
    conn = httplib.HTTPSConnection('ag-analytics.azure-api.net')
    conn.request("GET", "/PolarisSoilsDataLayers/get?%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
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'inputShape': '{"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}',
    'SoilValue': 'ph',
    'Statistics': 'mean',
    'SoilHorizon': '0_5',
})

try:
    conn = http.client.HTTPSConnection('ag-analytics.azure-api.net')
    conn.request("GET", "/PolarisSoilsDataLayers/get?%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://ag-analytics.azure-api.net/PolarisSoilsDataLayers/get')

query = URI.encode_www_form({
    # Request parameters
    'inputShape' => '{"geometryType":"esriGeometryPolygon","features":[{"geometry":{"rings":[[[-88.509566,39.598643],[-88.509484,39.593239],[-88.509476,39.589665],[-88.514219,39.589738],[-88.518608,39.589742],[-88.518855,39.589739],[-88.518868,39.593309],[-88.518864,39.594773],[-88.518898,39.596357],[-88.518899,39.596927],[-88.518909,39.59738],[-88.518911,39.59765],[-88.518913,39.597752],[-88.518871,39.597807],[-88.518732,39.597818],[-88.517513,39.597823],[-88.51559,39.597826],[-88.514642,39.597827],[-88.514569,39.597811],[-88.514558,39.597596],[-88.51454,39.597346],[-88.514512,39.597276],[-88.514447,39.597266],[-88.514343,39.597238],[-88.514326,39.596633],[-88.514087,39.596636],[-88.514097,39.597291],[-88.514139,39.597401],[-88.514217,39.59744],[-88.514272,39.59754],[-88.514257,39.597693],[-88.514223,39.597828],[-88.514263,39.597956],[-88.514263,39.598009],[-88.514247,39.598188],[-88.514232,39.598432],[-88.514214,39.598504],[-88.514163,39.598561],[-88.514046,39.598634],[-88.513967,39.59866],[-88.512896,39.598661],[-88.509937,39.598649],[-88.509566,39.598643]]],"spatialReference":{"wkid":4326}}}]}',
    'SoilValue' => 'ph',
    'Statistics' => 'mean',
    'SoilHorizon' => '0_5'
})
if query.length > 0
  if uri.query && uri.query.length > 0
    uri.query += '&' + query
  else
    uri.query = query
  end
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# 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