[R-sig-Geo] How to translate coordinates from cylindrical to a Lambert Azimuthal Equal Area Projection

Julian M. Burgos julian at hafro.is
Wed Apr 24 11:34:59 CEST 2013


Hi Ivailo,

I would just create a SpatialPoints object with four points defining the
horizontal and vertical extent of your area of interest.  Something like
this:

maximum latitude, mean longitude
minimum latitude, mean longitude
mean latitude, maximum longitude
mean latitude, maximum longitude

Make sure that the projection for these points is ("+proj=longlat
+datum=WGS84").

Then use the spTransform function (rgdal package) to transform these
four points into the Lambert Azimuthal Equal Area projection.  Now you
have your horizontal and vertical ranges. 

Next, use the raster package. Create an Extent object with your
 horizontal and vertical ranges, and use the crop function to change the
 extent of your raster to your area of interest.

Good luck!

Julian

Julian Mariano Burgos, PhD
Hafrannsóknastofnunin/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian at hafro.is

Ivailo writes:

> Dear Listmembers,
>
> I have a 40 000 x 40 000 GeoTIFF file that I need to crop to an area
> of interest (perhaps about 1000 x 1000 pixels, 25 x 25 m grid). The
> file seems to be in the Lambert Azimuthal Equal Area Projection
> (coord. ref. : +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000
> +y_0=3210000 +ellps=GRS80 +units=m +no_defs) while I use Google Earth
> (using a Cylindrical projection with a WGS84 datum) to navigate and
> delineate the extent of the area I'd like to crop from the original
> file.
>
> As I don't have much experience working with Raster* objects as
> defined in the raster package, I'd like to ask you for help in
> "translating" the coordinates I get from Google Earth (i.e., decimal
> degrees) to the ones needed to define the extent of interest for the
> RasterLayer object I have created by reading the GeoTiff file via
> `raster("myfile.tif")`.
>
> Any insight would be much appreciated.
>
> Ivailo
> --
> UBUNTU: a person is a person through other persons.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--



More information about the R-sig-Geo mailing list