Question

Attributes not writing to CSV

  • 31 March 2021
  • 4 replies
  • 43 views

I have a fairly simple workflow to move attributes from Esri File GDB to CSV file.

First transformer is Coordinate Extractor. Second transformer is Attribute Reprojector (CO83-CF to LL84). Third transformer is Attribute Concatenator to combine two attributes to one value. Fourth step is the CSV writer with manual fields. Currently, I only have a few fields mapped from the Concatenator to the CSV. After running, some of the attributes populate into the CSV whil others don't. I previewed the data at the concatenator and all attributes are present. Why are some attributes not writing to the CSV writer?

 

2021-03-30_19-43-02 

Thank in advance for your assistance.


4 replies

Badge +20

The Manual Attribute Definition in the CSV Writer is the culprit.

As of the schema you posted only MAP_LOC_NBR, COUNTY_CD, TOWN_CD, X_COORD and Y_COORD are writen.

I suggest using AttributeManager to rename and format your attributes instead of the manual approach.

Badge +2

@dholt_fmeuser​ I would agree with @caracadrian​ , AttributeManager is appropriate here. But there are other ways to get to that point.

Manually mapping the attributes is less clicks & typing than AttributeManager. But once you're done, you can right-click on the last connector (between AttributeConcatenator and CSV Writer) and select Replace Link with AttributeManager. This really helps document the workflow and the attribute renaming you did.

 

Also, there is a little know tool for manually mapping feature types and attributes. Under View - Windows - Attribute Connections (or Feature Type Connections) imageClick on a Connector and you can start to map the attributes.

What's nice is that the Destination Attributes clears out as you select them so the mapping simplifies as you go. (In this case I could have used Auto Connect because the renaming is just a case change) Again, once your done use Replace Link with AttributeManager to help document your workflow

@dholt_fmeuser​ I would agree with @caracadrian​ , AttributeManager is appropriate here. But there are other ways to get to that point.

Manually mapping the attributes is less clicks & typing than AttributeManager. But once you're done, you can right-click on the last connector (between AttributeConcatenator and CSV Writer) and select Replace Link with AttributeManager. This really helps document the workflow and the attribute renaming you did.

 

Also, there is a little know tool for manually mapping feature types and attributes. Under View - Windows - Attribute Connections (or Feature Type Connections) imageClick on a Connector and you can start to map the attributes.

What's nice is that the Destination Attributes clears out as you select them so the mapping simplifies as you go. (In this case I could have used Auto Connect because the renaming is just a case change) Again, once your done use Replace Link with AttributeManager to help document your workflow

@Mark Stoakes​ The AttributeManager was useful and your tip on building it by mapping the manual CSV first and the replacing the link was a time saver. I am still having the same issue though. I had many fields in the reader that I did not intend to move to the writer so I have disabled those. I also had many fields in the writer that would be null values. The full schema was from a vendor but I can send them a condensed schema. I have removed the fields that I would not populate. I also replaced the CSV writer with an automatic writer. This makes the workspace much cleaner.

 

After running the workspace, I can see all the data in the display cache of the AttributeManager but only one field shows up in the CSV Writer.

 

AttributeManager Cache 

AutoCSV Written Data 

Thanks again for the tips and hoping you see something that I am missing.

Badge +2

@Mark Stoakes​ The AttributeManager was useful and your tip on building it by mapping the manual CSV first and the replacing the link was a time saver. I am still having the same issue though. I had many fields in the reader that I did not intend to move to the writer so I have disabled those. I also had many fields in the writer that would be null values. The full schema was from a vendor but I can send them a condensed schema. I have removed the fields that I would not populate. I also replaced the CSV writer with an automatic writer. This makes the workspace much cleaner.

 

After running the workspace, I can see all the data in the display cache of the AttributeManager but only one field shows up in the CSV Writer.

 

AttributeManager Cache 

AutoCSV Written Data 

Thanks again for the tips and hoping you see something that I am missing.

@dholt_fmeuser​  Try deleting the target CSV file and then rerun the workspace.

You'll probably have to include a small sample of the data and your workspace for someone to debug it for you. Or send it to your FME support channel if the data is confidential

Reply