First let me say that I am novice in GIS department. As archaeologist I had only some courses 8 years back when i was still studying.

Now, the problem:

When I try to import .asc as raster layer I get this message:

ngridded dataset: At line 3, X spacing was 0.000000. Expected >0 value

I know this is a problem because "Cells with same Y coordinates must be placed on consecutive lines"

But my format viewed in Notepad++ is like this:


And my question - How do I change it to readable format. Any quick solutions?

  • Have you tried installing the LASTools Qgis plugin: For usage and installation, you can follow a tutorial : Follow this link Or the Qgis docs and this link And then import ur dataset using this tools Hope that helps – julsbreakdown Apr 17 '15 at 12:31
  • I have tired this and it works on zLAS format of data. Thnks! But i would also like to know how to work with DMR in .asc format. – Jost Hobic Apr 22 '15 at 15:22

The quickest solution would be to load the data into LibreOffice Calc, and sort the data on the second column, then the first one ascending. The result should look like:


Saving to csv should give you the right format for GDAL.

See http://www.gdal.org/frmt_xyz.html for more details.


Looking at the whole dataset, your grid has no constant cell size, maybe due to reprojection from another CRS.

So your only chance to use the data is to round the data to full meter cell size, or import it as delimited text point layer, then run Raster -> Interpolation -> Interpolation on it.

  • Thanks. What should I do with GDAL? DO i need to download program, which will transform csv to .asc format? How do i do this? Am noob in this field :D – Jost Hobic Apr 18 '15 at 9:45
  • GDAL works in the background of QGIS. So if your data has a format that GDAL can read, QGIS is able to dispay it. – AndreJ Apr 18 '15 at 14:17
  • Im really sorry but i just cant get my head around this. I have sorted data in second column (i used extended selection) and then sorted first one ascending (also used extend selection). When i open csv save in QGIS i get this Ungridded dataset: At line 2, X spacing was 0.000000. Expected >0 value – Jost Hobic Apr 22 '15 at 13:25
  • I am not sure if notepad++ can sort on two columns in one step (which I had in mind using LibreOfficeCalc). With the two sortings your result would look the same as in your question? – AndreJ Apr 22 '15 at 18:09
  • I did sort out both columns as you said in LibreOFfice Calc...and i get error as i posed it yesterday... im i doing something wrong? – Jost Hobic Apr 23 '15 at 7:52

This is an old question but I just ran into this same problem with the same dataset.

I just want to mention that problem here:


Looking at the whole dataset, your grid has no constant cell size, maybe due to > > reprojection from another CRS.

Is easily resolved by rounding all the X/Y values to the nearest decimeter.

I did this in R:

read_delim("GK1_426_55.asc", delim=";", col_names=FALSE)  %>% 
  transmute(X=round(X1, 1),
            Y=round(X2, 1),
            Z=X3) %>% 
  arrange(Y, X) %>% 
  write_delim(path="GK1_426_55_fixed.asc", delim=";")

Afterwards GDAL/QGIS has no problem reading it. You just need to give it the CRS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.