Skip to main content
8 votes
Accepted

ASCII-data source is not supported

Unzip files and then open them in your preferred text editor. Remove all header lines before NCOLS. Then you can plot them on EPSG:31467 projection.
Kazuhito's user avatar
  • 31.2k
8 votes
Accepted

Convert Coordinates of ASC File

The site you linked mentions these projection parameters: Map projection: Lambert Azimuthal Equal Area, ellipsoid WGS84 Center point: 48° N, 18° E. So you have to build a custom CRS in QGIS. As a ...
AndreJ's user avatar
  • 77.1k
7 votes

Which tools can reproject ASCII grids?

My go-to tool for raster reprojection is gdalwarp, since gdal supports a myriad of formats including ASCII grid format. For the task at hand (warping a *.asc dataset from EPSG:32629 to other CRS) I ...
IvanSanchez's user avatar
  • 10.3k
7 votes
Accepted

Two .asc in theory together, far away in QGIS

What went wrong From your description it's clear what happened: your data is saved in a specific CRS. When you load it to QGIS, it should automatically be recognized, do not just set any other CRS. ...
Babel's user avatar
  • 74.9k
6 votes

ASCIIToRaster_conversion Error

The error is telling you that the output from arcpy.ListFiles("*.asc") is NoneType. This is occuring because you have set your arcpy.env.workpace to a directory that does not exist. The return value ...
GeoSharp's user avatar
  • 3,266
6 votes
Accepted

Round gdal_translate AAIGrid output to 4 decimal places

It can be done by adding -co DECIMAL_PRECISION=4 in gdal_translate command.
Nazmul Ahasan's user avatar
6 votes
Accepted

Importing multiple .asc files into PostGIS violates check constraint. Why?

You can do all of this in one step, eg, raster2pgsql -c -s 27700 -C -I -f rast *.asc -t 100x100 stg.COUNTRY_1M | psql -U treex -d data_processing -h localhost -c means create, which is the default. ...
John Powell's user avatar
  • 13.7k
6 votes
Accepted

Importing text file Arc/Info ASCII GRID into QGIS

I noticed from the sample data that the prj file was missing. I just took the prj file from their sample data and it solved the issue. Just take the content below and create a text file copy and ...
GforGIS's user avatar
  • 3,349
5 votes
Accepted

Max and Min value from an ascii grid

One quick approach is to use Numpy's genfromtext function. It allows you skip lines and specify a nodata value. Based on the asc file structure (pre-edit as @Joseph has done): import numpy as np ...
Ali's user avatar
  • 4,075
5 votes
Accepted

QGIS creating a DEM using OS Terrain 50 data - component tiles not matching

QGis is trying to be helpful by "stretching" the the "colours" of the tiles for you. The easy way around this to add all of the tiles as a single layer. This is quite easy as you can create a virtual ...
Ian Turton's user avatar
  • 83.2k
5 votes
Accepted

ArcMap, QGIS 3.10.7, QGIS 2.12.3 all interpret ASCII file values differently

QGIS is just estimating the statistics from a sample, instead of calculating the actual statistics from all of the values. In the QGIS layer properties - Symbology - Min / Max Value Settings change ...
user2856's user avatar
  • 69.6k
4 votes
Accepted

Error saving raster file in R

Write it with rgdal instead rgdal::writeGDAL(as(Converted.proj, "SpatialGridDataFrame"), paste("~/Desktop/Heinz_Yan/Final_1",".asc", sep=""), drivername = "AAIGrid") but see caveats here: http:/...
mdsumner's user avatar
  • 8,256
4 votes
Accepted

Obtain GeoTIFF with ASCII files

You can do direct from ASCII to GeoTIFF with gdal_translate. At its most basic you can do:gdal_translate -of GTiff input.asc output.tif Or you can do write the output to a different folder: ...
mixedbredie's user avatar
  • 1,870
4 votes

Max and Min value from an ascii grid

The obvious (to me) way to do this is to use GDAL. So looking in the GDAL python cookbook gives: from osgeo import gdal gtif = gdal.Open( "INPUT.asc" ) print gtif.GetMetadata() gets you started. ...
Ian Turton's user avatar
  • 83.2k
4 votes
Accepted

Can an ASCII Grid contain a CRS or projection?

