Skip to main content
Solved

ASCII to CSV

  • November 15, 2022
  • 4 replies
  • 425 views

wind

Hello,

How can I convert an ASCII file to xyz csv file please?

Thank you

Best answer by redgeographics

You could use a RasterCellCoercer to generate a point for every pixel and assign the band value as to an attribute automatically, then a CoordinateExtractor to get the x and y values too and write them out to a CSV file.

 

Alternatively, you may even get away with writing directly to a Point Cloud XYZ file.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • November 16, 2022

This is a very generic question. If you want a specific answer it would help if you could show us what your ASCII file looks like. Or do you mean an ASCII grid file?


wind
  • Author
  • 10 replies
  • November 17, 2022

Hello,

 

this is the file I want to convert. It's an numeric terrain model each 1m. So I need to have an csv file with coordinates and elevation like this: 893798.5, 6256850.5, 314image.pngThank you!


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • Best Answer
  • November 17, 2022

You could use a RasterCellCoercer to generate a point for every pixel and assign the band value as to an attribute automatically, then a CoordinateExtractor to get the x and y values too and write them out to a CSV file.

 

Alternatively, you may even get away with writing directly to a Point Cloud XYZ file.


wind
  • Author
  • 10 replies
  • November 17, 2022

It works!

Thank you very much