Skip to main content
Solved

How to read an SDE feature class with fmeobjects in Python?

  • May 28, 2013
  • 1 reply
  • 25 views

Forum|alt.badge.img
Does anyone have any examples of reading an SDE feature class with fmeobjects in Python?

 

 

I was able to do it with a shapefile without any issue but am having trouble figuring out how and where to specify the parameters for the GEODATABASE_SDE format.

 

 

I am using an SDE connection file if that makes it any easier. However, whenever I try to open() the reader it pops up the SDE connection properties dialog. I get the feeling I'm just not specifying the reader parameters/directives correctly, but without finding any examples of the proper format I can only guess.

 

 

Thanks!

Best answer by david_r

Hi Logan,

 

 

good to see that you fond a solution. One good tip for constructing the connection parameters, is to use the FMEDialog class to let you interactively specify the parameters, then storing the result as a constant in your script for consequtive runs. Example:

 

 

-----

 

dialog = FMEDialog()

 

directives = dialog.sourcePrompt("SDE30", "sde")

 

# ... further on ...

 

reader = FMEUniversalReader("SDE30", False, directives[2])

 

-----

 

 

The sourcePrompt (or destinationPrompt, if you prefer) will give you the same connection dialog as used by the Workbench, returning a connection string that you can use to connect to your data.

 

 

David
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

david_r
Celebrity
  • Best Answer
  • May 30, 2013
Hi Logan,

 

 

good to see that you fond a solution. One good tip for constructing the connection parameters, is to use the FMEDialog class to let you interactively specify the parameters, then storing the result as a constant in your script for consequtive runs. Example:

 

 

-----

 

dialog = FMEDialog()

 

directives = dialog.sourcePrompt("SDE30", "sde")

 

# ... further on ...

 

reader = FMEUniversalReader("SDE30", False, directives[2])

 

-----

 

 

The sourcePrompt (or destinationPrompt, if you prefer) will give you the same connection dialog as used by the Workbench, returning a connection string that you can use to connect to your data.

 

 

David