Quantcast

Overwriting Georeferencing Information of a GeoTIFF file

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Overwriting Georeferencing Information of a GeoTIFF file

Andreas Neumann
Hi GDAL users/developers,

Is it possible to overwrite georeferencing information of an existing
geotiff file? For some reasons, some of the files I received have
georeferencing information in Millimeters instead of Meters. All of my
data uses meters as units.

I thought that maybe it is possible to create a tfw file and modify the
tfw file, but since the tiff file also has the original georeferencing
information in millimeters, the internal georeferencing still takes
precedence over the external tfw file. Is there some way to force gdal to
prefer the tfw file?

If not - what else could I do? Write different projection files?

Actually, I don't want to modify the rasters at all, just the
georeferencing information.

Thanks for any hints,
Andreas


--
Andreas Neumann
http://www.carto.net/neumann/
http://www.svgopen.org/

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Overwriting Georeferencing Information of a GeoTIFF file

Benoît Andrieu
Hi,

Some times ago, I tried to update the georeferencing information by code but it didn't seem to work.
My solution was to first destroy the informations by using gdal_translate with -co PROFILE=BASELINE
Then to use the new Tiff with a prj file to have a GTiff

PROFILE=[GDALGeoTIFF/GeoTIFF/BASELINE]: Control what non-baseline tags are emitted by GDAL.

    * With GDALGeoTIFF (the default) various GDAL custom tags may be written.
    * With GeoTIFF only GeoTIFF tags will be added to the baseline.
    * With BASELINE no GDAL or GeoTIFF tags will be written. BASELINE is occationally useful when writing files to be read by
applications intolerant of unrecognised tags.

There could be some better way...

Regards,

Benoît Andrieu
[hidden email]
[hidden email]

----- Original Message -----
From: "Andreas Neumann" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, May 05, 2009 1:53 PM
Subject: [gdal-dev] Overwriting Georeferencing Information of a GeoTIFF file


> Hi GDAL users/developers,
>
> Is it possible to overwrite georeferencing information of an existing
> geotiff file? For some reasons, some of the files I received have
> georeferencing information in Millimeters instead of Meters. All of my
> data uses meters as units.
>
> I thought that maybe it is possible to create a tfw file and modify the
> tfw file, but since the tiff file also has the original georeferencing
> information in millimeters, the internal georeferencing still takes
> precedence over the external tfw file. Is there some way to force gdal to
> prefer the tfw file?
>
> If not - what else could I do? Write different projection files?
>
> Actually, I don't want to modify the rasters at all, just the
> georeferencing information.
>
> Thanks for any hints,
> Andreas
>
>
> --
> Andreas Neumann
> http://www.carto.net/neumann/
> http://www.svgopen.org/
>
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev 

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Overwriting Georeferencing Information of a GeoTIFF file

Nikos Alexandris
In reply to this post by Andreas Neumann

Andreas N:
> Hi GDAL users/developers,
> Is it possible to overwrite georeferencing information of an existing
> geotiff [*] file?

Not sure that it will do the job but it might be interesting to have a
look at the utilities listgeo, geotifcp (part of geotiff-bin under
linux).

Kind regards, Nikos

[*] GeoTiff, http://trac.osgeo.org/geotiff
[2] http://www.remotesensing.org/geotiff/listgeo.html
[3] http://www.remotesensing.org/geotiff/geotifcp.html

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Overwriting Georeferencing Information of a GeoTIFF file

Andreas Neumann
In reply to this post by Benoît Andrieu
Thanks Nikos and Benoît!

The solution with the BASELINE profile seems to work perfect. Haven't
thought about that!

Thank you for your quick help!

Andreas


On Tue, May 5, 2009 2:31 pm, Benoît Andrieu wrote:

> Hi,
>
> Some times ago, I tried to update the georeferencing information by code
> but it didn't seem to work.
> My solution was to first destroy the informations by using gdal_translate
> with -co PROFILE=BASELINE
> Then to use the new Tiff with a prj file to have a GTiff
>
> PROFILE=[GDALGeoTIFF/GeoTIFF/BASELINE]: Control what non-baseline tags are
> emitted by GDAL.
>
>     * With GDALGeoTIFF (the default) various GDAL custom tags may be
> written.
>     * With GeoTIFF only GeoTIFF tags will be added to the baseline.
>     * With BASELINE no GDAL or GeoTIFF tags will be written. BASELINE is
> occationally useful when writing files to be read by
> applications intolerant of unrecognised tags.
>
> There could be some better way...
>
> Regards,
>
> Benoît Andrieu
> [hidden email]
> [hidden email]
>
> ----- Original Message -----
> From: "Andreas Neumann" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, May 05, 2009 1:53 PM
> Subject: [gdal-dev] Overwriting Georeferencing Information of a GeoTIFF
> file
>
>
>> Hi GDAL users/developers,
>>
>> Is it possible to overwrite georeferencing information of an existing
>> geotiff file? For some reasons, some of the files I received have
>> georeferencing information in Millimeters instead of Meters. All of my
>> data uses meters as units.
>>
>> I thought that maybe it is possible to create a tfw file and modify the
>> tfw file, but since the tiff file also has the original georeferencing
>> information in millimeters, the internal georeferencing still takes
>> precedence over the external tfw file. Is there some way to force gdal
>> to
>> prefer the tfw file?
>>
>> If not - what else could I do? Write different projection files?
>>
>> Actually, I don't want to modify the rasters at all, just the
>> georeferencing information.
>>
>> Thanks for any hints,
>> Andreas
>>
>>
>> --
>> Andreas Neumann
>> http://www.carto.net/neumann/
>> http://www.svgopen.org/
>>
>> _______________________________________________
>> gdal-dev mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>


--
Andreas Neumann
http://www.carto.net/neumann/
http://www.svgopen.org/

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Overwriting Georeferencing Information of a GeoTIFF file

Even Rouault
In reply to this post by Andreas Neumann
You can use the -a_srs and/or -a_ullr options (depending if you're interested
in the SRS or the georeferenced coordinates) of gdal_translate to produce a
new GeoTIFF with overriden information.

Le Tuesday 05 May 2009 13:53:25 Andreas Neumann, vous avez écrit :

> Hi GDAL users/developers,
>
> Is it possible to overwrite georeferencing information of an existing
> geotiff file? For some reasons, some of the files I received have
> georeferencing information in Millimeters instead of Meters. All of my
> data uses meters as units.
>
> I thought that maybe it is possible to create a tfw file and modify the
> tfw file, but since the tiff file also has the original georeferencing
> information in millimeters, the internal georeferencing still takes
> precedence over the external tfw file. Is there some way to force gdal to
> prefer the tfw file?
>
> If not - what else could I do? Write different projection files?
>
> Actually, I don't want to modify the rasters at all, just the
> georeferencing information.
>
> Thanks for any hints,
> Andreas


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Overwriting Georeferencing Information of a GeoTIFF file

Andrew Brooks
>
> Actually, I don't want to modify the rasters at all, just the
> georeferencing information.

The libtiff utilities now include a utility called applygeo which can change
the georeferencing tags without rewriting the raster data.

Andrew

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Loading...