エラー

ArcGIS API for Python GeoEnrichment エラー: 国集約モードは、グローバル データの収集しかサポートしていません。

Last Published: July 22, 2021

エラー メッセージ

ArcGIS Python の enrich_layer 関数 (arcgis.features.enrich_data module) は、以下のコード スニペットを使用し、複数のポイント位置に人口統計情報を付加するために使用されます。

from arcgis.gis import GIS from arcgis.features.enrich_data import enrich_layer # GIS に接続 gis = GIS("Pro") # 対象国で使用可能な分析変数を使用 analysis_variables = [ "KeyFacts.TOTPOP_CY", "HouseholdTotals.AVGHHSZ_CY", "KeyFacts.PP_CY", "Spending.CS01_CY" ] points = [ {"country": "Australia", "coords": (-33.918199,151.202186)}, {"country": "Belgium", "coords": (51.051012,4.335651)}, {"country": "Netherlands", "coords": (51.848607,4.669177)} ] for point in points: country = point['country'] coords = point['coords'] pt_enrich = enrich_layer( coords, analysis_variables=analysis_variables, distance=30, units='Kilometers', buffer_type='StraightLine', return_boundaries=True, ) print(pt_enrich.layer.featureSet.features[0].attributes)

これは特定の国に対しては正常に動作しますが、国によっては以下のエラー メッセージが表示され、失敗します。

{"messageCode": "AO_100000", "message": "国集約モードは、グローバル データの収集しかサポートしていません。 以下のデータ コレクションを処理できませんでした: 'KeyFacts', 'HouseholdTotals', 'Spending'."}

https://la.arcgis.com/databrowser/index.html のデータ ブラウザーによると、テストで使用したすべての国 (オーストラリア、ベルギー、オランダ) はこれらの分析変数をサポートするはずです。

原因

エラー メッセージ「国集約モードは、グローバル データの収集しかサポートしていません」は、入力座標からのバッファー距離により、情報付加に使用されるポリゴン入力フィーチャが複数の国と交差することを意味します。これは、グローバル データ収集でしかサポートされておらず、分析変数ではサポートされていません。

ポイント座標の位置によっては、入力座標から 30 キロメートルのバッファーは複数の国と交差することがあります。そのため、このエラーは一部のケースでしか発生しません。

解決策または対処法

このエラーには、2 つの回避策が考えられます。

enrich_layer メソッドで country という名前のオプション パラメーターを設定し、バッファーされる各入力ポイントに対して、情報付加を 1 か国に制限する

from arcgis.gis import GIS from arcgis.features.enrich_data import enrich_layer # GIS に接続 gis = GIS("Pro") # さまざまなコレクションから分析変数を使用してテストする analysis_variables = [ "KeyFacts.TOTPOP_CY", "HouseholdTotals.AVGHHSZ_CY", "KeyFacts.PP_CY", "Spending.CS01_CY" ] points = [ {"country": "Australia", "code": "AU", "coords": (-33.918199,151.202186)}, {"country": "Belgium", "code": "BE", "coords": (51.051012,4.335651)}, {"country": "Netherlands", "code": "NL", "coords": (51.848607,4.669177)} ] for point in points: country = point['country'] coords = point['coords'] code = point['code'] pt_enrich = enrich_layer( coords, analysis_variables=analysis_variables, country= code, distance=30, units='Kilometers', buffer_type='StraightLine', return_boundaries=True, ) print(pt_enrich.layer.featureSet.features[0].attributes)

arcgis.geoenrichment モジュールを使用し、すべての KeyGlobalFacts をすべての国に対して集約します。

from arcgis.gis import GIS from arcgis.geoenrichment import enrich, BufferStudyArea from arcgis.geometry import Point gis = GIS("Pro") points = [] points.append(Point({"x" : 4.335651, "y" : 51.051012, "spatialReference" : {"wkid" : 4326}})) points.append(Point({"x" : 151.202186, "y" : -33.918199, "spatialReference" : {"wkid" : 4326}})) points.append(Point({"x" : 4.669177, "y" : 51.848607, "spatialReference" : {"wkid" : 4326}})) points.append(Point({"x" : 114.125105, "y" : 22.343511, "spatialReference" : {"wkid" : 4326}})) for pt in points: buffered = BufferStudyArea(area= pt, radii=[30], units='Kilometers', overlap=False) enriched = enrich( study_areas=[buffered], data_collections=['KeyGlobalFacts'], ) print(enriched)

記事 ID:000025443

ArcGIS の専門家からヘルプを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動

関連情報

このトピックについてさらに調べる