Solved

Python startup script to operate on an unpacked zipped File Geodatabase input

  • 30 March 2017
  • 6 replies
  • 2 views

Badge +16

I have a GEODATABASE_FILE reader set to a ZIP file path.

I want to run an ArcGIS geoprocessing tool on the contents before the workspace runs, using ArcPy.

I can see the data unpacks to AppData\\Local\\Temp\\FME_TempFileStore_* directories.

Is it possible to access the unpack location in Python? I can't see the path exposed in FME_MacroValues.

icon

Best answer by mark_f 30 March 2017, 22:18

View original

6 replies

Badge +2

Different approach?

Why not unpack in Python inside the Workspace before running ArcPy, then reading with a FeatureReader.

Badge +16

Different approach?

Why not unpack in Python inside the Workspace before running ArcPy, then reading with a FeatureReader.

Yes I doubt the temp location will be a possible solution, I would use the start up script to unzip or do that in a python transformer before using arcpy.

 

 

Badge +16

Hi, yes I can always unzip but that undoes the goodness of using a zipfile 900MB (in my case) in size and then having to clean up. I need to pivot a table with 10M rows, SQL isn't an option but arcpy. PivotTable_management works great. I'm grasping at straws here :-)

Userlevel 4

Hi, yes I can always unzip but that undoes the goodness of using a zipfile 900MB (in my case) in size and then having to clean up. I need to pivot a table with 10M rows, SQL isn't an option but arcpy. PivotTable_management works great. I'm grasping at straws here :-)

If you unzip your data to the directory path created by the TempPathnameCreator, the contents will be automatically deleted when FME terminates (just before the shutdown script). You can e.g. use the ZipExtractor or the Unzipper from the FME Hub, should be pretty easy.
Badge +16
If you unzip your data to the directory path created by the TempPathnameCreator, the contents will be automatically deleted when FME terminates (just before the shutdown script). You can e.g. use the ZipExtractor or the Unzipper from the FME Hub, should be pretty easy.
Thanks David, good tip, I didn't know TempPathnameCreator.

 

 

Userlevel 4
Thanks David, good tip, I didn't know TempPathnameCreator.

 

 

It's one of those hidden goodies!

Reply