Create an Oriented Imagery Catalog using a Python Script

Mosaic Dataset Configuration Script (MDCS) is a tool created by ESRI that can be used to simplify the automation of creating and populating Oriented Imagery Catalogs, by enabling the workflows to be parameterized and executed in a single step.

We will use MDCS embedded in a Python Script to create an Oriented Imagery Catalog.

Requirements before running the Python script

  1. ArcGIS Pro must be installed on the computer where the script will be run.

  2. A user must be signed in to ArcGIS Pro, but it does not need to be open when running the script.

  3. An active portal needs to be set and a user with permission to create content needs to be signed into ArcGIS online. 

  4. Oriented Imagery tools need to be installed on the same machine. 

Steps for using Python scripts to Create Oriented Imagery catalogs

  • Download the appropriate Python script file depending on the type of imagery to be included in the catalog:

  • Place the Python script file in a folder.
    Modify the following parameters in the Python Script:

    • The path where the MDCS tool is stored in the directory of Oriented Imagery Tools. The location highlighted in yellow in the image below is the generic path where the GP tools are installed, then most likely it won’t need to be changed

    • Make sure the commands shown in the image below are set

    • Name of the new OIC Catalog and Name of the new geodatabase (.gbd) file

  • For the Inspection type of imagery script:

    • Copy the text file containing the list of URL links of the images to be added to the catalog (images must be in a server) to the same folder where the Python script is located.
      In the following example, the Python Script is called “Create_OIC_Inspect.py” and the text file is called “image-list.txt”, both are stored in the same folder:

    • Open the Python script and edit the following parameters:

      • The imgListFile variable is set as “image-list.txt”

      • Modify image parameters: campitch, Carroll, avgHtAG, neardist, and fardist according to the information from each image

  • For the 360 Aerial type of imagery script:

    • Copy the Frame Table file containing the parameters and location of the images to be added to the catalog (images must be in a server) to the same folder where the Python script is located.
      In the following example, the Python Script is called “Create_OIC_Frame.py” and the frame table file is called “frame-table.csv”, both are stored in the same folder:

    • Open the Python script and edit the following parameters:

      • The imgListFile variable is set as “frame-table.csv”

      • Modify images parameters: avgHtAG, neardist, and fardist according to the available information. The values of these parameters will be used in case there is no information in the frame table

  • Set the ArcGIS Python Environment

    •  Open “command prompt” and type the following:

        "C:\Users\<user name>\AppData\Local\Programs\ArcGIS\Pro\bin\Python\Scripts\proenv"

      In this example, <user name> = victoria
  • Run the Python Script

    • Type the following in the command prompt for the corresponding script file :  

      python <location of script>\<script file>

    • Example for the Inspection type of imagery script:

      • <location of script> = “C:\Users\victoria>python C:\Users\victoria\Documents\ArcGIS\Catalog\MDCS_Python_OIC”

      • <script file> = “Create_OIC_Inspect.py”

      • type “python C:\Users\victoria\Documents\ArcGIS\Catalog\MDCS_Python_OIC\Create_OIC_Inspect.py”

         

    • Example for the 360 Aerial type of imagery script:

      • <location of script> = “C:\Users\victoria>python C:\Users\victoria\Documents\ArcGIS\Catalog\MDCS_Python_OIC”

      • <script file> = “Create_OIC_Frame.py”

      • type “python C:\Users\victoria\Documents\ArcGIS\Catalog\MDCS_Python_OIC\Create_OIC_Frame.py”

         

  • Only for the 360 Aerial type of imagery script

    • Go to ArcGIS online, go to Content

    • Locate and open the exposure points layer corresponding to the OIC catalog

      In the example above, the layer is called MDCS_OIC_Test_Frame_ExposurePoints
    • Go to Data

    • Delete the FarDist and NearDist columns

       

  • Check the OIC catalog using our AS Multi-OIC or AS Viewer widgets for Experience Builder or App Builder

Resources:

https://mediaspace.esri.com/media/t/1_q98qok22

https://github.com/Esri/oriented-imagery/blob/master/OrientedImageryCatalog_Schema.pdf

https://doc.arcgis.com/en/imagery/workflows/tutorials/creating-an-oriented-imagery-catalog.htm