i.rectify2
H. Olthof
olthof at ecn.nl
Mon Jan 17 03:52:33 EST 1994
Two weeks ago I asked advice on how to do a ll-->lcc coordinate transformation for rastardata covering large areas. I would like to thank everybody for their advice.
Since I could not access the ftp site where r.proj was, I decided to do it in another way,
which is similiar to the suggestion of Greg Koerper, which I found this morning in the mail.
(1) I transformed the raster map to a site list using:
r.stats -1zqg raster_map|s.in.ascii site_map ;
(2) do some awk to do "s.to.ascii" and then: v.in.ascii to get a vector map;
(3) use v.proj to do the coordinate transformation;
(4) do v.to.rast in the lcc mapset.
This procedure takes however, many,many hours of cpu. Especially, since you 'll
have to do a v.support after step (2) and (3) which takes a lot of time.
You can speed things a bit doing some more awk, by not converting to a vectorfile in the ll mapset, but making an ascii file for m.proj;
do some more awk on the output of m.proj, to create a dig_ascii map and import it in the lcc maset. Unfortunately, the lines in the file m.proj creates are 'to long...' for awk. And I didn't no how to wrap the lines. So I modified the procedure:
(1) using mapcalc to extract only the edges (pixels where the pixelvalue changed) and r.volume to make a sitelist containing the centroids of the polygons which the edges described;
(2) these were all converted to vector maps and then transformed to lcc;
(3) In lcc, after v.to.rast, you 'll have to fill the areas with their original values again.
You can do this with some clever mapcalc. But I used simply r.basins.fill, using the centroid data for the c_map and the edges map for the t_map;
(4) you'll have to sum this result with the map containing the edges to get the final result.
In this way, you'll reduce the amount of cells to be processed by a large amount.
I started this procedure last friday, and saw the result just now, and it works fine.
I still takes a lot of cpu, but it can be done in a day.
There are no 'holes',if you make the resolution in the ll mapset somewhat larger then you'll need in the lcc mapset.
Harm OLthof
More information about the grass-user
mailing list