Tag Info

Hot answers tagged

34

To select compression method you need to use a command like: gdal_translate -co "COMPRESS=method" src_dataset dst_dataset When you use compression biggest trade-off is extra processing time which is required to uncompress the image, and after uncompressing the image would still consume same amount of memory. About information loss there are two basic ...


22

Looks like gdalinfo will tell you: A non-georeferenced figure exported from ArcMap layout: C:\Temp>gdalinfo figure1.tif Driver: GTiff/GeoTIFF Files: figure1.tif Size is 244, 210 Coordinate System is `' Metadata: TIFFTAG_XRESOLUTION=96 TIFFTAG_YRESOLUTION=96 TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) Image Structure Metadata: INTERLEAVE=PIXEL Corner ...


10

Usually, GeoTIFFs are compressed for storage. Running gdal_merge on default settings won't compress the file. Add the option -co COMPRESS=DEFLATE (or any of the other options listed in the documentation) to your command to get smaller output files.


10

You need to tile the image and add overviews so that the whole image is never read into memory at the same time. GeoServer provides an image pyramid datastore for this purpose. I wrote these notes describing how I set this up on my machine. The key step is to use GDAL to build the pyramid using the following command: mkdir bmpyramid gdal_retile.py -v -r ...


9

With lzw and deflate compression using -co predictor=2 can help with imagery that is smoothly varying as it compresses the differences from pixel to pixel instead of the absolute values, and these will tend to be small and have more patterns (ref). Predictor is only useful with lzw and deflate compression, the option has no effect with other methods. ...


8

Make a tiny Python script named "UpdateSRS.py": import sys from glob import glob from osgeo import gdal, osr # Define your projection here sr = osr.SpatialReference() # For example, UTM Zone 11 sr.SetUTM(11) sr_wkt = sr.ExportToWkt() file_list = set() for arg in sys.argv[1:]: file_list.update(glob(arg)) for file in file_list: ds = gdal.Open(file, ...


8

There is no service or readily available tool that I can think of. But if you are comfortable on the command line and willing to spend some time tinkering, here is a way that can work Download the OSM shapefile. Import the shapefile to TileMill.. Once you style it, export it as a georeferenced PNG. The following command should work once you have ...


7

Recent versions of gdal_translate have support for KML Superoverlay. Although it is not yet documented on the GDAL website the following can be used: gdal_translate.exe -of KMLSUPEROVERLAY c:\in.tif c:\out.kmz -co FORMAT=JPEG This will save a tiled version in a kmz file using jpeg compression. On windows you can automate using forfiles /m *.tif /c "cmd ...


7

Download the source code from here http://www.osola.org.uk/elevations/index.htm SRTMGeoTIFFReader.php is the clever file the reads the GeoTiff and converts the elevation values (in meters) into Lat/Lng coordinates. I doubt this is exactly what you want but it does give you a solid base on understanding the process required to accomplish the task from your ...


7

You can use GetStatistics Method to get the stats. eg. stats = ds.GetRasterBand(1).GetStatistics(0,1) it will return (Min, Max, Mean, StdDev) so the xml can be read: <PAMDataset> <PAMRasterBand band="1"> <Metadata> <MDI key="STATISTICS_MINIMUM">stats[0]</MDI> <MDI ...


7

I suspect that your TIFFs might be Ordnance Survey Vector Map District rasters? I've not loaded any of these into Postgres/PostGIS but I have loaded some into a Rasterlite DB. The secret is to batch translate the TIFFs from indexed to RGB GeoTIFFs before loading them into the database. Raster -> Conversion -> Translate (Convert Format), tick 'Batch mode' and ...


7

If you can accept some quality degradation in the image, you may try out something like the following, using the GDAL utilities: gdal_translate -co "TILED=YES" -co "COMPRESS=JPEG" -co "PHOTOMETRIC=YCBCR" input.tiff output.tiff gdaladdo -r average --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR 2 4 8 16 output.tiff The above should ...


7

Files ending with 'w' (tfw, jpw or jgw, bpw and so on) are world files. These files are used to geolocate rasters that otherwise have no means of geolocation. They tell the GIS where the file's origin is in the real world and the size and rotation of the pixels. however, they do not store any information about projection. You only need a world file if ...


7

I think I can answer it for you. If you look at the precision vs. accuracy image on the link you provided, precision refers to the repeatability of the observation. For example, if I measure the distance from one point to another and it is always vaying only by a very small amount, then I am making measurements at a high precision. But, basically, ...


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


6

For big rasters GeoTiff offers the possibility to store (pre-)downscaled overviews as extra images to the GeoTiff file. This can be done with gdaladdo (= GDAL ADD Overview). When creating these overviews, you can manually tell gdal to comress them too: gdaladdo --config COMPRESS_OVERVIEW JPEG Speeds up viewing your data without adding too much size. ...


6

The listgeo utility that comes with libgeotiff is a nice command-line utility that can extract the TWF file from GeoTIFF files. For example, I have a directory of GeoTIFFs, and I have libgeotiff installed as part of OSGeo4w. You can run the OSGeo4w shell, and do this: c:\dat\NZ-Topo50>listgeo -tfw BN24_GeoTif_1-01.tif World file written to ...


6

In arcmap 10. I think I would use the footprint feature (in mosaic dataset) and then generate the centroid of those polygons. add an x and a y field to my attribute table, calculate the geometry, then export to dbf and convert to xls. Also found in this answer are several resources for esri help.


6

You need a Python library that supports the GeoTIFF format. Libraries that support only the TIFF file discard the projection and geotransform metadata when they are saved. GDAL is the most used open source Python library for reading/writing spatially aware rasters. So, for your example: from osgeo import gdal # Load file, and access the band and get a ...


6

GDAL has a wonderful file format called VRT, which is an XML wrapper around one or more raster files. One feature of VRTs is their ability to encode square convolution kernels for any given band. It does involve playing around with XML in a text editor (or programatically), but if you're already used to the GDAL tools, it shouldn't be too hard. To ...


6

There is a little bit of information which might help you in your task. First you may need to download FWTools inorder to use geotifcp and listgeo. Create a TIFF File(You already did it..) Let us call it initialtif.tif find the image width and height(from where you saved it). imageWidth = 1016 imageHeight = 551 Create a World File for our ...


6

I think that all of listed by you software allow to execute batch converting in some way. ArcGIS I can explain how is it possible to perform in ArcGIS. Converting of one raster JPEG2000 -> GeoTiff can be done using tool Raster To Other Format (Conversion). Don't forget to setup appropriate raster storage settings in Environment variables when running ...


6

I am not sure if you are aware of the -scale feature of the gdaltranslate tool. it might be just what you are looking for. It defaults to 0-255 and the min and maxx of your rasters. You should also set the null values before using this. You might want to specify the output as type Byte just to be sure -ot "Byte" hope this helps, :) Edit: I always like ...


6

I have written a tutorial on exactly this problem that you may find helpful. Basically it boils down to using gdal_translate, gdal_merge and gdal_retile so you will need to have installed GDAL. Either use apt-get install gdal or the osgeo4w installer


6

You could explicitly set the output coordinate range using the target extent option to gdalwarp (ie. "-te -180 -90 180 90") but you can also use the CENTER_LONG configuration option to force rewrapping around a new central longitude. Something like this: gdalwarp -t_srs WGS84 ~/0_360.tif 180.tif -wo SOURCE_EXTRA=1000 \ --config CENTER_LONG 0 ...


6

I had a similar problem few weeks ago . I resolved it this way: creating pyramids rasters image (all rasters had got pyramids depends on standard scale rate in my project creating tiles from raster (mosaic) putting all files to postgis (by WKTRaster) By this way you get MRDB (multi-resolution data base) which is the most effective way of serving a large ...


6

I ran an experiment with a TIFF file and an ECW. Started with a 1.2 GB ECW, and converted it to TIFF with compression and pyramids, it was ~1.5 GB. So I think that a TIFF can be a similar size to an ECW. I would mosaic the image using GDAL, ensuring that compression is on. Then build pyramids, and if the resulting file is reasonable (less than 10 GB, I ...


6

It isn't nice code, but for your specific circumstance, here is some python that should save typing them out by hand: f = open('list.txt', 'r') lines = f.readlines() for line in lines: lineparts = line.split(' ') outfile = open(lineparts[0], 'w') for i in range(1, 4): outfile.write(lineparts[i] + '\n') outfile.write(lineparts[4] + ...


5

Here's an old blog article of mine looking at the file size and access time of the formats. I didn't investigate the write speed, only the access time. I'd say they would probably be directly related, but wouldn't be able to vouch for it. Article Summary: It seems that Packbits gives you the best access times (at expense of disk space), whereas Deflate ...



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