How can I add only the GeoTIFFs that falls within a polygon to my MOSAIC dataset?

1135
1
Jump to solution
10-22-2016 10:23 AM
Arild_MJohannessen
New Contributor II

I'm building a tool with ModelBuilder in ArcGIS Pro v1.3. The tool will allow the user to replace an outdated map in a Mosaic Dataset with a new updated one. This is done by choosing the Mosaic Dataset and approximately 53 GeoTIFFs from a folder (this is the entire content of the update folder). This gives nationwide coverage and then some.

The following will then happen.

  • All old data will be deleted from the dataset
  • The new TIFFS will be loaded.
  • The footprint of all 53 TIFFs will be clipped by a polygon covering the nations boundary.

My problem is that three of the GeoTIFFS falls outside of the clipping polygon. Because of this, the exported footprint are totally removed by the clipping. When I now update the Mosaic with the tool Import Mosaic Dataset Geometry, only the 50 remaining polygons will find a match among the footprints. These 50 are updated, while the three without a match is left untouched.

How can I get rid of the remaining three? The ideal solution is to never add them in the first place, but how?

One important note is that these GeoTIFFs are a finished product ready for printing, however the bordering countrys information is not to good, so I'll lay this on top of better map for that area before exporting to PDF for print. This means that no pixel processing is acceptable during the entire workflow as this leads to artifacts on small features especially on small text.

0 Kudos
1 Solution

Accepted Solutions
Arild_MJohannessen
New Contributor II

I've found the solution to this problem. At the end I had to write a custom tool for the job.

Attached is the Python code as I had it during testing and debugging (FindCorrectMap.py). It can be pasted directly into the Python command line and run by pressing Ctrl+Enter. For those of you who haven't dived into Python yet, it can be educational to try this exercise.

After the code was completed and tested, I added a new toolbox by selecting New Python Toolbox. This is found in the Toolboxes right-click-menu in the Project pane. I then pasted the code into the template, filled out the blanks and ended up with a working tool. This is also attaced (MyTools.pyt).

At last, I used ModelBuilder to Add Rasters to Mosaic Dataset. As inputs, I used my Mosaic and the output from my new tool.

View solution in original post

1 Reply
Arild_MJohannessen
New Contributor II

I've found the solution to this problem. At the end I had to write a custom tool for the job.

Attached is the Python code as I had it during testing and debugging (FindCorrectMap.py). It can be pasted directly into the Python command line and run by pressing Ctrl+Enter. For those of you who haven't dived into Python yet, it can be educational to try this exercise.

After the code was completed and tested, I added a new toolbox by selecting New Python Toolbox. This is found in the Toolboxes right-click-menu in the Project pane. I then pasted the code into the template, filled out the blanks and ended up with a working tool. This is also attaced (MyTools.pyt).

At last, I used ModelBuilder to Add Rasters to Mosaic Dataset. As inputs, I used my Mosaic and the output from my new tool.