0

I've two rasters and would like to project one into coordinate system of another. One raster has an extent in meters and one in lat/long. I would like use gdal to take the raster which has an extent in lat/long and to project it into crs of another raster.

The output of gdalinfo of the first raster is:

PROJCS["NZGD_2000_New_Zealand_Transverse_Mercator", GEOGCS["GCS_NZGD_2000", DATUM["New_Zealand_Geodetic_Datum_2000", SPHEROID["GRS_1980",6378137,298.257222101, AUTHORITY["EPSG","7019"]], AUTHORITY["EPSG","6167"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433]], PROJECTION["Transverse_Mercator"], PARAMETER["latitude_of_origin",0], PARAMETER["central_meridian",173], PARAMETER["scale_factor",0.9996], PARAMETER["false_easting",1600000], PARAMETER["false_northing",10000000], UNIT["metre",1, AUTHORITY["EPSG","9001"]]] Origin = (1323824.000000000000000,5190684.000000000000000) Pixel Size = (100.000000000000000,-100.000000000000000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 1323824.000, 5190684.000) (169d35'25.39"E, 43d23' 9.18"S) Lower Left ( 1323824.000, 5004684.000) (169d29'32.65"E, 45d 3'26.70"S) Upper Right ( 1422924.000, 5190684.000) (170d48'45.84"E, 43d24'56.95"S) Lower Right ( 1422924.000, 5004684.000) (170d44'59.23"E, 45d 5'20.90"S) Center ( 1373374.000, 5097684.000) (170d 9'43.02"E, 44d14'19.75"S)

And the output of the gdalinfo for the second raster is: GEOGCS["NZGD49", DATUM["New_Zealand_Geodetic_Datum_1949", SPHEROID["International 1924",6378388,297.000000000005, AUTHORITY["EPSG","7022"]], TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993], AUTHORITY["EPSG","6272"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4272"]] Origin = (166.474999999999990,-34.424999999999997) Pixel Size = (0.049382716049383,-0.049423076923077) Metadata: AREA_OR_POINT=Area Image Structure Metadata: COMPRESSION=LZW INTERLEAVE=BAND Corner Coordinates: Upper Left ( 166.4750000, -34.4250000) (166d28'30.00"E, 34d25'30.00"S) Lower Left ( 166.4750000, -47.2750000) (166d28'30.00"E, 47d16'30.00"S) Upper Right ( 178.4750000, -34.4250000) (178d28'30.00"E, 34d25'30.00"S) Lower Right ( 178.4750000, -47.2750000) (178d28'30.00"E, 47d16'30.00"S) Center ( 172.4750000, -40.8500000) (172d28'30.00"E, 40d51' 0.00"S)

Basically I need to repoject second raster into crs of first and have extent in meters.

1 Answer 1

1

Using GDALWarp and assuming bilinear resampling:

GDALWarp -s_srs EPSG:4272 -t_srs EPSG:2193 -r bilinear <Your Image> <Output Image>

Both NZGD49 and NZTM2000 are well known coordinate systems, GDAL should have no problem converting between them despite the difference in spheroid.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.