Tag Info

Hot answers tagged

22

You can do this using a cursor to grab the data from your table and write to a comma-delimited text file. EDIT: I'm adding a more concise block of code to accomplish the task using the csv module of Python New Answer using arcpy.da cursor: import arcpy,csv table =r'c:\path\to\table' outfile = r'c:\path\to\output\ascii\text\file' #--first lets make a ...


14

I know these data very well. They are the slightly notorious NOABL windspeed data. You are also on the right track in converting them to an ASCII raster though. The header I created for them (many years ago) was as follows: ncols 700 nrows 1300 xllcorner 0 yllcorner 0 cellsize 1000 nodata_value -999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...


13

In the Esri world an .asc file usually refers to the output created by the GRIDASCII command (ArcInfo Workstation) or Raster to ASCII tool (ArcGIS for Desktop). In practice it can mean just about any format, usually plain text, meaning one can't assume from the .asc extension what it looks like inside. It's an interchange format, meaning it's not (normally) ...


11

The NoData value is missing in your ascii file and you have x|| and y|| instead of xll and yll. I am assuming that your NoData is -999. try this: NCOLS 700 NROWS 1300 XLLCORNER 0 YLLCORNER 0 CELLSIZE 1000 NODATA_VALUE -999 Your ascii open in a text editor should look like this: NCOLS 700 NROWS 1300 XLLCORNER 0 YLLCORNER 0 CELLSIZE 1000 NODATA_VALUE -999 ...


9

You can use numpy. See the example below. A numpy masked array can be generated accounting for the no data values. See the numpy help topic for mafromtxt and genfromtxt Below is a small ascii file with a nodata value of -999 ncols 3 nrows 3 xllcorner 0 yllcorner 0 cellsize 1 NODATA_value -999 0 1 2 -999 4 5 6 7 8 ...


8

In QGIS, then the Add Raster Layer (menu or toolbar) is your best bet: Layer: Add Raster Layer .... You could also use the Python console (see the pyqgis cookbook). You may choose to load the layer, but you may also convert the file without adding it to your map canvas. Select the Raster: Conversion: Translate (convert format) menu option. The 'input ...


7

One row is too small a sample to be conclusive, but it certainly appears to be DMS (specifically, dDDMMSSHH, with an implied west longitude). You can confirm this by scanning the file and looking for a value of 60 or larger in any of the MM or SS elements. If it is in this format, then conversion to decimal degrees is as simple as parsing out the minutes ...


7

You already have a DEM; there is no need for you to create one. The DEM is contained within your files, i.e. you have two copies of the DEM, one contained within an ArcGIS ASCII raster and the other within a GeoTIFF. These are simply file formats that contain the raster data that is your DEM. One of the most common formats for a terrain model is as a regular ...


6

I have used NBI data several times, once in this article I wrote for ArcUser years ago, and a couple of times in training sessions. Here's a function that will parse the space-delimited version of NBI and return you a list of some of the bits (haven't used it in a while, but should get you going). Also, here are the NBI data docs. def ...


5

What about the Export Feature Attribute to ASCII Tool in the Spatial Stats Toolbox? It's available at all license levels.


5

GRASS GIS r.out.xyz tool You can use the r.out.xyz tool in the GRASS toolbox in QGIS. The function exports a raster map as a list of x,y,z values into an ASCII text file, skipping x,y coordinates for raster cells containing a NULL value. For more information, see the r.out.xyz help file. The disadvantage is that you need first to create a GRASS database and ...


5

You may want the "Export Feature Attribute to ASCII", cleverly named arcpy.ExportXYv_stats http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005p0000003v000000 import arcpy feature = "path to feature here" # fieldnames must be explicitly provided. Note that you will get additional fields based on the feature type (e.g., "XCoord" and "YCoord" ...


4

You want raster data statistics. See what you are doing in the gui first (for homework.) Then you can use a python window or a script. import arcpy arcpy.CalculateStatistics_management("c:/data/image.tif", "4", "6", "0;255;21")


4

The easiest way, apart from Layer|Add Raster Layer... is to just drag and drop it to the layers window. If you also want to translate it, then Raster|Translate (Convert format) is the tool for the job. All that does is wrap the command line tool gdal_translate, part of the excellent GDAL tools and library). On the stackexchange sites, it is usual to give ...


4

add the data as txt or csv. then right click and "display xy"


4

