Update: ArcGIS Maps SDK for Unity and ArcGIS Maps SDK for Unreal Engine were released by Esri in the US in June/July 2022. For details,see here article.
Previously, in the blog post titled "Handling the Earth inside Unreal Engine and Unity!?" we introduced an overview of the game engine SDK called ArcGIS Maps SDK for Unity/Unreal Engine.
In this article, while explaining how to actually use the SDK, we will introduce what you can do with the ArcGIS Maps SDK.
Setup
First, install the dedicated plugin. This article introduces the procedure for
Unity.For instructions on Unreal Engine, please refer to the following documentation (in English).ArcGIS Maps SDK for Unreal Engine: Add the plugin to a new project:https://developers.arcgis.com/unreal-engine-sdk/install-and-set-up/add-the-plugin-to-a-new-project/
Plugin Download
Currently, the
ArcGIS Maps SDK
is available as a beta version, and anyone can create an account (free) and join the ArcGIS Maps SDK beta program to obtain it.By joining the beta program, you can download plugins for both Unity and Unreal Engine.You can download a Zip file and extract it anywhere you like.Plugin Installation
Create a project in Unity using either High Definition Render Pipeline or Universal Render Pipeline. Here, we use High Definition Render Pipeline.After creating the project, from Unity's menu select [Assets] -> [Import package] -> [Custom package], then import the downloaded ArcGISMapsSDK.unitypackage.Next, select [File] -> [Open Scene], then open PrefabScene.unity located at <Project Folder>\Assets\ArcGISMapsSDK\Samples\HDRP\PrefabScene.* If you are using a Universal Render Pipeline project, use the file located at <Project Folder>\Assets\ArcGISMapsSDK\Samples\URP\PrefabScene.Press the [Play] button to play; by default, a map and building data of New York are displayed.
SDK Settings
In the Hierarchy window, select PrefabScene_NY and configure map data display settings in the Inspector window.Camera Position SettingsYou can set the initial display position under [CAMERA LOCATION]. Specify latitude (Latitude), longitude (Longitude), and altitude (Altitude).Background Map SettingsYou can select which map to display under [BASE MAP]. Several types are available such as street maps (Streets) and satellite imagery (Imagery). Also, selecting [Terrain Elevation] loads elevation data to represent terrain.
Here, under [CAMERA LOCATION], latitude, longitude, and altitude are set so that Mount Fuji is displayed (Latitude: 35.300626, Longitude: 138.627363, Altitude: 5000), with satellite imagery selected as base map ([Select Base Map: Imagery]) and [Terrain Elevation] enabled during playback.Under [VIEW MODE], you can choose between Global Scene and Local Scene.Selecting Global Scene displays Earth as a sphere; selecting Local Scene displays Earth as a flat plane.The left shows Global Scene, and the right shows Local Scene.3D Data Display
You can specify a URL on the Web or a local file to display your own 3D data with location information. This requires additional software such as ArcGIS Online or ArcGIS Pro. The sample PrefabScene displays default 3D building data of New York published on ArcGIS Online.
To add 3D data, specify a URL or reference a local file under [ADD DATA].Below is an example displaying 3D city models (Tokyo's 23 wards) maintained by PLATEAU, a project by Japan's Ministry of Land, Infrastructure, Transport and Tourism for developing, utilizing, and open-sourcing 3D city models. The data is published on ArcGIS Online as a web service and displayed here.To try it yourself, set the web service layer URL in the URL field under [ADD DATA].Tips: PLATEAU's 3D city models are published in CityGML format but tools to convert them into formats usable by ArcGIS (file geodatabase) are available on GitHub. Converted file geodatabases can be published as web services on ArcGIS Online using ArcGIS Pro tools. Web services are published as scene layers that allow fast display of 3D data. Displaying via web services is easier to manage compared to converting local data into OBJ or FBX formats for display locally.
.Unity 3D Object Display on MapNext, let's add a Unity 3D object onto the map. From the File menu select [GameObject] → [3D Object] → [Cube]. In the Inspector window select [Add Component] → [Scripts] → [ArcGISMapsSDK.Components] → [ArcGIS Location Component].
Here, similarly to setting camera initial position, set where to display the 3D object by specifying latitude, longitude, and altitude. Below shows a Cube object displayed near Shinjuku Station.
. The items configured in this article can also be set using API. The SDK is currently in beta with limited features but future releases plan to support accessing features managed by ArcGIS with location information to retrieve attribute information.
. For more details about the SDK see the documentation below:
ArcGIS Maps SDK for Unity: https://developers.arcgis.com/unity-sdk/ArcGIS Maps SDK for Unreal Engine: https://developers.arcgis.com/unreal-engine-sdk/. The pre-release was around summer with official release planned within 2021. A pre-release version (Unity/Unreal Engine) was released in September 2021. The official release is scheduled for Q1 2022. We will continue introducing new release information through blog posts.. Released officially in June 2022 (Unity)/July 2022 (Unreal Engine). For details see . article.. Note that ArcGIS Maps SDK for Unity/Unreal Engine is provided by Esri USA as a beta program and is not covered by product maintenance support from ESRI Japan. For questions or concerns please contact directly via User Forums on the beta program page.
. Related Links
. ArcGIS blog post: "Handling the Earth inside Unreal Engine and Unity!?"
. Esri USA blog post: "ArcGIS Maps SDK Beta 2 is available!". Esri USA product pages: ArcGIS Maps SDK for Unity / ArcGIS Maps SDK for Unreal EngineStreets)や衛星画像(Imagery)等、いくつかの種類が用意されています。また、[Terrain Elevation] を選択すると標高データを読み込んで、地形を表現することもできます。
ここでは [CAMERA LOCATION] で富士山が表示されるように緯度・経度・高度(Latitude: 35.300626、Longitude : 138.627363、Altitude: 5000)と、背景地図に衛星画像(Select Base Map: Imagery)、[Terrain Elevation] を有効に設定して再生した状態です。
[VIEW MODE] では Global Scene と Local Scene のいずれかを選択できます。Global Scene を選択すると地球が球体で表示され、Local Scene を選択すると地球が平面で表示されます。
左が Global Scene、右が Local Scene
・3D データの表示
Web 上の URL またはローカルファイルを指定して、位置情報を持った独自の 3D データを表示できます。これには ArcGIS Online や ArcGIS Pro 等のソフトウェアが別途必要になります。サンプルの PrefabScene にはデフォルトで ArcGIS Online で公開されているサンプルのニューヨークの建物の 3D データが表示されています。
3D データを追加するには、[ADD DATA] で URL を指定するか、ローカルにあるファイルを参照します。
下記は、国土交通省が進める 3D 都市モデル整備・活用・オープンデータ化のプロジェクトである PLATEAU で整備されている 3D 都市モデル(東京都23区)を ArcGIS Online で公開し、その Web サービスを表示している状態です。
実際に試す場合は、[ADD DATA] の URL にWeb サービスのレイヤーの URL を設定します。
Tips:
PLATEAU の 3D都市モデルは CityGML の形式で公開されていますが、ArcGIS で利用可能な形式(ファイル ジオデータベース)へ変換するツールが GitHub で公開されています。変換したファイル ジオデータベースは ArcGIS Pro のツールを使用してArcGIS Online 上に Web サービスとして公開できます。Web サービスは 3D データを高速に表示可能なシーンレイヤーという形式で公開されます。Web サービスとして表示するため、OBJ や FBX 形式等に変換してローカルデータを表示するのに比べて管理も容易です。
・Unity の 3D オブジェクトを地図上に表示
次に Unity の 3D オブジェクトを地図上に追加してみます。
ファイル メニューで、[GameObject] → [3D Object] → [Cube] を選択します。Inspectorウィンドウで [Add Component] → [Scripts] → [ArcGISMapsSDK.Components] →[ArcGIS Location Component] を選択します。
ここでカメラの初期表示位置の時と同様に、3D オブジェクトを表示する位置(緯度、経度、高度)を設定します。下記は新宿駅付近に Cube オブジェクトを表示した状態です。
本記事で設定した項目は API を使用しても設定できます。SDK は現在ベータ版で機能も限られていますが、今後のリリースでは、ArcGIS で管理する位置情報を持った地物にアクセスして属性情報を取得するような機能もサポートされる予定です。
SDK の詳細は下記ドキュメントで紹介されています。
プレリリースは夏頃、正式リリースは 2021 年内に予定されています。2021 年 9 月にプレリリース版(Unity/Unreal Engine)がリリースされています。正式リリースは 2022 年 Q1 に予定されています。新しいリリース情報は、またブログ記事で紹介していきたいと思います。
2022年6月(Unity)/7月(Unreal Engine)に正式リリースされました。詳細はこちらの記事をご覧ください。
※ ArcGIS Maps SDK for Unity/Unreal Engine はベータ プログラムとして米国Esri社が提供しているものであり、ESRIジャパンにおける製品保守サポート等の対象外です。ご質問やご不明点はベータ プログラム ページの User Forums から直接お問い合わせをお願いいたします。
■関連リンク