Hi Folks,<br><br>I was just wondering if there is a generic way to extract CRS/Projection information from a generic raster image for which there exists geo information..<br><br>What would be nice would be to use the output from gdalinfo to extract a Proj4 CRS string which defines the coordinate system of the image under investigation..<br>
<br>For example, I have a SPOT image with the following gdalinfo output:<br><br>Driver: GTiff/GeoTIFF<br>Files: IMAGERY.TIF<br>Size is 24000, 24000<br>Coordinate System is `&#39;<br>GCP Projection = GEOGCS[&quot;WGS 84&quot;,DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;WGS 84&quot;,6378137,298.2572235629972,AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;,0.0174532925199433],AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]<br>
GCP[&nbsp; 0]: Id=1, Info=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1,1) -&gt; (12.2141588220865,42.2864439118571,0)<br>GCP[&nbsp; 1]: Id=2, Info=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (24000,1) -&gt; (12.9457778570306,42.1574501849122,0)<br>GCP[&nbsp; 2]: Id=3, Info=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (24000,24000) -&gt; (12.773880153851,41.6326270994087,0)<br>
GCP[&nbsp; 3]: Id=4, Info=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1,24000) -&gt; (12.0481891024801,41.7611321956389,0)<br>Metadata:<br>&nbsp; AREA_OR_POINT=Point<br>&nbsp; TIFFTAG_IMAGEDESCRIPTION=PAN<br>&nbsp; TIFFTAG_DATETIME=2002:10:24 10:52:26<br>Image Structure Metadata:<br>
&nbsp; INTERLEAVE=BAND<br>Corner Coordinates:<br>Upper Left&nbsp; (&nbsp;&nbsp;&nbsp; 0.0,&nbsp;&nbsp;&nbsp; 0.0)<br>Lower Left&nbsp; (&nbsp;&nbsp;&nbsp; 0.0,24000.0)<br>Upper Right (24000.0,&nbsp;&nbsp;&nbsp; 0.0)<br>Lower Right (24000.0,24000.0)<br>Center&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (12000.0,12000.0)<br>Band 1 Block=24000x128 Type=Byte, ColorInterp=Gray<br>
<br><br><br>What would the Proj4 string be in this case?<br><br>How to generalize to any type of imagery and using gdalinfo&#39;s output??<br><br>Thanks in advance<br><br><br>-- <br>Mattia