Skip to main content

Hi,

I need to vallidate SHP (or DWG blocks with attributes) attribute value against Field Data Type and Domains specified in template GDB or XML Workspace Document.

 

Reader: ESRI SHP

 

Writer: ESRI GDB

 

ISSUE: If the SHP attribute value doesn't match with GDB Field Data Type, the translation fails.

 

I need to validate those values and write the fails.

I wanted to use 'AttributeValidator' but the Validation Rules must be specified manually.

 

Is there any way how to read the Validation Rules from the template (GDB or XML Workspace Document) and write them automatically?

EXAMPLE:

Reader SHP feature 'PIPE' has got field 'MATERIAL' with attribute value 'UPVC'.

 

Writer GDB feature 'PIPE' has got field 'MATERIAL' with specified domain values: 'PVC-U, HDPE, PE'

 

There is no match so the translation fails

Thanks.

You could export the schema of the GDB as XML from within ESRI (or use python from within FME to call ESRI), and read this in FME using the XML reader - this gives you the structure. And then you could use this with to build some tests with testers, etc. in your workflow.


Well, I know, I can read GDB/XML scheme and exposed the attributes I need for validation. That's not an issue and point of the question.

 

The question is what FME TRANSFORMER or set of transformers should be used to do the job?

 

I found only 'AttributeValidator' which seems to be pretty basic, I have to create the 'Validation Rules' manually, what's pretty painful and not human brain friendly process.

I really need to use the GDB/XML scheme as a template and out of this template the 'Validation Rules' would be created/imported automatically.

Then on reader side (going into the validator) I need the file which needs to be validated (SHP or DWG in this case)


Hi @stanislavvyskoc, are you able to share a sample of the data you're working with? Is the goal to check whether the attribute type matches what's specified or to validate the attribute values? Or both?

I think there are a few ways this could be made more easy.

For example, I could set up a translation from my source data (Shape, Mapinfo, etc) to XML. I pick the required schema for the XML and set it to be validated on writing.

Now if I run the translation and see errors, I know the data does not match the schema requirements.

I made a demo movie here: https://screencast.com/t/AYZZuzL1Gz8K

I hope this helps.


I think there are a few ways this could be made more easy.

For example, I could set up a translation from my source data (Shape, Mapinfo, etc) to XML. I pick the required schema for the XML and set it to be validated on writing.

Now if I run the translation and see errors, I know the data does not match the schema requirements.

I made a demo movie here: https://screencast.com/t/AYZZuzL1Gz8K

I hope this helps.

If you use a FeatureWriter transformer (instead of the XML writer itself) then you could handle bad data better as well.

 

Thinking about it, I do think this is a good way to test against an XML schema. Presumably whatever functionality it uses to test is built in and complete. If you put those tests manually into the AttributeValidator then it wouldn't be using a true XML function and there is no knowing whether the tests were complete or not.

 


Reply