[gdal-dev] Matching two rasters

Chaitanya kumar CH chaitanya.ch at gmail.com
Sat May 14 00:28:57 EDT 2011


Assuming you want to convert B's projection to A's.

First, run gdalinfo on A.tif and save the part under 'Coordinate System is:'
in a file named 'A.prf'. This is the OGC's WKT representation of the Spatial
Reference System of A.tif

Then, run gdalwarp on B.tif with the following options. "-t_srs A.prf" to
specify the projection system. Specify the target extents using the -te
option. You can get the extents from the output of gdalinfo on A.tif. You
might also want to set the resolution using the -tr option and the
resampling method using the -r option.


On Sat, May 14, 2011 at 1:28 AM, Jonathan Greenberg
<greenberg at ucdavis.edu>wrote:

> GDALers:
> Say I have two rasters, A and B with different projections, extents,
> and resolution.  I want to make B match A, such that the projection,
> resolution, and extent (filling in with some arbitrary value where
> there is no data) all match.  Is there a quick way to do this using
> command line gdal tools?
> --j
> --
> Jonathan A. Greenberg, PhD
> Assistant Project Scientist
> Center for Spatial Technologies and Remote Sensing (CSTARS)
> Department of Land, Air and Water Resources
> University of California, Davis
> One Shields Avenue
> Davis, CA 95616
> Phone: 415-763-5476
> AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110514/74816161/attachment.html

More information about the gdal-dev mailing list