Hot answers tagged geotiff
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, ...
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 ...
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
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.
Use gdal_translate to convert it to a GeoTiff.
5
What you want to do is called Normalization and the general formula is :
where:
In = New Value
I = Present Value
Min= The minimum present value
Max = The maximum present value
newMin/newMax = the desired Min/Man (in your case 0 and 255)
You can use use a combination of gdal/python/numpy to open hdf datasets and perform cell calculations based on ...
5
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 ...
5
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
...
5
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 ...
5
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 ...
4
If you're using Python I'd recommend using the GDAL library, which has it's own Python bindings. Assuming you've got both GDAl (see this GIS StackExchange question for details on how to install on windows) and numpy installed, your code could look something like:
from osgeo import gdal
import numpy as np
#Open our original data as read only
dataset = ...
4
Some clarifications in your question are needed. On what technology or platform are you creating and serving these images? Various tiling schemes, pyramids and overviews exist but they have little to do with the format of the images.
For example in ArcGIS, raster pyramids take the form of a .ovr file for single raster datasets. For mosaic datasets, overview ...
4
Answer to all your needs is Geoserver and OpenLayers.
You can turn all your Geotiffs into WMS in any projection you need.
GeoServer has GeoWebCache, which will allow you to very easily cache tiles and serve them to Openlayers.
Geoserver will let you serve out Polygons and Points too. It
support almost all modern out put formats like GML, KML etc. all of
...
4
You've got a projection issue. Chances are you've not specified the projection of the DEM correctly.
There are typically two indicators to this and you have both:
You have spikes.
You have a cell size that looks like: 0.000278 (it should be a whole number).
So make sure you've set the correct projection for the DEM as well as the drape (if memory serves, ...
4
Unless your app is written in Java then the REST approach is the most elegant as it can be coded in any language that has an HTTP lib (all of them).
Any solution using selenium or something similar should be an absolute last resort, changes to the REST API will likely remain backward compatible so you can upgrade GeoServer with confidence, the UI will ...
4
Use gdal_translate.
Here are some instructions on its use:
http://www.gdal.org/gdal_translate.html
Here is the download page including some information about setting it up in Mountain Lion:
http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries
http://www.kyngchaos.com/software:frameworks
If you want to build it yourself:
...
3
Do you know the extents of the image? If you know the bounding coordinates of the image you can us gdal_translate with the -a_srs (this assigns the projection) and -a_ullr (this is the bounding coordinates). I have used this to convert .jpg of sonar images from a low cost fishing sonar unit to geotiffs.
3
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 ...
3
How about using GDAL? It is available via FWTools (easier install) on Windows, via apt-get on Ubuntu, and via a binary for OSX.
Once you have GDAL just go ahead and use:
gdal_translate -of JP2OpenJPEG <input> <output>
or
gdal_translate -of JPEG2000 <input> <output>
The above command uses the built in JP2 format conversion. ...
3
To expand on @Garrett Hall's answer, gdal_translate is indeed what you need. Something like this should work:
gdal_translate -a_srs <CRS> -a_ullr <xmin> <ymax> <xmax> <ymin> src.tif dest.tif
Where <CRS> should be something like EPSG:27700 and <xmin> <ymax> <xmax> <ymin> should be the known ...
3
In the ESRI world, if the image is georeferenced, but not rectified, gdalinfo won't return the projection information
Driver: GTiff/GeoTIFF
Files: COVE_COGEO.tif
COVE_COGEO.aux
Cove_COGEO.rrd
COVE_COGEO.tif.aux.xml
Size is 6618, 8176
Coordinate System is `'
Metadata:
TIFFTAG_IMAGEDESCRIPTION=
TIFFTAG_MAXSAMPLEVALUE=1
...
3
Hei!
Choose Raster menu - Conversion - Translate (Convert format). Then choose *Input file* for the image You want to convert. Under the *Output file* You can choose the format You need. There is .jpg too (with some 20+ file types).
I got 40MB large .tiff file, after conversion its only 1,6 MB as .jpg.
3
Your tiff file is definitely inefficient, files around 1-2GB are normally better since GeoServer won't have to open as many files to generate the output.
Inner tiles help when you are zoomed in and need only to access a portion of the file.
Having a 4 times jump between levels will improve disk occupation, but will also slow down image serving and also ...
3
I would suggest creating a simple script using python.
Use the dataframe scale property to define map scale within your defined map document
Use Export to TIFF to generate new image file exported by dataframe extent
3
Your picture viewer uses a different resampling method. In GeoServer you can change the default interpolation from the default nearest neighbor interpolation to bilinear or bicubic:
http://docs.geoserver.org/stable/en/user/webadmin/services/WMS.html
Be aware that bilinear and bicubic interpolations require more resources.
3
Given a GeoTIFF file named original.tif, and a modified file (modified.tif) without the GeoTIFF tags, but still the same size and region:
listgeo -no_norm original.tif > original.geo
geotifcp -g original.geo modified.tif modified_geotiff.tif
It's explained here
Now admittedly, that's not quite your question, because you've changed the pixel size. The ...
3
By default GeoServer picks the closest resolution to the one you're asking for. Programmatically one can set three different policies, but I don't believe the setting is exposed anywhere in the GeoServer GUI.
You may want to open an improvement request at jira.codehaus.org.
3
AWK is perhaps the most effective tool for such text conversion (although if you're familiar with Perl you might prefer it, out of habit): it was designed for exactly this kind of one-off quick reformatting work.
Here is the full AWK code to perform the requested operation on the input specified:
BEGIN {OFS="\n"}
{print $2, $3, $4, $5 $6, $7, $8 > $1}
...
3
You probably don't need to convert a GeoTiff to a Tiff.
As a GeoTiff your image will not only be readable by any GIS package but probably can also be read by any image manipulation package too (e.g. Photoshop, GIMP etc) baring some exceptions. Image editing packages simply ignore the bits in the Tiff header that make it a GeoTiff - either that or they ...
2
i think you should check out grass plugin for your study. it has lots of raster analysis as Hydrologic modeling toolbox. you can check out GRASS GIS 6.4.3svn Reference Manual here
Watershed modeling related modules are r.basins.fill, r.water.outlet,
r.watershed, and r.terraflow. Water flow related modules are r.carve,
r.drain, r.fill.dir, ...
Only top voted, non community-wiki answers of a minimum length are eligible