There's no provision for coordinate system information in the ESRI ASCII raster file format: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/ESRI_ASCII_raster_format/009t0000000z000000/ ...
Spacedman's user avatar
  • 66.5k
4 votes
Accepted

Merge multiple ASCII files into single GeoTIFF file with multiple bands

You can use the GDAL command line tools: gdalbuildvrt -separate out.vrt b1.asc b2.asc b3.asc gdal_translate out.vrt out.tif
user2856's user avatar
  • 69.6k
3 votes

Max and Min value from an ascii grid

As noted by @iant The obvious (to me) way to do this is to use GDAL Some simple GDAL code would be something like: from osgeo import gdal asc = "input.asc" ds = gdal.Open(asc) rb = ds....
user2856's user avatar
  • 69.6k
3 votes

Max and Min value from an ascii grid

Not the most elegant of solutions but you could try using the following code which: Finds the line beginning with a value Appends the line into a list Create a final list containing all values ...
Joseph's user avatar
  • 76.3k
3 votes

Debugging No Free Units (LUNGET) from RasterToASCII_conversion() in ArcPy?

If this only shows up when running four instances of the script in four different cmd windows, then it would seem that a workaround might be to never run more than three instances of the script in ...
PolyGeo's user avatar
  • 65.4k
3 votes

Batch convert ESRI Ascii Grid files to MapInfo TAB

The final batch file, based on Logan Byers answer, which I managed to get working on a Windows machine. I should note that I had to amend the output of gdal2xyz.py. For some reason the version I had ...
T_Bacon's user avatar
  • 2,203
2 votes
Accepted

How to cut data inside GeoJSON polygon from adjacent ASCII grid files?

Without testing this might work. 1) Create a virtual mosaic from all your source files gdalbuildvrt mosaic.vrt *.asc 2) Use gdalwarp and crop the mosaic to cutline gdalwarp -of [your format] -...
user30184's user avatar
  • 69.1k
2 votes
Accepted

Batch convert ESRI Ascii Grid files to MapInfo TAB

This is a common workflow to convert a raster to a point vector file. It should be easy enough to batch the workflow with bash or python. The raster is converted to a CSV with gdal2xyz.py, a VRT is ...
Logan Byers's user avatar
  • 2,859
2 votes

Extraction of Digital Terrain Model Intersections

This seems like more appropriate to solve with TINs, by the nature of the planes they create. If you have access to the 3D Analyst extension in ArcGIS, I would follow these how to documents: ...
Jae's user avatar
  • 1,302
2 votes
Accepted

Raster to Ascii by python console in QGIS?

It's probably due to the PROJWIN <ParameterExtent> parameter where you need to specify the extent of the raster layer. Try running the following: from PyQt4.QtCore import QFileInfo import ...
Joseph's user avatar
  • 76.3k
2 votes

Difference between files of extension .asc, .asc.aux.xml, .aux and .rrd?

These files are described in the ArcGIS Help: From Reduced resolution dataset files: A reduced resolution dataset (.rrd) file is one method of storing the pyramid layers for a raster dataset. ...
PolyGeo's user avatar
  • 65.4k
2 votes
Accepted

Can GRASS export an ESRI ASCII?

What you want is r.out.gdal input=XX@PERMANENT output="...\XX.asc" format=AAIGrid
Micha's user avatar
  • 15.8k
2 votes
Accepted

Open and plot a large raster with Python xarray

This should do the trick: import rioxarray da = rioxarray.open_rasterio('data.asc', masked=True) da.squeeze().plot.imshow()
snowman2's user avatar
  • 7,527
2 votes

Modify .TIF and then export it as .ASC with Rasterio several times

Thanks to @Shawn and @mikewatt. Here is the final code import numpy as np import rasterio tif_raster = rasterio.open("RGB2.byte.tif") raw_array = tif_raster.read(1) # Modify array value = ...
Alonso Ogueda Oliva's user avatar
1 vote
Accepted

Converting ASCII file to DEM using SciPy?

With your second solution (with matplotlib) But you can get the same result with Scipy (with the file you supplied) import pandas as pd import numpy as np test = pd.read_csv("sample.txt") test.head(...
gene's user avatar
  • 55.4k

Only top scored, non community-wiki answers of a minimum length are eligible