<span class="gmail_quote"></span><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">-------- Message original --------<br>Sujet:&nbsp;&nbsp;[Gdal-dev] Transform raster into coordinate system
<br>Date:&nbsp;&nbsp; Wed, 4 Jul 2007 10:11:15 +0200<br>De:&nbsp;&nbsp;&nbsp;&nbsp; Ivan Mjartan &lt;<a href="mailto:ivan.mjartan@geovap.cz">ivan.mjartan@geovap.cz</a>&gt;<br>Pour ::&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="mailto:gdal-dev@lists.maptools.org">gdal-dev@lists.maptools.org
</a>&gt;<br>Copie a` ::&nbsp;&nbsp;&nbsp;&nbsp; Robert Matulík &lt;<a href="mailto:robert.matulik@geovap.cz">robert.matulik@geovap.cz</a>&gt;<br><br><br><br>Hi list,<br><br><br><br>I&#39;am trying solve one problem and I would like ask you, if it is
<br>possible using GDAL lib to solve it.<br><br><br><br>At first I try describe what I need to do.<br><br>So I have scan of raster (TIFF) without georeference and I need make geo<br>position of this raster into SJTSK coordinate (*EPSG:102067*). So I know
<br>that it is not easy At first I need some geo referenced map (vector) and<br>than mark identical point in the raster and vector map to get coordinate<br>of identical point in raster. Then I can transform raster into my
<br>coordinate system.<br><br>First what I need is compute polynomial formula to compute transform<br>than I can compute output raster size after that I have to go throw each<br>pixel in the output raster and compute (using polynomial formula) pixel
<br>from source raster.<br><br>So problem is that source raster can be very large and other problem is<br>that this algorithm is very expensive.<br><br>My question is It is possible do it by using GDAL?<br><br>I have source raster without geo reference and I have array of identical
<br>point and each identical point has real geo coordinate. And I would like<br>transform source raster into coordinate system.</blockquote><div><br>Hello,<br><br>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) :
<br>gdal_translate -gcp 0 0 -2291216.87 2396570.93 -gcp 4100 0 2291216.87 2396570.93 -gcp &lt;column&gt; &lt;line&gt; &lt;x&gt; &lt;y&gt; image.tif image_gcp.tif (see <a href="http://www.gdal.org/gdal_translate.html">http://www.gdal.org/gdal_translate.html
</a>)<br>Then you can directly apply polynomial to your raster using gdalwarp :<br>gdalwarp -order 1 image_gcp.tif image_georef.tif (where order is the order of your polynomial model).<br>For an order 1 you need at least 3 GCPs. There is also a spline option (see 
<a href="http://www.gdal.org/gdalwarp.html">http://www.gdal.org/gdalwarp.html</a>).<br><br>I hope this will help you.<br><br>Good luck,<br>Guillaume.<br></div><br></div>