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.
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 ...
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 ...
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. ...
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 ...
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.
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. ...
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 ...
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
...
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 ...
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 ...
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:/...
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: ...
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. ...
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/
...
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
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....
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
...
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 ...
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 ...
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] -...
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 ...
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:
...
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 ...
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.
...
2
votes
Accepted
Can GRASS export an ESRI ASCII?
What you want is
r.out.gdal input=XX@PERMANENT output="...\XX.asc" format=AAIGrid
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()
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 = ...
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(...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
esri-ascii-raster × 142arcgis-desktop × 40
raster × 38
qgis × 35
gdal × 16
ascii × 16
python × 15
geotiff-tiff × 15
dem × 15
coordinate-system × 14
arcmap × 12
lidar × 11
r × 8
arcpy × 6
convert × 6
maxent × 6
geotools × 5
raster-conversion × 5
grass-gis × 5
pyqgis × 4
arcgis-10.3 × 4
export × 4
import × 4
postgis × 3
arcgis-10.2 × 3