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 ...


5

All the 'GDAL formats' (raster formats) are here http://www.gdal.org/formats_list.html. (3) DTEDO0, DTEDO1 and DTEDO2 (4) GeoTIFF (5) DTED are the supported formats.


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 + ...


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

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

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

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, ...


2

You can use the Buffer tool to add buffers to create a new shapefile representing the 1 mile buffers. Then you can use the Extract by Mask tool to clip the raster inside of the buffer shapefile features. Mind you need a Spatial Analyst extension to use this tool. I recommend using Python or even ModelBuilder to create a loop that will step through each ...


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

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 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

Building on Garrett Hall suggestion, you can use gdal_translate, and a GeoTIFF format specific setting that prevents GDAL from writing any GeoTIFF tags to the output file. If the georeferencing information is stored externally to the original file as a world file then it can be easily applied to the new corrected TIF. This assumes that you have QGIS ...


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 ...


2

It doesn't look like your code properly saves/closes the dataset. To do this, add this to the end: dst_ds = None # save, close Also, although it looks like you want to use -999 for NODATA, this needs to be set to the resulting band. If you want to learn more about raster processing with Python, check out rasterio.


2

Sure, gdal_translate: gdal_translate in_file.tif out_file.tif -co "PROFILE=GeoTIFF" -co "TFW=YES" the above command should do the trick.


2

GDAL should be able to convert rasters between any usual formats: gdal_translate -of SRTMHGT input.tif output.hgt See http://www.gdal.org/gdal_translate.html http://osgeo-org.1560.x6.nabble.com/gdal-dev-Aster-tif-files-to-hgt-td3742884.html for more details.


2

You can enforce real nodata on the file using GDAL translate utility, look in your QGIS install location bin\ folder. GDAL_Translate -of GTIFF -a_nodata value InTiff OutTiff Substitute your own value for value. NoData does not have to be the highest or lowest value in the file you can set it to any value. Only one value is supported though so if you have ...



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