AnsweredAssumed Answered

Publishing multiple shapefiles to single Hosted Feature Service in Portal

Question asked by d.mastesri-de-esridist Employee on Apr 18, 2018
Latest reply on Apr 27, 2018 by d.mastesri-de-esridist

I have a script tool using the Python API that receives a list of Urls to zip files on a server with multiple shape files inside. Each zip file contains exactly the same number of shapefiles with the same names and schemas. I would like to publish all the shapefiles to a single Hosted Feature Service in Portal but I cannot find any way to publish multiple files together or to merge the shapefiles or Hosted Feature Services once created. Is there a supported workflow for doing this?

 

At the moment I am doing this to end up with one Hosted Feature Service per shapefile:

for zip_Url in zip_Url_List:
    shp_file = gis.content.add(item_Properties, zip_Url)
    published_service = shp_file.publish()  
    shp_file.delete()

I found the function append() on a Feature Layer in the API documentation but it seems this is only available for AGOL. 

 

The only workaround I can see is to download all the shapefiles locally, unzip them, merge the shapes with same names using arcpy, zip them again, add the shapefiles, and publish the services but this would add potentially very long processing times since some of the shapefiles can be quite big. This tool is meant to run on a button click in a web application so performance is important to not keep the user waiting any longer than necessary.

 

Thank you in advance for any recommendations

Outcomes