Compartilhar via


Scenes.GetStacFeature(String, String, RequestContext) Método

Definição

Obtenha um recurso (SpatioTemporal Asset Catalog (STAC) Item) para determinada coleção e id de recurso.

public virtual Azure.Response GetStacFeature (string collectionId, string featureId, Azure.RequestContext context = default);
abstract member GetStacFeature : string * string * Azure.RequestContext -> Azure.Response
override this.GetStacFeature : string * string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetStacFeature (collectionId As String, featureId As String, Optional context As RequestContext = Nothing) As Response

Parâmetros

collectionId
String

ID da coleção a ser buscada. Valores permitidos: "Sentinel_2_L2A" | "Sentinel_2_L1C".

featureId
String

ID do recurso a ser buscada.

context
RequestContext

O contexto de solicitação, que pode substituir os comportamentos padrão do pipeline do cliente por chamada.

Retornos

A resposta retornada do serviço. Os detalhes do esquema do corpo da resposta estão na seção Comentários abaixo.

Exceções

collectionId ou featureId é nulo.

collectionId ou featureId é uma cadeia de caracteres vazia e esperava-se que não estivesse vazia.

O serviço retornou um código de status sem êxito.

Exemplos

Este exemplo mostra como chamar GetStacFeature com os parâmetros necessários e analisar o resultado.

var credential = new DefaultAzureCredential();
var client = new FarmBeatsClient(credential).GetScenesClient(<2022-11-01-preview>);

Response response = client.GetStacFeature("<collectionId>", "<featureId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("stacVersion").ToString());
Console.WriteLine(result.GetProperty("stacExtensions")[0].ToString());
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("geometry").ToString());
Console.WriteLine(result.GetProperty("bbox")[0].ToString());
Console.WriteLine(result.GetProperty("properties").ToString());
Console.WriteLine(result.GetProperty("links")[0].GetProperty("href").ToString());
Console.WriteLine(result.GetProperty("links")[0].GetProperty("rel").ToString());
Console.WriteLine(result.GetProperty("links")[0].GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("links")[0].GetProperty("title").ToString());
Console.WriteLine(result.GetProperty("assets").GetProperty("<test>").GetProperty("href").ToString());
Console.WriteLine(result.GetProperty("assets").GetProperty("<test>").GetProperty("title").ToString());
Console.WriteLine(result.GetProperty("assets").GetProperty("<test>").GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("assets").GetProperty("<test>").GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("assets").GetProperty("<test>").GetProperty("roles")[0].ToString());
Console.WriteLine(result.GetProperty("collection").ToString());

Comentários

Abaixo está o esquema JSON para o conteúdo da resposta.

Corpo da resposta:

Esquema para StacFeature:

{
  stacVersion: string, # Required. The STAC version the Feature implements.
  stacExtensions: [string], # Optional. A list of extensions the Feature implements.
  id: string, # Required. Provider identifier. Globally unique ID by Data provider.
  type: string, # Required. Type of the GeoJSON Object. It's value is always Feature.
  geometry: AnyObject, # Optional. Defines the full footprint of the asset represented by this item.
Its a GeoJSON geometry.
  bbox: [number], # Optional. Bounding box of the feature.
  properties: AnyObject, # Required. A dictionary of additional metadata for the item.
  links: [
    {
      href: string, # Required. The actual link in the format of an URL.
      rel: string, # Required. Relationship between the current document and the linked document.
      type: string, # Optional. Media type of the referenced entity.
      title: string, # Optional. A human readable title to be used in rendered displays of the link.
    }
  ], # Required. List of link objects to resources and related URLs.
  assets: Dictionary<string, StacFeatureAsset>, # Required. Dictionary of asset objects, each with a unique key.
  collection: string, # Optional. The id of the STAC Collection this Feature references.
}

Aplica-se a