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) Thank you so much for your help, jas -- View this message in context: http://r.789695.n4.nabble.com/Transform-Coordinate-System-of-an-ASCII-Grid-tp4667786.html Sent from the R help mailing list archive at Nabble.com.
Daisy Englert Duursma
2013-May-23 10:22 UTC
[R] Transform Coordinate System of an ASCII-Grid
Hello, You question is a bit unclear. Do you just want to change to decimal degrees? Can you please provide an example of your code and include a small example ascii. On Thu, May 23, 2013 at 5:44 PM, 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) > > Thank you so much for your help, > jas > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Transform-Coordinate-System-of-an-ASCII-Grid-tp4667786.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Daisy Englert Duursma Department of Biological Sciences Room E8C156 Macquarie University, North Ryde, NSW 2109 Australia Tel +61 2 9850 9256
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