# Tag Info

25

Nutshell Each set of 3 images below should be read such as "grey (band) + opacity (band) = transparent result". You can test these processes within minutes via the associated github hosted makefile. Process #3 is the one which I recommend, with a threshold between 170 (keeps strong shadows) and 220 (keeps all shadows). Process 3 provides the strongest ...

9

The linked source mention "change its fusion mode to < Multiply >", so the operation to do is not a simple average of input hillshades (for this, see also How to average gdal_hillshades?). It's something else. Yet, let's create the 3 different-sunlight-directions hillshades : gdaldem hillshade input.tif hillshades_A.tmp.tif -s 111120 -z 5 -az 315 -alt 60 ...

6

Here are some options Lookup: (not sure) Zonal stats: The GRASS module r.statistics Focal stats: GRASS r.neighbors Nibble: (don't know) Iterate through VAT: I think that the concept of a VAT is specific to Arc*, but r.describe might get close. Combine: Just use GRASS r.mapcalc Mosaic: GRASS - r.patch or gdal_merge

4

In addition to Micha's list, here is how you can nibble with GRASS 1) mask your image with r.mapcalc 2) with the resulting image, interpolate to the nearest neighbour using r.surf.nnbathy For combine, I would use r.cross but you can also do it using r.mapcalc with this algorithm For mosaic, I would use gdalbuildvrt: it is often not necessary to create a ...

3

I would recommend you using Python OGR API for creating workflows. Here is a link to a good tutorial how to install GDAL/Python etc on Windows. You will find tons of workflow examples in the internet.

3

The Clipper tool makes an uncompressed image by default. Read the GDAL manual of your format and add manually the compression options into the gdal_translate command that is shown in the lowest pane. For example for GeoTIFF read http://gdal.org/frmt_gtiff.html and use for example-co COMPRESS=DEFLATE -co PREDICTOR=2 which gives a well compressed, lossless ...

2

As of a week or so ago, the Anaconda packaging of GDAL now includes all of the projection files. The install command for the Anaconda packaging of GDAL is % conda install gdal The projection files are stored under $ANACONDA/gdal/share$ so settingGDAL_DATA` to this path is all that is needed to avoid the problems I was having above. % export ...

2

If you happen to work in R, you can use the vec2dtransf package (which is mine :) ). You would simply need to load your Shapefiles into R using rgdal and define your affine transformation to apply it on the data. After such process, you can export your data to a transformed Shapefile also via rgdal. In vec2dtransf, affine transformations can be defined from ...

2

The units of the extent will inherit from the units of the projection of the data, so to convert the extent to lat/long, you would need to reproject your data to a geographic projection (usually WGS1984) that uses degrees as units. Your data appears to have been projected to NAD27 / UTM zone 11N, which has units of meters. The extent refers to the x and y ...

2

Edit based on the comments below: Assigning the gdal_array.SaveArray(a, "test.tif") call to a variable returns an osgeo.gdal.Dataset object that can be managed as a per the below gotchas. Using the above example this should work: a = np.arange(300).reshape((3, 10, 10)) ds = gdal_array.SaveArray(a, "test.tif") ds = None ...

2

You are only inspecting osm_id field. It seems you didn't inspect your multipolygons table. On a local use case, I do : ogrinfo -so france.simple.spatialite multipolygons It returns FID Column = OGC_FID Geometry Column = GEOMETRY osm_id: String (0.0) osm_way_id: String (0.0) name: String (0.0) type: String (0.0) ... So the identifiers are not only ...

2

With gdal_calc.py is, for example, --type Float32 (my answer based in your link). The next command worked for me when I used to calculate at-satellite brightness temperature: gdal_calc.py -A b6.rad.tif --calc "1260.56/log((607.76/A)+1)" --type Float32 --outfile bright_temp.tif I hope that helps.

2

potentially a multi-part question - 1) plotting grids with legends, 2) including shape files on grid, and 3) animate output images. each with multiple opportunities to accomplish the task. here's a quick run-down of at least 2-methods: using gdal, one should be able to read in the raster - perhaps something like (in a loop to get all rasters). raster = ...

2

From http://www.gdal.org/frmt_ecw.html For those still using the ECW 3.3 SDK, images less than 500MB may be compressed for free, while larger images require licensing from ERDAS. See the licensing agreement and the LARGE_OK option. So you are out of luck with the 5.1 SDK without a valid license. Depending on your OS, you might still catch a copy of the ...

1

In R: library(raster) library(animation) files <- list.files("path/to/asc", pattern = "asc\$") saveHTML({ for (i in seq_along(files)) { r <- raster(files[i]) r <- plot(r) ## include additions like counties here } }) The animation package has other options for different output formats rather than HTML. The raster package has ...

1

I think the utility you are looking for is gdal2tiles: gdal2tiles.py input_file output_dir

1

If the dataset should cover the whole African continent, the CRS information is wrong, and WGS84 should be right. If it is really a local CRS, covering 71m eastwards and 73.5m northwards, you have to set up a local CRS on the point of (0;0), which you have to collect with GPS or offical surveying information: +proj=tmerc +lat_0=.... +lon_0=.... +k=0.9999 ...

1

Because this array (input raster) includes 31 values: array=(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e) and this one (output raster) only includes 29; where raster "L" and raster "e" are missing: (A+B+C+D+E+F+G+H+I+J+K+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+a+b+c+d)/30 However, the script would be (you have to repeat the letters): ...

1

Fiona doesn't support updating existing layers by design. You'll need to read your existing data in, make the changes you need, and write to a new file.

1

I've had similar issues with gdalwarp producing black strips around image edges. Usually these happen around the international dateline, but your edges appear to be around the central meridian instead so it's no wonder you wind up with an empty strip in the middle of the output GeoTIFF. Try playing around with the -wo SOURCE_EXTRA=XXX argument. Depending ...

1

I am not sure if GDAL is recognizing that the projection is just EPSG:3857 by the code but I suppose that the projection info it finds is correct. Make the same test with ogrinfo. If you can't get the same info with C# then there may be something wrong in the bindings or in your code. ogr2ogr -f "ESRI Shapefile" -s_srs epsg:4326 -t_srs epsg:3857 ...

1

A tool that can do this (among others) is the Sky-View Factor Based Visualization (http://iaps.zrc-sazu.si/en/svf#v). Calculate several parameters of a terrain. Is damn good.

1

QGIS uses gdal_translate to clip the raster and the standard output is an uncompressed geo-tiff. Tiff file, however can be compressed using, commonly, one of a couple standard compression algorithms. The first is LZW and the second is JPEG. To set compression in QGIS's clipper module, click the yellow pencil to enable editting of the commandline at the ...

1

Line widths are determined at the rasterization step Other than lines in a vector image (e.g. SVG), lines in vector data do not have an inherent width. They are lines in a mathematical, not in a graphical sense. I assume that this is also the case for contours.shp, the output of the contour finding step with gdal_contour. Thus line width is determined by ...

1

try --NodataValue=None, and if it doesn't work, you can change the pixel depth to --type='Int16'

1

First, use gdal_calc.py to invert the band : gdal_calc.py -A Shadedrelief.tif --outfile=InvertedShadedrelief.tif --calc="255-A" gdalbuildvrt helps to merge 2 files into a two band image (or a 2 band vrt), it takes the first band of each input into band 1 and band 2: gdalbuildvrt -separate final.vrt Shadedrelief.tif InvertedShadedrelief.tif ...

1

gdal + convert based workflow There is a gdal + convert solution which gives good visual results. The trouble with this solution is that convert destroys geographic informations which you then have to restore. It increase the number of action to run. # Basic crop gdal_translate -projwin 67 35.92 99 5 ../data/noaa/ETOPO1_Ice_g_geotiff.tif crop_xl.tmp.tif # ...

1

ogr2ogr **-F** MySQL MySQL:mapas,user=xxxx,password=xxxx \ -nln test -nlt MULTIPOLYGON \ -update -overwrite \ -lco ENGINE=MyISAM \ -lco MYSQL_FID=ogr_fid -lco GEOMETRY_NAME=geometry \ /Users/Seph/Downloads/TM_WORLD_BORDERS-0.3/TM_WORLD_BORDERS-0.3.shp The letter f has to be capitalized. regards

1

Tom Hengl told me this: Set the 'check.module.exists = FALSE' and 'warn=FALSE' -> this usually does the trick (http://www.rdocumentation.org/packages/RSAGA/functions/rsaga.geoprocessor). And Alexander Brenning told me that: did you notice the warning message, Warning message: In rsaga.geoprocessor(lib, module, param = list(h = ""), env = env, : This ...

1

You can access raster statistics using the Python GDAL/OGR API. from osgeo import gdal # open raster and choose band to find min, max raster = r'C:\path\to\your\geotiff.tif' gtif = gdal.Open(raster) srcband = gtif.GetRasterBand(1) # Get raster statistics stats = srcband.GetStatistics(True, True) # Print the min, max, mean, stdev based on stats index ...

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