Oblique Imagery - Adding Rasters to Mosaic dataset with Python

1449
9
09-13-2018 04:30 AM
CarstenBøcker
New Contributor II

I am creating a series of mosaic datasets with oblique imagery. As I have quite a lot of data I would like to automate the process. Formatting frame and camera table is pretty standard, as well as creating the mosaic dataset. However, when adding the rasters with Add Rasters To Mosaic Dataset Tool, I don't seem to be able to specify the camera table in the raster type properties.

Manually i would do like this:

   Select Frame Camera as Raster Type

   Click the Raster Type properties button

   Select the Frame Camera tab and specify the camera table

How can I do this with Python?

Regards

Carsten

0 Kudos
9 Replies
DanPatterson_Retired
MVP Emeritus

To script anything in python for use in a toolbox or directly as a script, you need to see the code samples for the ArcToolbox tools you are using... for example

Add Rasters To Mosaic Dataset—Data Management toolbox | ArcGIS Desktop 

or to access information in arcpy

Mosaic Dataset properties—ArcPy Functions | ArcGIS Desktop 

do note that not all functionality or workflow in arcmap or ArcGIS Pro can be emulated using python.  Those tasks are relegated to the every friendly arcobjects.

0 Kudos
CarstenBøcker
New Contributor II

Dan,

Thanks. I was afraid (or rather pretty sure) in advance that it couldn't be done in ArcPy. But i thought I would ask in case I had overlooked something.

As I have a limited number of unique cameras, I could probably make a workaround by wrapping Add Rasters in a model for each camera with the table set in advance, and then just change mosaic datasat and frame table.

I haven't worked with ArcObjects since version 9.x, so I'll skip that one, but I was desperate enough to consider it 🙂

0 Kudos
GuenterDoerffel
Esri Contributor

Carsten,

sure this can be done with scripting, python. There are two ways for you to do it. The 'hook-in' is the same in both cases: The 'Add rasters to mosaic dataset tool' has the Raster Type as a parameter. This Raster Type can be any raster type coming from a *.art file. To create the art-File, you follow excactly the workflow you describe above for a manual add, but then - in the General Tab of the Raster Type Properties - save your settings (including your camera table) into a seperate art-File, which now will be your custom raster type:

Specify this in your script - and there you go.

If you look for a very convenient, powerful and flexible way of defining and running workflows like these in the future, please check out (this is option 2) MDCS (GitHub - Esri/mdcs-py: MDCS is an acronym for Mosaic Dataset Configuration Script and is the entry p... ). A great framework for mosaic dataset related tasks. Are you in Europe? I'd be glad to discuss this with you - we have many samples and good workflow recommendations here at Esri.

Regards
Guenter

CodyBenkelman
Esri Regular Contributor

Thanks to Guenter for the prompt reply, and accurate advice.

I want to add that we have more resources re: the mosaic dataset and automation using MDCS at this link ArcGIS Imagery Workflows | ArcGIS.  On this landing page, if you will follow the link to our ArcGIS Online Group, you will find a sample dataset for the Frame Camera raster type (here), and we will be posting a sample script based on MDCS very soon - I will update this post with a link when the script is available.

Thanks

Cody B. 

CarstenBøcker
New Contributor II

Guenter and Cody,

Thanks for the advice. I went for Guenters art-file solution. Works beautifully.

I have used MDCS for arial imagery, but it did not occur for me to use it for frame camera data. I'll look into it.

Regards

Carsten

0 Kudos
GuenterDoerffel
Esri Contributor

Carsten,

let us know if you run into any problems setting this up. We have done that often and can assist. We also have MDCS scripts that assist.

Guenter

0 Kudos
DanPatterson_Retired
MVP Emeritus

Guenter, any plans to move this into the existing toolsets for ArcGIS Pro?

0 Kudos
GuenterDoerffel
Esri Contributor

Dan,

my answer is probably misleading: Everything IS in there

  • As part of the OrthoMapping Workflows
  • As tools in the GP environment (Raster type frame camera, calculate tie points, build block adjustment, ... )
  • As configurable tools (calling GP tools) in MDCS
  • (Also as OrthoMaker in Server/Image Server lately - this is for Drone data only)

The part people sometimes need assistance with is to figure out how to get their data into the Frame and Camera tables, especially if they do not get full calibration report, specs, ... so it is more about workflows and some additional know/how - experience. As Cody states above, some of this is going to be wrapped up and published to ease the use in MDCS.

Guenter  

DanPatterson_Retired
MVP Emeritus

Good to know Guenter… thanks

0 Kudos