Skip to main content
Solved

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


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.

View original
Did this help you find an answer to your question?

4 replies

danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • 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
danilo_fme wrote:

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+19
  • 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
daveatsafe wrote:

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!!

Reply


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