-
AGOL Notebooks でフィーチャ レイヤー間の添付ファイルをコピーする
こんにちは!ホスト フィーチャ レイヤーに Trees と RemovedTrees という2つのレイヤーがあります。AGOL Notebooks(Python 3 Standard-14.0)で、Trees レイヤーから削除済みとしてマークされた樹木を検索し、RemovedTrees レイヤーにコピーするスクリプトを作成しようとしています。 添付ファイル以外は動作しています。添付ファイルもコピーしたいのですが、スクリプトを実行すると正常に完了するようで、RemovedTrees レイヤーを確認するとコピーされたフィーチャに添付ファイルが表示されますが、実際の画像はありません。 Python はまだ勉強を始めたばかりで、特に AGOL…
-
ArcGIS API for Pythonを使って、ポップアップに基づいてWebマップレイヤーのフォームを設定できますか?
すべてのWebマップレイヤーで最適なポップアップが設定されています。レイヤーをArcGIS ProからAGOLに自動公開する前に、同じarcpyスクリプトでCIMを使用してarcpyにより自動設定しているためです。 ArcGIS OnlineのField Maps Designerでは、「ポップアップから変換」ボタンを使って、これらのレイヤーに見やすいフォームを対話形式で作成できます。 しかし、こうしたWebマップを定期的に作成しており、レイヤーも多数あります。「ポップアップから変換」の操作を自動化したいと考えています(また、この操作で作成されるグループ要素は避けたいです)。 ArcGIS API for…
-
Python API初心者です。構文を教えてください!
Python APIを使い始めたばかりで、Notebookの変更について助けが必要です。コードは以下のとおりです。42行目が対象のデータセットに何の影響も与えず、理由がわかりません。エラーを推測できるように、Notebookの十分な範囲を含めたつもりです。このセルの前にいろいろな処理がありますが、あまり関係ないと思います。このセルでは、フィーチャーレイヤー内のすべてのレコードを確認し、既存のID番号の最大値を見つけて1を足し、nullのレコードに連番を割り当てることを目指しています。 # 対象のフィーチャーレイヤーをクエリして、既存のすべてのレポートの最大IDを取得する report_id_field_name = "ReportID"…
-
バグと機能強化のデータエクスポート
APIまたは自動処理を使って、「バグと機能強化」ページのデータをエクスポートする方法はありますか?
-
APIキー認証でフィーチャを編集できますか
APIキーを使ってAGOLに認証し、フィーチャ レイヤーを更新(削除、追加)するPythonスクリプトを設定しようとしています。 フィーチャ レイヤーにはアクセスできますが、トランケートしようとすると403エラーが発生します。 例外:このサービスにアクセスする権限がありません。このサービスにアクセスする権限がありません(エラーコード:403) また、delete_featuresで削除しようとすると、400エラーが発生します。 例外:この操作はサポートされていません。(エラーコード:400) 通常のユーザー認証で実行すると、すべて期待どおりに動作します。APIキー認証で同じことを実行できますか?APIキーのスコープ対象となっているフィーチャ…
-
ArcPyとArcGIS API for Python、ホストフィーチャレイヤーの属性値を更新するには?
こんにちは、 ArcPro の Python ノートブックで作業していて、フィーチャレイヤーの一部の属性値を更新したいと考えています。方法として、2つのアプローチを検討しています。 更新したいフィーチャは、まず SelectLayerByAttribute を使い、次に SelectLayerByLocation を使って特定しました。その後、次のどちらかの方法が使えると思っています。 * 選択したフィーチャを参照しながら、arcpyy を使ってフィールドの値を計算する方法、 * 更新対象のフィーチャの GlobalID と、更新後の値を持つフィールドを指定して edit_features(updates=) を使う方法です。…
-
Publish reference feature service to enterprise
Hi All, I'm trying to replicate the process normally done in Pro, using Publish Web Layer referencing registered data but instead using Python. I can create a new hosted feature service from data stored in out SDE database but I don't want to host the data I want to reference data in our SDE database, as running the…
-
Layer.calculate occasionally hangs
I have a python script that runs every hour or so as a windows scheduled task and does some updates to an ArcGIS Online hosted feature layer using the layer.calculate function. Every so often (once every couple of days) it hangs. The layer it hangs on only has 1600 records and the query reduces that to 26 records so it…
-
spatial.join は、ポイントの座標が 'NaN' の場合に(arcpy エンジンで)静かに0行を返します
バグの説明 1つのポイントが 'NaN' 座標を持つと、arcpy がジオメトリエンジンの場合、spatial.join はエラーなしで0行を返します。full_extent も nan を返します。shapely をエンジンにすると、同じデータでエラーが発生します。ESRI REST サービスのクエリはジオメトリに 'NaN' を返すことがあります。 再現手順 動作を再現する手順: pandas をインポートする numpy をインポートする arcgis.features から GeoAccessor をインポートする arcgis.geometry から Point と Polygon をインポートする sr = {'wkid':…
-
Python API コミュニティの皆様へ感謝 - v2.4.4
リリースに伴い、ArcGIS API for Python 2.4.4、コミュニティの皆様に心から感謝申し上げます。皆様のフィードバックと積極的な参加が、この製品の進化を本当に形作っています。 エコシステムに初めて触れる方は、私たちの public GitHub repository がサンプル、チュートリアル、ドキュメントの拠点です。テクニカルサポートやpublic repositoryを通じた皆様のフィードバックが最も重要な声であり、私たちはそこで報告された問題や機能改善の要望を積極的に監視し、すべてのリリースサイクルに皆様のアイデアを反映しています。 ここでは、public repositoryおよびTech…
-
フィーチャ サービスから削除されたフィーチャを抽出できません
皆さん、こんにちは、 ホストされたフィーチャ レイヤーから削除されたすべてのフィーチャを表示し、それらを空間データフレームに入れて確認できるノートブックを作成しようとしています。後で必要に応じてそのSDFから取得できるようにするのが目的です。同じスクリプトを「sandbox」環境のミラーリングされたホスト レイヤーで作成しましたが、本番環境で設定しようとすると、スクリプトを実行してもデータが返ってきません。挿入と更新をオンにして(21行目のコメントアウトを外して)それらを適切に表示させても同様です。 以下が私のスクリプトで、対象のフィーチャ…
-
ArcGIS API for Pythonを使ってポリゴン内のポイント数を数える
https://youtu.be/Wtrsev5v30E 空間解析では、一見簡単そうな次のような問いに答えることがよくあります。各エリア内には、いくつの地物があるでしょうか?各地区には何軒の不動産があるでしょうか?各公園には何本の木があるでしょうか?各行政界内では、何件のインシデントが発生したでしょうか?各サービスエリア内には、何か所の検査地点があるでしょうか? この記事では、ポリゴン内のポイント数を数え、その合計をポリゴンレイヤーに書き戻すPythonスクリプトを紹介します。 必要なクラスと関数をインポートする from arcgis.gis import GIS from arcgis.features import…
-
ArcGIS API for Python の FeatureLayer.calculate() メソッドで、属性値の計算に Arcade 式を受け入れられるようにします。
現在の制限 現在、FeatureLayer.calculate() メソッドは SQL 式またはスカラー値を使ったフィールド値の計算のみをサポートしています。しかし、このメソッドで Arcade 式を直接適用する方法はありません。 これにより、特に同じ式が Web マップ、ポップアップ、フィールド計算、属性ルール、その他の ArcGIS アプリケーションで既に使用されている場合に、Arcade を使った属性計算ロジックに依存するワークフローにギャップが生じています。 提案されている改善点 FeatureLayer.calculate() に Arcade 式パラメーターのサポートを追加し、FeatureLayer.calculate()…
-
Arpy geoprocessing toolで使用するためのArcGIS Onlineデータセットの認証に失敗しました
arcgis.comにホストされているフィーチャ サービスがあり、それは公開共有されていません。pythonスクリプトからデータを読み取る必要があります。以下のスクリプトは最近まで問題なく動作していましたが、現在はMakeFeatureLayer_managementツールを実行すると000732エラー(「データセットが存在しないかサポートされていません」)が発生します。ツールに渡しているのがオブジェクトではなくurl(文字列)であることを確認するためにurlを印刷しましたが、urlは有効なので何が起こっているのかわかりません。トークンを生成してurlに渡すことも試みましたが、それも機能しませんでした。 私のコードはこちらです: pw =…
-
Automating ArcGIS Notebooks
Hello, for context I am currently developing a way to have records automatically added to a "Master Results Table". I am using a feature layer in AGOL that has tasks enabled through Field Maps Designer. Within the EsriTask workflow, the field team will be required to complete a Survey123 form. There is n many Survey123…
-
FeatureLayer.query() giving Exception - TypeError: '>=' not supported between instances of 'int' and 'NoneType'
While querying Feature Layer getting Exception as <em><strong>"</strong></em><em>TypeError: '>=' not supported between instances of 'int' and 'NoneType' "</em> But the same outStatistics value and where clause is working fine in the REST end point in the browser, and giving the expected result. <em> </em> // Below code is…
-
FeatureLayer.query() not returning a feature set
Hello, I am looking to create a spatially enabled dataframe from a FeatureSet with the ArcGIS API for Python. I have always: * Created a FeatureLayer object * Used .query(where="whatever") to return a feature set, * Used the .sdf property to create the dataframe. Today the sdf property doesn't work, .query() is returning a…
-
clone_items() fails cloning hosted feature layer
First, a couple bullets with some basic information * ArcGIS Pro version: 3.6.3 * Source: ArcGIS Enterprise organization * Target: ArcGIS Online organization * Cloning between same source/target organizations worked previously with another Feature Layer Collection. I'm trying to clone a Feature Layer with a Survey123 point…
-
Update feature geometry?
I have a script that is supposed to replace the geometry of a polygon with a new polygon constructed by reading some of its fields (minX, minY, maxX, maxY). I can do this with traditional arcpy, but I'm running into issues when trying to do it with the arcgis module. Specifically, I either get no edits to the geometry if I…
-
What is wrong with this code?
Good afternoon, I am trying to overwrite an AGOL hosted feature class with API Python and testing it from ArcGIS Pro Notebook. I am able to load the zipped FGDB in AGOL and overwrite the hosted feature class manually. When I try to do the same thing with my program, selecting the same zipped FGDB, I get the following error…
-
Which cell tag to use for AGOL Notebook parameters: injected-parameters or parameters?
The docs list two different cell tags to use when setting up a Notebook to use external parameters. In one place they say to use injected-parameters but in another they say to use parameters. After some experimentation I think parameters is correct when I'm calling the Notebooks from arcgis.notebook.execute_notebook(), but…
-
Expose ArcGIS Online Required and Suggested Metadata Elements Scores to API for Python
My organization is attempting to create an automated process using the API for Python to check items in our organization against our customized publishing guidelines (i.e., summary, tags, categories, etc). Our process is similar to this example, but much more in-depth and linked to a live dashboard to monitor…
-
Error on code that was working three weeks ago: (gis.content.get(item_id)).layers[0] ("module 'arcgis.layers' has no attribute '_ogc' ")
I am calling in a layer from an item ID by using the arcgis module "layers". If I just pull in the item using gis.content.get(item_id), the item shows up fine. When I try to get to the layers though, I get the error module 'arcgis.layers' has no attribute '_ogc' . This was working for a long time, and is my go-to method…
-
FeatureLayerCollection.replicas.create always returns the correct tables but 0 records in the tables
Hi there. I have a python script that attempts to export a hosted feature service as a file geodatabase using the python api's featurelayercollection.replicas.create() method. I am running python 3.11.10 and arcgis api 2.3.0 The service details: - One feature layer (id: 0, geometry type: point) with attachments - One…
-
Issue with the Tutorial: "Classify land cover to measure shrinking lakes"
Classify land cover to measure shrinking lakes | ArcGIS API for Python | Esri Developer The code extracting the sentinel fata in this tutorial is not working for me. sentinel2016 = gis.content.get("a264d1eaa8bd4ff2a0a1e27b59daa7d3") sentinel2017 = gis.content.get("ea192d03d1324c62a2cb91e26e3a0ece") These Item IDs do not…