Skip to main content

Question: Is it possible to have FME write .ovr files with a GeoTIFF (Georeferenced Tagged Image File Format) writer?

 

The Solution I am hoping for:

  • An FME solution for writing .ovr pyramid files
  • 2nd best would be solutions to the Python/ArcPy errors I'm getting when running ArcGIS geoprocessing tools
  • 3rd best would be another plan for writing .ovr files.

My Software:

  • Safe: FME(R) 2018.1.0.3 (20180926 - Build 18552 - WIN64)
  • Esri: ArcGIS desktop 10.6.1 version 10.6.1.9270 with Background Geoprocessing (64-Bit)

Basic Background:

I am developing a process for a couple thousand tiff images that will be used in ArcGIS (it's not relevant but I'm using a parent workspace with WorkspaceRunner to run this child workspace). Ideally my FME workspace would write GeoTIFF images with pyramids in a format read by ArcGIS (apparently its an .ovr file), that way the features written are a final product for use in ArcMap.

 

The Issue I am having:

My problem is that I am not able to get the GeoTIFF writer's "Generate Pyramids" parameter or the RasterPyramider transformer to write an .ovr with the .tif.

When an image is imported into ArcMap, ArcGIS looks for a .ovr file (imagename.tif.ovr) for pyramids; if an .ovr is not found then ArcGIS prompts the user to create pyramids.

ArcGIS provides methods to overcome this: with lots of images ArcMap can take a lot of time and processing power to generate the pyramids, however I can use the ArcGIS "BuildPyramids" or "Batch Build Pyramids" geoprocessing tool to build these pyramids reasonably quickly.

As mentioned above, I'd like to have the entire process contained within FME and it seems like FME should be up to the task.

 

What I've tried - (a) - RasterPyramider & GeoTIFF writer

I've read over and tinkered with FME's article "Raster Pyramiding Example" (as well as a few posts that popped up such as this one with no luck).  Since I didn't see any mention of .ovr files on the FME website so I moved on to python.

 

What I've tried - (b) - Python Caller

On the ArcGIS end I'm using ArcGIS desktop 10.6.1 Python is not my strength, however I attempted to use a PythionCaller to run this arcpy script:

 

import fme
import fmeobjects
import arcpy

#Build Pyramids for single Raster Dataset
#Define the type and compression of pyramids in the tool
#Skip if dataset already has pyramids


def processFeature(feature):
  Â  # Get tif Image FC and settings from feature attributes
  Â  dataset = feature.getAttribute('fme_dataset')
  Â  arcpy.env.workspace = dataset
  Â Â 
  Â  #Set Local Variables
  Â  imageName = feature.getAttribute('_filename')
  Â  inras = imageName
  Â  pylevel = "8"
  Â  skipfirst = "NONE"
  Â  resample = "NEAREST"
  Â  compress = "DEFAULT"
  Â  quality = "90"
  Â  skipexist = "SKIP_EXISTING"

  Â  arcpy.BuildPyramids_management(inras, pylevel, skipfirst, resample, compress, quality, skipexist)

This resulted in this error:

Python Exception <ImportError>: No module named arcpy

So I searched around and reviewed these threads:

 

What I've tried - (c) - Python Caller

I tried a number of the things suggested, it seemed the most successful was adding this to the PythonCaller:

import sys

fmePydPath = r'C:\Program Files (x86)\ArcGIS\Desktop10.6\arcpy' Â #Add arcpy directory
fmePydPath2 =r'C:\Program Files (x86)\ArcGIS\Desktop10.6\bin' #Add arcgis directory
if fmePydPath2 not in sys.path: sys.path.append(fmePydPath2) Â #Try to add path
if fmePydPath not in sys.path: sys.path.append(fmePydPath)

This got me past the previous error and moved me right along to getting this error:

Python Exception <ImportError>: DLL load failed: %1 is not a valid Win32 application

 

Some how that felt like an improvement...

This error led me to the ArcGIS forum community. I tested out a number of suggestions but unfortunately I found no working solution (example: https://community.esri.com/thread/69510).

Without a stroke of genius I' suppose I'll need to uninstall/reinstall ArcGIS and their x64 processing.

 

Hi @joshuadamron, Unfortunately I can confirm that FME Currently don't support writing of .ovr files, although we do support generating internal pyramid. I've added your question here to our enhancement tracking system internally. Also, I created an Idea on your behalf, this allows the community to vote for ideas they support, which helps gather motivation for the development. Can you please add some details on why this is important to you in this idea?

 

 

As for the alternative solutions you are hoping for, I'm not the right person to provide suggestions, but hopefully the community here can give you some tips.

Hi @joshuadamron

My apologies for the trouble! The threads you have linked on using arcpy with FME are from 2016 and the method to specify the Python interpreter have changed.

Users can access the arcpy module in FME 2017+ by setting the workspace's Python Compatibility parameter as Esri ArcGIS Desktop (Python 2.7). This parameter tells FME to use the Python interpreter of ArcGIS Desktop instead of FME's own bundled interpreters.

Once you have set this parameter, it eliminates the need to set the import path so you should remove the section of Python script in "What I've tried - (c) - PythonCaller".

You should now be able to use your script in the PythonCaller. I hope this helps.


Hi @joshuadamron

My apologies for the trouble! The threads you have linked on using arcpy with FME are from 2016 and the method to specify the Python interpreter have changed.

Users can access the arcpy module in FME 2017+ by setting the workspace's Python Compatibility parameter as Esri ArcGIS Desktop (Python 2.7). This parameter tells FME to use the Python interpreter of ArcGIS Desktop instead of FME's own bundled interpreters. 

0684Q00000ArK6ZQAV.png

Once you have set this parameter, it eliminates the need to set the import path so you should remove the section of Python script in "What I've tried - (c) - PythonCaller". 

You should now be able to use your script in the PythonCaller. I hope this helps.

Thank you @DebbiAtSafe, I had tried setting the Python Compatibility parameter as Esri ArcGIS Desktop (Python 2.7) without luck. 

I went ahead and tried that again (removing the "What I've tried - (c) - PythonCaller" section), however I continue to get that same error.

 

|ERROR |Python Exception <ImportError>: No module named arcpy

 


Thank you @DebbiAtSafe, I had tried setting the Python Compatibility parameter as Esri ArcGIS Desktop (Python 2.7) without luck. 

I went ahead and tried that again (removing the "What I've tried - (c) - PythonCaller" section), however I continue to get that same error.

 

|ERROR |Python Exception <ImportError>: No module named arcpy

 

Would you be able to upload the workspace and log file? It will help provide information about what is occurring in your workspace.


Would you be able to upload the workspace and log file? It will help provide information about what is occurring in your workspace.

@DebbiAtSafe thank you for your assistance. I switched over to another project for a few days and when I came back this script ran fine. Doesn't mater now but it seems like FME didn't process that the 'Python Comparability' parameter was set to "Esri ArcGIS Desktop (Python 2.7)".

Not sure what the glitch was but that glitch seemed to continue despite restarting and shutting down my workstation several times. Just glad its working :-)

 


Reply