One method: By exploring the REST API service page and it's sub-pages, especially Estimate Export Tiles Size, you can test and refine input parameters until usable results are achieved.
generate a footprint polygon and convert Features to JSON
Go to the service url and login
At bottom of page open Estimate Export Tile Size
Paste your JSON footprint poly into "Area of interest" text field.
In "Export By" select a Level ID
number you think has imagery for your AOI and level of detail then submit [GET]. (Use a range, i.e. 1-17
, to include overviews.)
- Follow link for "Check job details" and then "out service url"
- if
totalSize
and totalTilesToExport
are 0 go back and choose a lower Level ID
and resubmit
Go back to main service url and choose Export Tiles at page bottom.
- Change "Tile Package" to
true
and set other parameters as per the working Estimate above.
- follow on to "out service url" as before. In the results are a URL shown as text, not a link. Copy paste that into address bar. If everything worked it will have a downloadable
Layers.tpk
tile package. Download it!
Screenshots
Notes:
The polygon JSON coords do not need to be web mercator! Any valid EPSG wkid
will work. They do need to be Esri JSON though, not GeoJSON.
Don't despair if opening the .tpk shows 'Layers' in table of contents but nothing in the map area. It just means there are no overview pyramids in the package, zoom in several times.
During the Job Status phase 0 percent messages mean that zoom level is empty and you can drop them from the Level
range.
esriJobMessageTypeInformative: Estimated Time Remaining: Calculating...
esriJobMessageTypeInformative: Finished:: 0 percent
"ERROR 001461: Failed to package tiles" - probably means tile cache is too large, select a smaller Level
range and try again.
Theoretically the 'Export Map' sub-page should allow exporting a single image up to the max size reported on the main service page (4096 x 4096), but I always got zero results when putting any image size parameters in at all.