Skip to main content
Solved

Python shutdown scripts and FME Server


ld
Participant
Forum|alt.badge.img+1
  • Participant

Is it possible to alter a workspace's output before it is zipped and made available for download through the data download service?

Specifically, I'd like to output a shapefile, then alter the .prj file using a python shutdown script. All of this before being made available to the user as a zipped download.

Best answer by takashi

Hi @ld, I don't think you can do that with shutdown script, but possibly the File Copy writer can be userd here effectively.

Write the Shapefile dataset into a folder with a FeatureWriter, use the File Copy writer to move the resulting files to the destination folder, and copy the prj file to the same folder using the same File Copy writer.

FME Server would archive the moved/copied files into a zip file to allow the user to download, if you specified the File Copy writer as the destination writer for Data Download Service.

View original
Did this help you find an answer to your question?

3 replies

takashi
Influencer
  • Best Answer
  • July 31, 2018

Hi @ld, I don't think you can do that with shutdown script, but possibly the File Copy writer can be userd here effectively.

Write the Shapefile dataset into a folder with a FeatureWriter, use the File Copy writer to move the resulting files to the destination folder, and copy the prj file to the same folder using the same File Copy writer.

FME Server would archive the moved/copied files into a zip file to allow the user to download, if you specified the File Copy writer as the destination writer for Data Download Service.


Forum|alt.badge.img+2
takashi wrote:

Hi @ld, I don't think you can do that with shutdown script, but possibly the File Copy writer can be userd here effectively.

Write the Shapefile dataset into a folder with a FeatureWriter, use the File Copy writer to move the resulting files to the destination folder, and copy the prj file to the same folder using the same File Copy writer.

FME Server would archive the moved/copied files into a zip file to allow the user to download, if you specified the File Copy writer as the destination writer for Data Download Service.

Would you add a PythonCaller transformer here between the FeatureWriter (shp) and filecopywriter?

 

 


ld
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • August 1, 2018
takashi wrote:

Hi @ld, I don't think you can do that with shutdown script, but possibly the File Copy writer can be userd here effectively.

Write the Shapefile dataset into a folder with a FeatureWriter, use the File Copy writer to move the resulting files to the destination folder, and copy the prj file to the same folder using the same File Copy writer.

FME Server would archive the moved/copied files into a zip file to allow the user to download, if you specified the File Copy writer as the destination writer for Data Download Service.

Thanks. I ended up writing a shapefile with no CRS (CoordinateSystemRemover), then writing a .prj file separately to the same destination (Text File Writer).

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings