[R] Transform Coordinate System of an ASCII-Grid
Barry Rowlingson
b.rowlingson at lancaster.ac.uk
Thu May 23 13:10:07 CEST 2013
On Thu, May 23, 2013 at 8:44 AM, jas
<jacqueline.schweizer at wuestundpartner.com> wrote:
> Dear all,
>
>
> I have an ASCII-Grid for Switzerland in the Swiss National Coordinate System
> of CH1903. Now for a Webapplication of the ASCII-Grid, I need to deliver the
> ASCII-Grid in the WGS84 System.
>
> Via coordinates(ascii) I can "export" the coordinates and convert them with
> a formula into WGS84. My problem is now, how can I implement these into the
> ASCII-Grid, so that the whole grid-structure is from now on gonna be saved
> in the WGS84-coordinate format?
> (important: I don't want to change the projection, I want to actually change
> the numeric format of the coordinates)
You can't change the numeric format of the coordinates without
changing the projection (unless changing from km to m).
In your original coordinate system your grid is a bunch of rectangles
with straight sides and right angles. In your WGS84 system the squares
are no longer square, the sides are no longer straight, and the angles
are no longer 90 degrees. This is all too complicated for a simple
grid data structure to comprehend.
The solution may be to reproject your grid. This is a transformation
of values, much like stretching an image file, from one grid to
another. raster:projectRaster can do this for you.
For a dataset with a small extent, for some small values of "small",
you may be able to get away with transforming the corner coordinates
and ignoring the fact that the earth is not flat. But this will make
everyone who thinks the earth is round cry.
You should also look into the raster package for more info. You've
not said what you're using to read the data.
You should probably ask in r-sig-geo anyway, where the mappers hang out.
Barry
More information about the R-help
mailing list