[Gdal-dev] Transform raster into coordinate system

guillaume huby guillaume.huby.lists at gmail.com
Wed Jul 4 05:26:09 EDT 2007


>
> -------- Message original --------
> Sujet:  [Gdal-dev] Transform raster into coordinate system
> Date:   Wed, 4 Jul 2007 10:11:15 +0200
> De:     Ivan Mjartan <ivan.mjartan at geovap.cz>
> Pour ::         <gdal-dev at lists.maptools.org>
> Copie a` ::     Robert Matulík <robert.matulik at geovap.cz>
>
>
>
> Hi list,
>
>
>
> I'am trying solve one problem and I would like ask you, if it is
> possible using GDAL lib to solve it.
>
>
>
> At first I try describe what I need to do.
>
> So I have scan of raster (TIFF) without georeference and I need make geo
> position of this raster into SJTSK coordinate (*EPSG:102067*). So I know
> that it is not easy At first I need some geo referenced map (vector) and
> than mark identical point in the raster and vector map to get coordinate
> of identical point in raster. Then I can transform raster into my
> coordinate system.
>
> First what I need is compute polynomial formula to compute transform
> than I can compute output raster size after that I have to go throw each
> pixel in the output raster and compute (using polynomial formula) pixel
> from source raster.
>
> So problem is that source raster can be very large and other problem is
> that this algorithm is very expensive.
>
> My question is It is possible do it by using GDAL?
>
> I have source raster without geo reference and I have array of identical
> point and each identical point has real geo coordinate. And I would like
> transform source raster into coordinate system.


Hello,

I had the same problem yesterday. Here is how I solved it. The identical
point you have are named GCP (for Ground Control Points). For each GCP you
should have 2 pairs of numbers : (column, line) indexes of raster matrix and
(x, y) georeferenced coordinates of points. Once you have all this data for
your GCPs, you use gdal_translate utility to add GCPs into your raster (in
this sample 3 GCPs) :
gdal_translate -gcp 0 0 -2291216.87 2396570.93 -gcp 4100 0 2291216.87
2396570.93 -gcp <column> <line> <x> <y> image.tif image_gcp.tif (see
http://www.gdal.org/gdal_translate.html)
Then you can directly apply polynomial to your raster using gdalwarp :
gdalwarp -order 1 image_gcp.tif image_georef.tif (where order is the order
of your polynomial model).
For an order 1 you need at least 3 GCPs. There is also a spline option (see
http://www.gdal.org/gdalwarp.html).

I hope this will help you.

Good luck,
Guillaume.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070704/6ba78ef0/attachment.html


More information about the Gdal-dev mailing list