Skip to main content
Solved

Extracting coordinate system from FILE GDB Feature Dataset when feature class is empty.

  • October 13, 2017
  • 4 replies
  • 97 views

dfresh
Forum|alt.badge.img

Say I have a FILE GDB called Fruit with the following feature datasets (Oranges).

say there are not feature rows inside Peel or Slices feature classes. how can I extract the coordinate system

Fruit

  • Oranges (feature dataset)
    • peel (feature class)
    • slices (feature class)

In arcCatalog I can easily right click the feature dataset and go to the XY coordinate system tab to see this.

methods I have tried in FME

  • TCPL start up script - (here I extract domains and geometry type, but no COORD systems)
  • populating a single row in FME, than reading trying coordinate extractor
  • python caller - this will not work if feature dataset is empty

Thanks,

Doug

Best answer by daveatsafe

Hi @dfresh,

If you use the Esri Geodatabase (ArcObjects) reader, you have the option to set the Feature Read Mode to Metadata. This will allow the reader to return a metadata feature for each feature class.

The metadata feature geometry will be the bounds of the feature class, in the feature class coordinate system, so you can use a CoordinateSystemExtractor to get the coordinate system name in an attribute.

If you want the Esri WKT for this coordinate system, you can use the CoordinateSystemDescriptionConverter transformer to convert the attribute containing the FME coordinate system name to Esri WKT.

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.

4 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • October 13, 2017

Hi @dfresh,

Did you try to use a PythonCaller and a scrpit to get the coordinatesystem:

import fme
import fmeobjects
def _sistema_coord(feature):
    
    csMgr = fmeobjects.FMECoordSysManager() # call coord system
    
    cs = feature.getCoordSys()  #get the coord system of features
   
    if cs != None and cs != '':
        
        params = csMgr.getCoordSysParms(cs)
        if 'EPSG' in params:
            
            loc = params.index('EPSG') + 1  
            feature.setAttribute('EPSG',params[loc])

But i believe to need to have a feature beforr this transformer.

Thanks,

Danilo


dfresh
Forum|alt.badge.img
  • Author
  • October 13, 2017

Hi @dfresh,

Did you try to use a PythonCaller and a scrpit to get the coordinatesystem:

import fme
import fmeobjects
def _sistema_coord(feature):
    
    csMgr = fmeobjects.FMECoordSysManager() # call coord system
    
    cs = feature.getCoordSys()  #get the coord system of features
   
    if cs != None and cs != '':
        
        params = csMgr.getCoordSysParms(cs)
        if 'EPSG' in params:
            
            loc = params.index('EPSG') + 1  
            feature.setAttribute('EPSG',params[loc])

But i believe to need to have a feature beforr this transformer.

Thanks,

Danilo

yes you do need a feature, so this one wont solve it.

 

 


daveatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • Best Answer
  • October 13, 2017

Hi @dfresh,

If you use the Esri Geodatabase (ArcObjects) reader, you have the option to set the Feature Read Mode to Metadata. This will allow the reader to return a metadata feature for each feature class.

The metadata feature geometry will be the bounds of the feature class, in the feature class coordinate system, so you can use a CoordinateSystemExtractor to get the coordinate system name in an attribute.

If you want the Esri WKT for this coordinate system, you can use the CoordinateSystemDescriptionConverter transformer to convert the attribute containing the FME coordinate system name to Esri WKT.


dfresh
Forum|alt.badge.img
  • Author
  • October 17, 2017

Hi @dfresh,

If you use the Esri Geodatabase (ArcObjects) reader, you have the option to set the Feature Read Mode to Metadata. This will allow the reader to return a metadata feature for each feature class.

The metadata feature geometry will be the bounds of the feature class, in the feature class coordinate system, so you can use a CoordinateSystemExtractor to get the coordinate system name in an attribute.

If you want the Esri WKT for this coordinate system, you can use the CoordinateSystemDescriptionConverter transformer to convert the attribute containing the FME coordinate system name to Esri WKT.

Thanks @DaveAtSafe

 

you solved it, I completely forgot about the metadata feature read mode. this is exactly what I need. thanks!!