Skip to main content
Solved

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

  • May 28, 2013
  • 1 reply
  • 19 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
View original
Did this help you find an answer to your question?
<strong>This post is closed to further activity.</strong><br /> It may be a question with a best answer, an implemented idea, or just a post needing no comment.<br /> If you have a follow-up or related question, please <a href="https://community.safe.com/topic/new">post a new question or idea</a>.<br /> 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

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