Tag Info

Hot answers tagged

7

By default an RGB image will be written to an RGB color model JPEG image, but this is not actually the most efficient way of writing to JPEG. It is better to convert to the YCbCr color space, and encode that. This is in fact the typical form of standalone JPEGs and what GDAL will produce when writing to a free standing JPEG file. Compressing a 4K x 2.6K ...


4

You can indeed use gdal_translate either giving the source coordinates ([-srcwin xoff yoff xsize ysize]) or the georeferenced coordinates ([-projwin ulx uly lrx lry]). For instance: import os inDS = ... # input raster outDS = ... # output raster lon = ... # lon of your flux tower lat = ... # lat of your flux tower ulx = lon - 24.5 uly = lat + 24.5 lrx = lon ...


4

When you export the images from ArcGIS, check the Write World File check box. This will create a world file (*.TWF) with the same name as the output tiff. The world file stores the georeferencing information. Always keep the twf file with the tiff. IF you do not resize or crop the image in Photoshop, or change the data frame coordinate system, the tiff ...


4

So you want a geotiff instead of a tiff with a world file (.tfw). This should be the default in GDAL (http://www.gdal.org/frmt_gtiff.html) so: gdal_translate input.tif ouput.tif It will default to geotiff.


4

Is Python an option? Use RasterIO (a Python GDAL/ numpy bridge) to load the raster to NumPy array, then use numpy.amax() to find the maximum value, followed by numpy.where() to find the row/column indices, then calculate the lat and lon from the raster extents.


4

Do not download multiple files at once / use different ftp client You are downloading from TRMMopen (which is an official download source of the NASA / Goddard PMM) via anonymous ftp. You are only prompted a username/password dialogue if you have multiple connections to this ftp site, e.g. because you are attempting to download more then one file at once. ...


4

Building on what @David mentioned you may use open source gdal library using python module to get image extent like this: import gdal from gdalconst import * data = gdal.Open('C:/Temp/myimage.tif',GA_ReadOnly) geoTransform = data.GetGeoTransform() minx = geoTransform[0] maxy = geoTransform[3] maxx = minx + geoTransform[1]*data.RasterXSize miny = maxy + ...


4

I would recommend to use gdalcopyproj.py, a sample file from the GDAL repository done for this purpose as mentioned directly in the script: Duplicate the geotransform and projection metadata from one raster dataset to another, which can be useful after performing image manipulations with other software that ignores or discards georeferencing ...


3

I would create a virtual raster with both images. You can do it in Raster > Miscelaneous > Build Virtual Raster (Catalog). It will be a quite small file that will allow you to open both images at the same time in QGIS, and set blending to them globally. That way the overlapping blending mode or transparencies won't show. Two overlapping images with ...


3

Use gdalbuildvrt fiveband.vrt -separate dem.tif threebandalpha.tif gdal_translate fiveband.vrt fiveband.tif If you application uses GDAL, you can just open the vrt.


3

The simplest way I can think of is to take the merged raster you have just made and save out the red band (perhaps using gdal_translate and the -b switch). Alternatively you could use QGIS' raster calculator to save only the red band as a new raster.


3

It's a well known and longstanding issue that gdalwarp doesn't deal with compression well. The solution is to gdalwarp without compression then gdal_translate with compression. To avoid two lengthy processes, gdalwarp to VRT first, it's really quick, then gdal_translate with the -co compress=lzw option. i.e. $ gdalwarp -tap -tr 30 30 -t_srs "etc..." -of ...


3

SRTM data is in geographical coordinates, if you want exactly (ish) 14 square km around everest download extra, project to a suitable projected coordinate system and then extract. The cells are not 'square' as the data is originally in arc seconds and is only nearly square at the equator and become more rectangular the closer you get to the poles.


3

Unfortunately you cannot do this. You can only display those images using OpenLayers which are spported by browsers. That is why using OpenLayers.Layer.Image you can only display JPEG, PNG & GIF images. Other Image formats like Erdas Imagine, Tiff, GeoTiff ASCII etc need to be converted to a format which browsers understand, before they can be shown in ...


3

From the GDAL formats: JPEG/LZW/PACKBITS/DEFLATE/CCITTRLE/CCITTFAX3/CCITTFAX4 You've done JPEG, LZW, PackBits and Deflate for the byte and multi-byte data types. Fax G4 is still a valid monochrome (1-bit) compression that I encounter from time to time.. mostly though space is not a concern so images are 8bit or more; I don't think I've ever seen a G3 TIFF. ...


3

You can export to other formats, however you will have to use python/arcpy module: How to export Data Driven Pages to other formats using ArcMap: You can use a simple arcpy.mapping script to export Data Driven Pages to formats other than PDF. This example shows how to export Data Driven Pages to a series of PNG image files. mxd = ...


3

The tags you're interested in are: ModelTiepointTag, ModelPixelScaleTag, and ModelTransformationTag. The specification describes how they stored the information: http://www.remotesensing.org/geotiff/spec/geotiff2.6.html#2.6.1 You could have a look at how GDAL implements them in this file: ...


3

A work around would be to use the ExportToTIFF method within the data driven page loop. Here is a code example: mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1): mxd.dataDrivenPages.currentPageID = pageNum arcpy.mapping.ExportToTIFF(mxd, ...


3

There is nothing wrong with your GeoTIFF file. You just need a better program to view it with. Most basic "paint"-style programs such as Preview, Paint, Paint.NET, all expect a Byte pixel type for TIFF files. Although a float type is part of the file specifications, most software don't implement this support. Software that should work include most GIS ...


2

The coordinates of the target extent have to be expressed in the target SRS: -te xmin ymin xmax ymax: set georeferenced extents of output file to be created (in target SRS). Being... >cs2cs +init=EPSG:4326 +to +init=EPSG:3857 5 43 556597.45 5311971.85 0.00 15 48 1669792.36 6106854.83 0.00 the command should be something like: ...


2

Looks like I've solved it, but it seems a bit of a needless way of having to do it. What I did was wipe the registration data by converting the geotiff to a geotiff without the data and then re-did it. This is the command and then I went through the usual process of registering the image. gdal_translate original.tif -co PROFILE=BASELINE modified.tif It's ...


2

Try to put your geotiffs in a directory like this: ...\webapps\geoserver\data\data\myGeoTiffs Much more, when creating you store, put this in the Connection Parameters URL: file:data/myGeoTiffs I've tried also to reproduce your error on my systems but I wasn't able to do it. (In my case everything works well even when I load the tiffs from anywhere ...


2

I use the tools listgeo and geotifcp. Before you start your work with photoshop retrieve, the geoinfo with listgeo and store it in a file. After your work in photoshop is finished put the information back with geotifcp file (..look also at also Geotiff). Huck


2

It's highly inefficient to merge mosaic using gdal merge. Instead, make a VRT (Virtual Dataset) and convert it to your favourite format.


2

If you have the output_image.tif yet, you can follow the advice of @MappaGnosis, i.e.: gdal_translate -b 1 output_image.tif output_red.tif Alternatively, it's possible to extract the red band while building a VRT mosaic with gdalbuildvrt and then translate from VRT to GTIFF format: gdalbuildvrt -input_file_list c:\temp\rasterlist.txt -b 1 output_red.vrt ...


2

Assuming a 3-band RGB image: With rgdal see ?SGDF2PCT, or with raster see ?plotRGB - both require a 3-band gridded data set, the raster pathway is simplest. For example, note that we use brick to ensure multiple-bands are read: library(raster) x <- brick('somefile.tif') plotRGB(x) And here's a concrete example from the manual: b <- ...


2

As you know the coordinates of your corner, and assuming you also know the pixel size, you can create a world file that can be interpreted by most software. you just need to create a small text file with the extension .tfw and the same name than your tiff file. See Wikipedia for details. Here is the content : size X rotation X (probably zero) ...


2

I recommend the use of a vrt file, a virtual raster file that would point to your data with the bounding box that you want. you can call it from python using import subprocess subprocess.call(["gdalbuildvrt", "-te", "xmin", "ymin", "xmax", "ymax", "output.vrt", "input.tif"]) then you use your vrt like an image. If you want you can create the vrt with ...


2

I recommend using Python or R (or a GIS software), as @Marc Pfister has suggested. However, you can do it with bash and gdal only, and heavy usage of grep. First get the Min/Max values without coordinates: Obtain the Min / Max values with gdalinfo or gdalinfo -mm like explained in your other question about Min/Max values. Use grep (and possibly some awk) ...


2

It would be good if you provided a bit more detail to your question and indicated what you have already tried. Working examples are always appreciated. Here is a function that calculates a correlogram on point data. You could, in theory, modify it to operate on a raster or on a subsample of a raster. Although, I wonder about the computational tractability ...



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