Skip to main content

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

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

1

 

2


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

 

 


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 ​


Have you exposed arcgis_layer in the lyr reader?

Capture

 

 


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


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


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)

 


Reply