[R-sig-Geo] converting the projection

Michael Sumner mdsumner at gmail.com
Wed Sep 20 02:32:13 CEST 2017


Keep on list please.

Share code to demonstrate so we can see the problem.  Use projectRaster(a,
b)  for alignment,  try crop(b,  ex,  snap = "out")  for inclusive crop.

And apologies I wrote clip instead of crop earlier.

Cheers,  Mike

On Wed, 20 Sep 2017, 07:42 Kyongho Son <kkyong77 at hotmail.com> wrote:

> I did the exact same way, but the output of the reprojection of 'a' raster
> did not properly align with 'b' raster.
>
>
>
>
>
> *Kyongho Son*
> Postdoctoral Fellow
> Research Foundation of The City University of New York
>
>
>
> ------------------------------
> *From:* Michael Sumner <mdsumner at gmail.com>
> *Sent:* Tuesday, September 19, 2017 5:03 PM
> *To:* Kyongho Son; r-sig-geo
> *Subject:* Re: [R-sig-Geo] converting the projection
>
> Try projecting just the extent
> library(raster)
> ex <- projectExtent(a,  projection(b))
> clip(b,  ex)
>
> where a,  b are your two raster.
>
> Cheers,  Mike
>
> On Wed, 20 Sep 2017, 06:18 Kyongho Son <kkyong77 at hotmail.com> wrote:
>
>>
>> Hi I have two raster data sets but they have two datum and projection.
>>
>> I would like to convert one to the other since I would like to clip the
>> one raster using the other raster.
>>
>> they should have same projections.
>>
>>
>> proj4string(bb)
>> [1] "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
>> proj4string(SOSTavg)
>>
>>  proj4string(SOSTavg)
>> [1] "+proj=laea +lat_0=-100 +lon_0=6370997 +x_0=45 +y_0=0 +ellps=WGS84
>> +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
>>
>>
>> Thanks,
>>
>> Kyongho
>>
>>
>>
>>
>>
>>
>>
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
> --
>
> <https://maps.google.com/?q=203+Channel+Highway+%0D+Kingston+Tasmania+7050+Australia&entry=gmail&source=g>
> Dr. Michael Sumner
> Software and Database Engineer
> Australian Antarctic Division
> 203 Channel Highway
> <https://maps.google.com/?q=203+Channel+Highway+%0D+Kingston+Tasmania+7050+Australia&entry=gmail&source=g>
> Kingston Tasmania 7050 Australia
> <https://maps.google.com/?q=203+Channel+Highway+%0D+Kingston+Tasmania+7050+Australia&entry=gmail&source=g>
>
> --
Dr. Michael Sumner
Software and Database Engineer
Australian Antarctic Division
203 Channel Highway
Kingston Tasmania 7050 Australia

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list