Mosaic Dataset Footprints - As Built

3394
3
10-20-2015 10:13 AM
Labels (1)
GeorgeNewbury
Occasional Contributor

Was wondering if there are any stock tools or if anyone has written custom python code for exporting the footprints of a mosaic dataset as they would be assembled in the final mosaic at a given scale. My use case is overlapping imagery and elevation data taken at over a multi year period. i have the mosaic dataset configured to display the latest imagery on top and I'm using the MD to export a finished tile set, exported tiles are 0.01 deg x 0.01 deg in JPG2000 format. The idea being that a user could take this tileset for general mapping purposes and not need to worry about the individual imagery and elevation files that went into creating it.

However, I'd also like a vector dataset of the footprints to ride with the tileset so that an interested user could get a lineage of the data, i.e. the date of the original data and the original file name. I wrote my own tool to export the footprints, stack, and flatten them to get a latest on top feature class, but a built in tool would be preferred.

Any ideas would be appreciated.

Thanks

George Newbury

Alexandria, VA

0 Kudos
3 Replies
GabrielUpchurch1
Occasional Contributor III

Not sure if it will get you specifically what you need but the Export Mosaic Dataset Geometry tool has a query parameter.

CodyBenkelman
Esri Regular Contributor

George

Great question - but (in most cases) what you're seeking will require use of seamlines rather than footprints.

Keep in mind the footprint defines the extents of the source raster, and where those rasters overlap, the footprints will always overlap.  But in any static view of the mosaic dataset, or an output that you write to disk, only one pixel will ultimately appear on top - so what you want is to identify those boundaries between source pixels.

We discussed this in an Esri Live Training Seminar (LTS) for image caching.  (If you want to invest an hour, the recording is available at http://esriurl.com/ImageCacheLTS)  The objective was to publish a feature service along with a base map (raster tile cache) to allow users to click on any pixel and get its metadata, something not normally possible in a base map.

Note that for the LTS, we published a set of tools that will do this - see the landing page in the Resource Center at http://esriurl.com/ImageManagement and follow the link to this Group on ArcGIS Online for workflow-specific example scripts and data, then find the item for the Raster Tile Cache Tools (direct link here: http://www.arcgis.com/home/item.html?id=b66bdaa9cec247c087cc836ada6fe2b1  )

The first tool in that collection is called "Create Cache Metadata", and this will do what you're seeking - input a Mosaic Dataset and it will generate a feature class showing the pixel boundaries along with all metadata from the Mosaic Dataset.  NOTE: Since some mosaic methods will dynamically change the view as a user pans and zooms, your Mosaic Dataset must use a default mosaic method that does NOT change with viewpoint - options are NorthWest, ByAttribute, Closest to Viewpoint, or Seamline.

            (Note, depending on the complexity of your mosaic dataset, you may need to apply a few edits to get the desired output - specifically, you may need to make a copy of the mosaic dataset and remove its overviews such that only source data records are included before running the "Create Cache Metadata" tool...

To complete the discussion (if you'd prefer to do this manually), what this tool does is generate the seamlines feature class using a copy of the footprints (based on the defined mosaic method) and then run a tool that clips the seamlines in the appropriate order. 

I hope that is helpful

Cody B

GeorgeNewbury
Occasional Contributor

Cody,

I used the tool, but the resulting output *_ccm feature class, still has overlapping polygons. My mosaic method is by attribute, based on a date field, with a base value of 2030, and order ascending. No overviews. I looked at the python code for the CCM tool, and it didn't appear to do anything special in terms of flattening the pancake like stack of overlapping polygons. It looks like it just generates seamlines and then joins the metadata from the footprints FC. Am I missing something?

I wrote my own code to flatten the stack, it basically

- intersects a feature class (seamlines or footprints) with itself

- runs a search cursor through the result and populates a dictionary with key-value pairs of [SHAPE@JSON] = (Raster OID, Collect Date), with the latest collect date

- Runs through the intersect result again and deletes any FCs that don't have an OID in the dictionary

- Dissolves the updated intersect result based on the original raster name

I used the SHAPE@JSON because it is a unique string and is easily compared within python. I see one of the problems with the seamlines is that it still requires a polygon for each raster item, correct? If one raster completely  covers another raster then there should be no entry for the covered raster. Does the seamline class require a one-to-one correspondence with the footprints and raster tables?  Or would it be able to have records with a null geometry?

George

0 Kudos