[Qgis-developer] Plugin Georeference handle files with existing georeferencing information

Manuel Massing m.massing at warped-space.de
Tue Jul 13 06:26:33 EDT 2010


Hi Luiz,

> I wonder if someone is working on Ticket #2465:
> Georeferencer: does not correctly handle files with existing
> georeferencing information.

I think I'll try to find a more general solution for this, in the
meantime there is a patch with workaround attached to the ticket. 
The workaround touches on a core class though, so has not been included
in the SVN codebase.
 
> I use a images with georeferencing information (example CBERS satellite
> image), and for use Georeference
> i need make some steps:
> 1) Create JPG image from original (GeoTIF)
> 2) Delete file [name original image].jpg.aux.xml
> 3) Use JPG in georeference plugin
> Add GCP's, in this case, i get the maps coordinate with same projection
> of original image (geotif).
> For this i use the plugin "Coordinate Capture"
> 4) Get strig to GDAL (gdal_translate and gdalwarp)
> 5) Changes this string and run in console
> 5.1) gdal_translate: put EPSG with original image
> gdal_translate -a_srs EPSG:29180 -of GTiff [-gcp pixel line -gcp pixel
> line] "original.tif" "original_gcp.tif"
> * [-gcp pixel line -gcp pixel line] = gcp's show in string
> 5.2) gdalwarp:
> gdalwarp -r near -order 1 -co  -dstalpha -tr 2.500000 -2.500000
> original_gcp.tif georef.tif
> * in my case i not use COMPRESS

It is probably easier to strip georeferencing information using either the
geotiff baseline profile (which does not store SRS/geotransform information):

	gdal_translate -co "profile=baseline" <INPUT-FILE> <OUTPUT-FILE>

or by creating a "Virtual Dataset" file. The VRT method has the advantage of
not requiring an intermediate copy of the data:

	1) gdal_translate -of VRT <INPUT-FILE> <OUTPUT-FILE.vrt>
	2) open <OUTPUT-FILE.vrt> and remove the SRS and GeoTransform tags

The <OUTPUT-FILE> is then free of georeferencing information / SRS and can be 
used in the georeferencer without issues.

bye,

	Manuel


More information about the Qgis-developer mailing list