Solved

The conversion from CSV to fileGDB file failed to properly project the data- any idea why?


Hi all, I am trying to convert a CSV file generated from IoT censors to file GDB. The table got a geolocation field in which X and Y values were separated by comma. I wanted to get the data on LL-GDA94 projection. Although I was able to create a feature but it was not projected properly and appeared out of map extent in ArcGIS. Can anyone help me with the script that I have added here? I am attaching the CSV also. Thanks in advance.

icon

Best answer by markatsafe 24 May 2022, 23:15

View original

7 replies

Userlevel 1
Badge +12

You transform coordinates from <Read from feature> to LL-GDA94. But CSV-Files have no coordinatesystem. You must set it with the CoordinateSystemSetter.

Badge +2

@smfks911​ Just replace your Reprojector with a CoordinateSystemSetter as suggested by @tomfriedl​ or simply set the CSV reader coordinate system to be LL-GDA94. Even though there is no geometry when the CSV is read, FME will honour that when you create the geometry.

I think you might be able to simplify your workspace by using an AttributeCreator to set the X/Y values from your AttirbuteSplitter list, see attached (FME 2021.2)

You transform coordinates from <Read from feature> to LL-GDA94. But CSV-Files have no coordinatesystem. You must set it with the CoordinateSystemSetter.

Thanks so much Tom 🙏

@smfks911​ Just replace your Reprojector with a CoordinateSystemSetter as suggested by @tomfriedl​ or simply set the CSV reader coordinate system to be LL-GDA94. Even though there is no geometry when the CSV is read, FME will honour that when you create the geometry.

I think you might be able to simplify your workspace by using an AttributeCreator to set the X/Y values from your AttirbuteSplitter list, see attached (FME 2021.2)

Thank you so much Mark for working on the script. Really helpful! 👍

@smfks911​ Just replace your Reprojector with a CoordinateSystemSetter as suggested by @tomfriedl​ or simply set the CSV reader coordinate system to be LL-GDA94. Even though there is no geometry when the CSV is read, FME will honour that when you create the geometry.

I think you might be able to simplify your workspace by using an AttributeCreator to set the X/Y values from your AttirbuteSplitter list, see attached (FME 2021.2)

Hi @Mark Stoakes​ unfortunately, the code is still returning points with wrong placements of the points. The points should be ideally like this. This is same data but I converted to shapefile from GeoJSON. The coordinate system is automatically set to WGS94.

 

point_projection_pro 

But when I set the coordinate system with CSV to LL-GDA94 in the FME script, the points spread across whole earth (following image). I then tried feature to read from LL-WGS94 but then again those move to other areas. Not sure why happening like this.

 

point_projection

Badge +2

@smfks911​ I don't see that, but the XY are reversed in your data (Easting/Northing) so in the AttributeCreator you need to set Y = _listComma{0} & X = _listComma{1}

@smfks911​ I don't see that, but the XY are reversed in your data (Easting/Northing) so in the AttributeCreator you need to set Y = _listComma{0} & X = _listComma{1}

@Mark Stoakes​ Thanks mate. Its weird that solution you have suggested is not working for me.

Reply