次の方法で共有


Scenes.GetStacFeatureAsync(String, String, RequestContext) メソッド

定義

特定のコレクションと機能 ID の機能 (SpatioTemporal Asset Catalog (STAC) 項目) を取得します。

public virtual System.Threading.Tasks.Task<Azure.Response> GetStacFeatureAsync (string collectionId, string featureId, Azure.RequestContext context = default);
abstract member GetStacFeatureAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetStacFeatureAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetStacFeatureAsync (collectionId As String, featureId As String, Optional context As RequestContext = Nothing) As Task(Of Response)

パラメーター

collectionId
String

取得するコレクション ID。 使用できる値: "Sentinel_2_L2A" |"Sentinel_2_L1C"

featureId
String

フェッチされる機能 ID。

context
RequestContext

要求コンテキスト。これは、呼び出しごとにクライアント パイプラインの既定の動作をオーバーライドできます。

戻り値

サービスから返された応答。 応答本文スキーマの詳細については、以下の「解説」セクションを参照してください。

例外

collectionId または featureId が null です。

collectionId または featureId が空の文字列であり、空でないと想定されていました。

サービスから成功以外の状態コードが返されました。

このサンプルでは、必要なパラメーターを使用して GetStacFeatureAsync を呼び出し、結果を解析する方法を示します。

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

Response response = await client.GetStacFeatureAsync("<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());

注釈

応答ペイロードの JSON スキーマを次に示します。

応答本文:

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.
}

適用対象