Solved

Excel to GDB with Domains, Fieldnames and Field Alias

  • 30 April 2024
  • 9 replies
  • 101 views

Badge +4

Hi Everyone..

I was able to find a workspace from community this template attached and did few changes to it and it is working as expected with sample template provided in workspace to create a GDB with domains , fieldnames and field alias.

      1) This workspace consider single default words in domainlist provided in excel  only like Domain1 -      Attached Sample_1_Workspace template - works with 2023 version.

  1. This workspace consider single altered words domainlist like alphabets(A,B,C….) in Attached Sample_2_Workspace_template - works with 2023 version
     
  1. This workspace consider 2 words in domain list like FME form in attached sample_3workspace_template -doesnt work and workspace fails..
    If there are any special characters or space it doesnt work like : FME Form or FME_Form.
    I have attached error log and all sample data files with with each workspace..

    Any Experts Kindly support : How can i resolve this with text as FME Form or FME_Form (with a space or special characters.

    Thanks
icon

Best answer by debbiatsafe 3 May 2024, 00:12

View original

9 replies

Userlevel 3
Badge +18

Hello @abnan0001

There seems to be some data quality issues with the coded domains values from the Excel dataset that causes the third workspace to fail.

First, there are non-printing characters at the end of some Code and Description values that causes the geodatabase writer error. See the Neumanns Agama feature as an example. You can use a StringReplacer to replace \x{00A0} with nothing to remove this character, or clean up the Excel dataset to remove this character.

Second, there are duplicate coded domain values which is not allowed. Cheloniidae and Viperidae appears twice for the family_name coded domain. You need to remove these duplicate values either in the workspace with a DuplicateFilter or in the Excel dataset.

Lastly, there is no data type defined for the HCP_SR_21 coded domain. The Field_type attribute value is double, but there is no conditional rule in AttributeCreator_11 to map a Field_type value of double to an fme_data_type value. The correct field type for this coded domain should also be long/short integer instead of double.

If you fix all three of these issues, the Geodatabase writer should successfully write out the coded domain values in the output geodatabase. I hope this information helps.

Badge +4

@debbiatsafe 

Thank You for the quick reply..

I have made a small work workspace to correct the excel sheet and then i copied the cell to the excel domains sheet..

Im still receiving same error..
I have attached the workspace template used to correct and even im receiving error
I shall be thankful to you for your support,If you can have a look

Thanks Again

Userlevel 3
Badge +18

Hello @abnan0001 

You are still seeing the error because the non-printing character is still present in the Excel dataset. Your StringReplacer is configured to replace spaces, not the non-printing space character that should be removed. The StringReplacer needs to be configured like below to remove the non-printing space:

In addition, it would be better to correct the Excel dataset itself instead of copying the cells. Attached is an example workspace that fixes all three of the data quality issues mentioned in my previous response with FGDatabase_Template_v1.xlsx and outputs it as FGDatabase_Template_v2.xlsx.

Change the FeatureReader in your domain creation workspace to read from the corrected FGDatabase_Template_v2.xlsx and the geodatabase writer should complete successfully.

 

Badge +4

Thank you so much for your valuable support .

I shall be highly thankful to you 

Badge +4

@debbiatsafe 

Thank You So Much 

It is working perfectly and I have tested with some other data, It Works Fine..

Wondering of Sub-Type..

I may need your suggestion and support in Sub-type

Is there a possibility that FME form software Supports building Sub-types within the same Workspace with the same logic applied for domains

Thank You

Badge +4

Hi Experts

Any Opinions/Guidance for Sub-Types.

Thanks

Userlevel 3
Badge +18

Hello @abnan0001 

Please note, there is a bug tracked as FMEENGINE-81757 affecting the creation of subtypes in FME 2023.1 and 2023.2. This bug has been fixed in FME 2024.0. If you cannot upgrade FME, you can use a geodatabase template as demonstrated in How to Use an Esri Template to write feature classes with subtypes, which is the recommended method for creating subtypes and domains.

In general, you cannot use the same workspace as-is to create subtypes. You will need to modify the existing workspace logic to produce a similar workflow for writing subtypes.

This is because the syntax is slightly different compared to a domain. For example, this is the string required in attribute{n}.native_data_type for a coded domain:

coded_domain(<domainName>:<domainFieldType>:<code1>:<encodedCode1Description>:<code2>:<encodedCode2Description>)

For a coded subtype, the string in attribute{n}.native_data_type should be:

subtype_codes(<code1>:<encodedCode1Description>:<code2>:<encodedCode2Description>)

There is a different key word at the beginning, and coded subtypes do not require the subtype name and subtype field type.

Badge +4

@debbiatsafe 

Thanks for the reply.

Yes , I do have a updated version of FME  version of 2024.0.1 and what might be procedure please

I may require your help , As i have a little knowledge on complex logic workflows.

If possible , Can i have sample workspace designed if available, That will be a great support to me to go through the process of sub type within the same GDB with Domains.

Thanks

Userlevel 3
Badge +18

Hello @abnan0001 

Unfortunately, sample workspaces for creating subtypes using this method are not available as this is not the recommended way to create domains and subtypes for geodatabase writing anymore. As you have noted, the workspace you are using to create domains is a very complex workflow.

The recommended method to create subtypes and domains is using an XML geodatabase template, as it is a simple to configure.

I would highly recommend taking a look at our article on How to Use An Esri template Geodatabase for a much simpler way of creating subtypes and domains for geodatabase.

Reply