Skip to main content

I have hit a wall. I realize that job downloader in FME Server will zip the files but I am in a situation where I must use Job Submitter, but I need the final results to then be zipped for download. The entire problem originates from a need to use custom projections for the shapefiles. Here is the process:

  1. read in CADD files and other data from Excel files
  2. Process the information and create Shapefiles using FeatureWriter
  3. Read in the custom projection and write the prj file into the shapefiles using FileCopy writer.

This saves all of the shapefiles as individual files. Since I might have 15 shapefiles, at 8 files per shapefile, I end up with over 100 filesto download. I would like to then zip up all of the shapefiles to make one easy download either for each shapefile or, preferable, for the whole batch.

Please note - I am using job submitter because the prj file cannot be added to the file created in data download.

DGN2GIS_Step2GB_CategorizedShapesProjection.fmwDGN2GIS_Step2GB_CategorizedShapesProjection.fmw

Hi @tsurveyor,

Unfortunately I get an error when I try and download the attached workspace. However I think we can help you anyway. If you would like to use the Job Submitter rather than DataDownload service then you will need to zip the files when they are written in FME Workbench. Please see the documentation on how to do this: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/zip_files_writing.htm?


Hi @tsurveyor,

Unfortunately I get an error when I try and download the attached workspace. However I think we can help you anyway. If you would like to use the Job Submitter rather than DataDownload service then you will need to zip the files when they are written in FME Workbench. Please see the documentation on how to do this: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/zip_files_writing.htm?

That seems like the answer but here is the logistical problem. FIRST, the shapefile files are saved as separate files on the server. THEN filecopy adds a prj file that has the same name as the previous shapefile; one prj for each shapefile name. So if I zip the shapefiles when created with the FeatureWriter, I don't have a place to insert the prj file. If I wait to insert the prj file then zip the files, I would need a way to combine all of the files that are written, or an alternative would be to zip the files by the shapefile names. Either way I cannot do it with the FileCopy.

The entire problem is that FME will not bring in a custom projection and insert it into the process. WHY, I don't know. The FME process for custom projections is very user unfriendly. There is not a single project I work on in Colorado that does not have a custom projection because of the elevation problem. We create custom prj files that are nothing but text files; it is that file I am writing directly into the shapefiles at the end. Why can't I do it before I write the files?!

It just seems like a problem that should not exist.


Hi @tsurveyor,

Unfortunately I get an error when I try and download the attached workspace. However I think we can help you anyway. If you would like to use the Job Submitter rather than DataDownload service then you will need to zip the files when they are written in FME Workbench. Please see the documentation on how to do this: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/zip_files_writing.htm?

The functionality to write zip file is available in the File Copy writer too.

After completion of all the translation, you can use the FeatureReader (Format: Directory and File Pathnames [path]) to read all the resulting files in the destination folder, then send them to the File Copy writer to move them into a single zip file.


The functionality to write zip file is available in the File Copy writer too.

After completion of all the translation, you can use the FeatureReader (Format: Directory and File Pathnames [path]) to read all the resulting files in the destination folder, then send them to the File Copy writer to move them into a single zip file.

Hi @tsurveyor,

As Takashi mentioned rather than zipping the files in the shp writer you can do this after the FileCopy with the prj files.

 

If you feel there is an enhancement request here might I suggested you post an idea. These ideas are reviewed by our product owners and do help us make decision on how we can continue to improve FME. It also allows other users to add their input as well. It seems your idea is similar to this post https://knowledge.safe.com/content/idea/21554/write-a-prj-file-when-a-cad-file-output-is-written.html which was released so something similar may be possible.

Hi Takashi, I had to run off to take care of some billable work. I just don't see where this fits in. Attached is a picture of my workbench. I am using list exploder to access the shapefile so I can insert a prj file using the filecopy. I'm not sure where I can then read all of those files to compress into one zip file. If I do a feature reader before filecopy I still have individual files at filecopy. I don't see a way to run it after within the same workbench. What am I missing?


Hi Takashi, I had to run off to take care of some billable work. I just don't see where this fits in. Attached is a picture of my workbench. I am using list exploder to access the shapefile so I can insert a prj file using the filecopy. I'm not sure where I can then read all of those files to compress into one zip file. If I do a feature reader before filecopy I still have individual files at filecopy. I don't see a way to run it after within the same workbench. What am I missing?

OK I think I have it. When I created the filecopy writer, I needed to make it a zip file. Is this correct? Right now the destination folder is just ".", do I change it to .\\..zip? I know this seems like a pretty basic question. Or can I now name the zip file hear, such as .\\name.zip?


Reply