Search code examples
gisarcgisarcgis-server

How to programmatically ingest PNG images into ArcGIS server for tile layer display


I have recently started to familiarize with ArcGIS. Reading tile layers seems pretty straight forward. However, I would like to ingest my own PNG imagery files and read them through a web service call programmatically using either Java or Python. I have not been able to find a straight solution.

I have a system that generates PNG images. I would like to programmatically call the ArcGIS server web service API to ingest the PNG images into a layer as tiles and at the same time add the tiles to a cache. Which API/service call will support this operation? I will appreciate either a high level explanation of steps or a detailed explanation.


Solution

  • You could use a python script published as a geoprocessing service and use the REST API to call the images from your web application.

    1. Place your tiles folder somewhere ArcGIS Server have access
    2. Create a toolbox using a python script with parameters: string input and file output (derived)
    3. Program a python script that will take the string input such "/0/0/0.png" etc... (arcpy.getParameter) and parse it to go take the correct images in the correct folder, and serve it as output (arcpy.SetParameter)
    4. In your map api use the the geoprocessing service url such http://www.myArcgisServer.com/rest/services/myTilesServer?{x}/{y}/{z}.png to call the tiles as needed