New answers tagged

5

As GDAL supports writing to X,Y,Z (CSV) ascii, you could use gdal_translate: gdal_translate -of xyz -co ADD_HEADER_LINE=YES -co COLUMN_SEPARATOR="," input_raster output.csv To avoid writing NoData values to your output you can write the output to stdout then pipe to grep/findstr to filter it before writing to your csv: gdal_translate -q -of xyz -co ...


1

Try this way with GDAL: import os, sys from osgeo import gdal from osgeo import gdalconst # get the arguments InRaster = sys.argv[1] OutCSV = sys.argv[2] # open the raster and get some properties ds = gdal.OpenShared(InRaster,gdalconst.GA_ReadOnly) GeoTrans = ds.GetGeoTransform() ColRange = range(ds.RasterXSize) RowRange = range(ds.RasterYSize) ...


0

In QGIS you can do it two steps: To extract values above 0 (Zero), you need to set null for values <= 0. In You can do that using SAGA Reclassify (Simple), as you can see below a. Select the Raster Grid that you need to change the value b. Use replace condition number 2 c. In the lookup table change the Low Values to the lowest value in your ...


2

You can use the Sample tool to generate a table of X,Y,Z values: Creates a table that shows the values of cells from a raster, or set of rasters, for defined locations. The locations are defined by raster cells or by a set of points. Use the same raster as both the input and location dataset. The tool will output a DBF or a GDB Table which you can ...


0

The end code that worked for creating the selection. I ended up having to define the projection using a constant, so I used the Authority Code for the projection. import arcpy, os arcpy.env.overwriteOutput =True # Calculates the center of the raster image. def RasterCenter(rasterInput): #raster: string reference to raster raster = arcpy.Raster(...


8

I modified the original code a little bit to avoid some confusion when defining the RasterCenter function, since the argument named raster used in def RasterCenter(raster) and the variable named raster used in raster = arcpy.Raster(raster) within the function can cause confusion and make things not working properly. I modified parsing the path when reading ...



Top 50 recent answers are included