Skip to main content
Question

Returning the SDE featureclass name from a layerfile

  • August 18, 2020
  • 7 replies
  • 40 views

I have a folder containing a number of esri lyr files which are used to render data in ArcMap, I would like to return the name of the Esri Featureclass from the lyr file, I have attempted to do this by using both the Esri ArcGIS Layer reader and the Schema Reader and attempted to expose the ARCGIS_LAYER_DATASET using the "AttributeExposer" but it only returns <missing> .

Any assistance with this is greatly appreciated. Many thanks

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.

7 replies

deanhowell
Influencer
Forum|alt.badge.img+24
  • Influencer
  • 315 replies
  • August 18, 2020

Hello @dntw​ I just tried the text file reader and tested for the word dataset

1

 

2


  • Author
  • 5 replies
  • August 18, 2020

Hello @dntw​ I just tried the text file reader and tested for the word dataset

1

 

2

Hi @deanhowell​ thanks for the suggestion I have attempted to follow what you have suggested but I am unable to extract the the dataset value, im guessing because the esri layer file is binary?fme_textfilereader

fme_textfilereader_visualpreview

 

 


deanhowell
Influencer
Forum|alt.badge.img+24
  • Influencer
  • 315 replies
  • August 18, 2020

Hi @deanhowell​ thanks for the suggestion I have attempted to follow what you have suggested but I am unable to extract the the dataset value, im guessing because the esri layer file is binary?fme_textfilereader

fme_textfilereader_visualpreview

 

 

Maybe try the BinaryEncoder transformer after reading in the layer file. I was able to read a small layer file directly but maybe different settings in ArcGIS cause it to be saved in different ways ​


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • August 18, 2020

Have you exposed arcgis_layer in the lyr reader?

Capture

 

 


  • Author
  • 5 replies
  • August 18, 2020

Have you exposed arcgis_layer in the lyr reader?

Capture

 

 

Thanks for the suggestion, but yes have tried that and that is returning the name of the featureclass as it have been labelled in the layer file and not the name of the esri featureclass itself


  • Author
  • 5 replies
  • August 18, 2020

Hi @deanhowell​ thanks for the suggestion I have attempted to follow what you have suggested but I am unable to extract the the dataset value, im guessing because the esri layer file is binary?fme_textfilereader

fme_textfilereader_visualpreview

 

 

Have just tried using the Binary encoder but unfortunately still not passing the tester 😞 Thanks so much for the suggestion anyway.

Binaryencoder


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • August 18, 2020

Thanks for the suggestion, but yes have tried that and that is returning the name of the featureclass as it have been labelled in the layer file and not the name of the  esri featureclass itself

ArcPy then? If you have a feature that contains the path of the lyr file

import fme
import fmeobjects
import arcpy
 
def processFeature(feature):
    desc = arcpy.Describe(feature.getAttribute('lyr_path'))
    feature.setAttribute('FC_Name',desc.dataElement.catalogPath)