Showing posts with label geotiff. Show all posts
Showing posts with label geotiff. Show all posts

Monday, 18 May 2015

Turning GeoTIFF into TIFF + worldfile (QGIS)

hi all,
after some weeks I go on with the videotutorial from the Project Tovel. Until now we saw how to download some Open Data for our GIS, how to load georeferenced raster level in QGIS, how to georeference historical maps.
Today I will show something particular, that probably many of you will not need very often working on landscape archaeological project, but that will be more important to manage excavation GIS: how to turn a GeoTIFF picture into a TIFF + worldfile image.
As some of you will know a GeoTIFF is a particular kind of raster data in which the georeferencing values are embedded within the TIFF itself. This option can be a nice solution for a topographer but it is extremely annoying for archaeologists. The reason is simple: topographers often work on pictures or maps that are ready to be used, without the necessity of any photo-editing, which (on the contrary) is an important phase in archaeological photo-mapping process (e.g. for the "Aramus method"). The primary difference between a GeoTIFF and a TIFF + worldfile image is that it is not possible to modify the first one without loosing the georeferencing values (which are integrated in the picture), while it is possible to perform some photo-editing operations (change the colors, balance the brightness and contrast, etc...) in the second one, without problems, being the geolocalization data stored in a separate file (the worldfile).
For this reason working with raster images and worldfile is often the best choice for archaeological GIS (especially for excavation), where it can be useful to "erase" all the part of the photo which are outside the area of interest (e.g. outside the rectification region) and to take advantage of transparency in overlapping different raster levels (which can correspond to different stratigraphic levels).
As I wrote previously, the videotutorial I prepared using the data of Project Tovel simply shows how to turn a GeoTIFF, currently the unique option for QGIS georeferencing module) into a TIFF and a worldfile, a more useful format, without exiting the software.


Have a nice day!

Friday, 30 August 2013

gdal_edit.py: if you can think it, you can do it

Hi all,
today I'll write a post about a python script I used to edit the projection of an old geotiff, to import it in the GIS I am managing for Aramus archaeological mission 2013. To understand why I needed to use such a script, I have to explain briefly the problem occurred this year.
Since eight years (2006), Arc-Team is supporting the excavation in Aramus (AR), currently leaded by Dott. Walter Kuntner of Insbruck University (Institut für Alte Geschichte und Altorientalistik), in colaboration with Prof. Hayk Avetissian (Yerevan State University). In 2006 Ing. Klaus Kerkow and Christine Hanisch produced an high resolution aerial map of Aramus hill, using S-42 geodetic datum (with the Krassowsky ellipsoid). Unfortunatley, since 2004, Aramus project has been set up on a modified version of S-42, to avoid bureaucratic problems. This is the reason why I had to convert the aerial map geotif from the Krassowsky-Pulkovo to the local Aramus system. If I could work with a georeferenced raster and a plain world file, it would have been simple to solve the problem, just modifying the coordinates directly in the code... but working with a geotiff, things became more complicated. I could georeference again the aerial map, but I wanted to spare time and keep the same quality of the original raster. Luckily Walter Kuntner found the right solution in internet: gdal_edit.py, a simple scrit able to "edit in place various information of an existing GDAL dataset (projection, geotransform, nodata, metadata)". I checked quickly If I had this script in my GDAL files, but I did not find it, so I simply copied the source code from the OSGeo SVN repository, at (this link) and I saved it in a .py file. Than I get the coordinates of the upper left and lower right corner of my geotiff in OpenJUMP ...


Copying the upper left coordinates of the geotif

... and finally I modified the GDAL dataset with this command:

python gdal_edit -a_ullr ulx uly lrx lry

where ulx and uly stand for the new x and y coordinates of the upper left corner of the geotif, while lrx and lry are the new x and y coordinates for the lower right corner.
I know that this problem is not very common, but I hope that this post will be anyway somehow useful to ATOR readers.
Have a nice day!

Thursday, 4 July 2013

Photomapping with Quantum GIS (Khovle method)

Hi everybody
Together with Alexamder Sachsenmaier and Alesandro Bezzi i found out a method to create a photomosaic just with QGIS. The problem was to export the single pictures in a good quality and in the size of the whole photomosaic not just the size of the single picture. But this works fine with the print composer of QGIS
So shortly:
1. edith the file of the ground control points to a .csv file
2. import the .csv file into QGIS (plugin is requiered)
3. change the design of the points
4. start the print composer and export the model with the points. Here its possible to set the dpi: e.g. for an area of 3x2m 500dpi gives a resolution of more or less 1mm
5. start the georeferencing plugin of QGIS and georeference the model
6. to export the wordfile from the geotiff of the model, type the following in the terminal
gdal_translate -co "TFW=YES" input_geotif.tif output_tif_tfw.tif
or open the model in OpenJUMP and close it again
7. georeference all the single pictures with QGIS
8. start the same print composer like the one for the model and export all single picures (dont move the pictures)
9. open the model in GIMP and import all single pictures as single layers
10. give the same name to the wordfile of the model and the photomosaic
Alessandro allready maked a videotutorial:



So, I hope this is helpful for somebody...
BlogItalia - La directory italiana dei blog Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.