To convert LAS into DEM / DSM I would recommend LAStools, specifically LAS2DEM, which is free to use for non-commercial use and not that expensive for professional use. To convert DEM/DSM images into ASCII I use GDAL_Translate with AAIGRID driver or the QGIS raster save as In ArcGis: Convert your ground and model key points to MultiPoint using LAS to ...


4

Given your error, my guess is that when you are importing the file to GRASS, it is expecting a GRASS ASCII raster format, which has a header that looks like this: north: ####.### south: ####.### east: ####.### west: ####.### rows: ####.### cols: ####.### Instead of an ArcGIS ASCII grid, which has a header that looks like ...


3

Keep it simple, see qgis: Obtain all elevations points from a raster DEM: Go to Raster menu,Conversion sub menu,convert, and choose (you have the list of all the possible formats in GDAL raster Format) [GDAL]XYZ -- ASCII Gridded XYZ (X,Y,Z format) the result is a text file with the x,y coordinates of the center of the cells of the grid,and the value of ...


3

GDAL is a free geospatial raster translation program that will convert USGS sdts dem to USGS asci dem. A Mac installer is available here gdal installers. I'm unfamiliar with a Mac, but you will run gdal_translate.exe from a command line. Something like gdal_translate -of USGSDEM 1661629.DEM.SDTS. -of is the output format. The gdal_translate command help ...


3

I would try using the batch grid control. Instead of double-clicking or using right-click to Open a tool, use right-click Batch. If your 160 feature classes are all in the same workspace you should be able to multiple-select them in the Catalog window and drag them into the first column. I tested it below and it seemed to run OK.


3

Assuming you're using ArcGIS 10, you can use the arcpy RasterToNumPyArray command to get a NumPy array, which if you read the NumPy Input and Output routines documentation you can see you can easily dump the raster data to disk as a text file with a format of your choice. For example: import arcpy import numpy as np arr = ...


3

Your bio1_test.asc file is in GeoTiff format (despite the .asc). I had the same problem using the Raster -> translate (Convert Format) form. If you look in the command box at the bottom of the form you will see something like: gdal_translate -of GTiff C:/***/bio1_test.tiff bio1_test.asc change this to: gdal_translate -of AAIGrid C:/***/bio1_test.tiff ...


2

You write "I have raster in .bil format" - fine, but you also need to have the related metadata. Then you write "which I want to save in GRASS GIS with r.out.ascii." - likely you want to import the map into GRASS GIS? Then it is r.in.bin. If you want to export a raster map from GRASS to BIL, then use r.out.bin or r.out.gdal. If to ASCII format, then ...


2

I think you need to import the file to a Grass GIS dataset then after that you can export to the format you wish. Also you can easily convert "GUIless" way, it using GDAL with this command on your shell gdal_translate -of AAIGrid yourfile.bil outputfile.asc This is for Arc/Info type more options here Gdal Raster formasts Or try Saga GIS if none of the ...


2

edit - now tested and working - edit - improved code import sys class Ascii_file(object): def __init__(self,file): self.raster_file = open(file, 'r') # Open the file self.max=sys.float_info.min self.min=sys.float_info.max def __minmax(self,value): if value>self.max:self.max=value if ...


2

You can simply import them in a loop like this: for myfile in `ls 5*-7*_dem_1m.asc` ; do # remove .asc extension outname=`basename $myfile .asc` # import current file r.in.gdal input=$myfile output=$outname done # mosaik the tiles r.patch input=`g.mlist rast pattern="5*-7*_dem_1m" sep=","` output=dem_1m # colorize the result r.colors dem_1m ...


2

In ArcGIS you can do this: Convert your raster to point vector file. ArcGIS tool Raster to Point (Conversion) Add x and y colum to point file and calculate x and y-coordinates. ArcGIS tool Add XY Coordinates (Data Management) the x and y coordinates are the coordinates of the pixel center. Use Field Calculator to calculate xllcorners and yllcorners ...


2

Go to Raster -> Translate (convert format) -> on "Ouput file" select Arc/Info ASCII Grid http://wiki.tuflow.com/index.php?title=QGIS_Export_Raster_to_asc


2

Your problem lies in the use of the r prefix on the string in the variable newpath_01. Using this forces it to use a strict ASCII character set. The error shows that character position 47, does not fall in the 128 character ASCII range. The à in Università, is not in the basic ASCII character set. When you assign the r prefix instead of just a regular ...



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