1

Considering that I have managed to upload a data file like a shapefile on a geoprocessing service. How can I handle it inside of ModelBuilder. For Example I would like to use the shapefile I have uploaded as input to a ModelBuilder tool. How can I do that? Do I have to use Python so as to do that or it is possible in ModelBuilder? any examples ?

  • If it is a file ArcGIS can use directly (a raster file, for instance), then you can use a GP tool that will access the file (stored somewhere on the drive). If it is a .zip file, you would need to incorporate a Python script that will unpack the archive and then return the path to the data you need to the tool in a model. I would abandon the ModelBuilder altogether though and do everything with pure Python and arcpy. So much easier to handle the published resources (code + data if any). – Alex Tereshenkov Jan 14 '15 at 13:32
  • Thanks for the notice @AlexTereshenkov. In fact what I need to upload and handle is a shapefile. As I know shape file Must be in a zip file, since it should be uploaded along with a group of other files. 1) Is that correct ? 2) Is the only way to handle this through python ? (since the group of files is within a zip) 3) In python should I use GPdataFile only to retrieve the already uploaded file ? – Smalis Jan 14 '15 at 13:59
  • 1. You need an archive with all the shapefile files, right. 2. There is no core support for unpacking .zip files with ModelBuilder, so you need Python. 3. You don't really need a GPDataFile afterwards - you unpack to a temp folder (GP service scratch GDB within arcgisserver folder usually works well) and then you can start executing the code just as if it was working with some local data on your disk. – Alex Tereshenkov Jan 14 '15 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.