<HTML dir=ltr><HEAD><TITLE>Re: R: [GRASS-dev] Reproject, change resolution and patch: doubts....</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR><BASE href=http://mailstore.rossoalice.alice.it/exchange/Alice000000001264700/Bozze/R:%20R:%20[GRASS-dev]%20Reproject,%20change%20resolution%20and%20patch:%20doubts.....EML/1_text.htm></HEAD>
<BODY>
<DIV id=idOWAReplyText11465 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Hi Helena,</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>&gt; 1) r.proj method=nearest</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>good, the basic step has been fixed :-)</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>&gt; 2) r.resamp.rst</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>&gt;- you don't need this step if the default nearest neighbor works for <BR>&gt;your application<BR>&gt;&nbsp; - it is useful only if you needed smooth connection between the 20m <BR>&gt;DEM and SRTM. ( r.resamp.rst does interpolation using a spline <BR>&gt;function - you can make it pass exactly through the given data points <BR>&gt;by setting smoothing =0.)</FONT></DIV><FONT face=Arial color=#000000 size=2>
<DIV dir=ltr><BR>Actually I already thought that, in any case, I should at least fix the interferences among the two different maps. That means that I should at least apply r.resamp.rst along the line where the two maps collide. </FONT><FONT face=Arial color=#000000 size=2>Having the 20m raster called, for example, 20mDEM, I figured out (and already tested) how to create a polygon matching the exact boudaries of that map (exactly an area vector layer matching the whole area covered by the 20mDEM map):</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2>create a raster from 20mDEM with NULL if NULL and 0 if &gt;=0</FONT></DIV>
<DIV dir=ltr><FONT size=2>transform that raster into a vector layer faeaturing the area covered by it</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>r.mapcalc 20mDEM_surface='if(20mDEM,0)'</FONT><FONT size=2></FONT></DIV>
<DIV dir=ltr><FONT size=2>r.to.vect feauture=area</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2>Then I could apply r.resamp.rst on a buffer along the polyline that describe the border of the above area... but I'm not sure how to do that, I still need to carefully read the online manuals (unfortunately I still don't have the book of Markus; GFOSS.it association kindly gave me&nbsp;a copy... but I still have to get it...)</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2>Thanks,</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2>Marco</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Da:</B> Helena Mitasova [mailto:hmitaso@unity.ncsu.edu]<BR><B>Inviato:</B> gio 08/05/2008 2.46<BR><B>A:</B> marco.pasetti@alice.it<BR><B>Oggetto:</B> Re: R: [GRASS-dev] Reproject, change resolution and patch: doubts....<BR></FONT><BR></DIV>
<DIV><BR>
<P><FONT size=2>On May 7, 2008, at 3:35 PM, Marco Pasetti wrote:<BR><BR>&gt; Hi Helena,<BR>&gt;<BR>&gt; Thanks for your reply.<BR>&gt;<BR>&gt;&gt; just a few notes. If you set the resolution to 20m, GRASS will&nbsp;<BR>&gt;&gt; resample<BR>&gt; your 90m SRTM to 20m using nearest neighbor, creating a DEM with&nbsp;<BR>&gt; "steps" -<BR>&gt; something line this (a) is automatic nn resampling, b) is&nbsp;<BR>&gt; reinterpolation by<BR>&gt; rst) <A href="http://www.grassbook.org/gallery/chapters/s050303f010_resamp.jpg">http://www.grassbook.org/gallery/chapters/s050303f010_resamp.jpg</A><BR>&gt;<BR>&gt; Yes, yesterday I tried the described procedure and I noticed the&nbsp;<BR>&gt; same result<BR>&gt; NVIZing the reprojected dem. BTW I don't need to produce 3D maps,&nbsp;<BR>&gt; but I need<BR>&gt; to introduce the less data distorsion as possible. The NN method&nbsp;<BR>&gt; should do<BR>&gt; the job for me. I'm not sure that an interpolation would be a good&nbsp;<BR>&gt; solution,<BR>&gt; but I talk with a strict mathematic/electronic approach, that's my<BR>&gt; professional training; probably, talking about topography,&nbsp;<BR>&gt; interpolations<BR>&gt; rarely produce remarkable errors.<BR>&gt;<BR>&gt; This said, I prefer the 20m data, against the SRTM ones, because I&nbsp;<BR>&gt; analyzed<BR>&gt; a very well known (small) area with NVIZ, using both SRTM and 20m&nbsp;<BR>&gt; data, and<BR>&gt; I noticed relevant errors with SRTM data (I cannot pretend much&nbsp;<BR>&gt; from it,<BR>&gt; it's a SAR shuttle mission... it's actually a miracle that we have&nbsp;<BR>&gt; it, that<BR>&gt; it works pretty fine and that is free).<BR>&gt;<BR>&gt; Summarizing:<BR>&gt; 1) r.proj method=nearest<BR><BR>&gt; 2) r.resamp.rst<BR><BR>- you don't need this step if the default nearest neighbor works for&nbsp;<BR>your application<BR>&nbsp; - it is useful only if you needed smooth connection between the 20m&nbsp;<BR>DEM and SRTM. ( r.resamp.rst does interpolation using a spline&nbsp;<BR>function - you can make it pass exactly through the given data points&nbsp;<BR>by setting smoothing =0.)<BR><BR>Helena<BR><BR><BR>&gt;<BR>&gt;<BR>&gt; Right?<BR>&gt;<BR>&gt; Thanks,<BR>&gt;<BR>&gt; Marco<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; -----Messaggio originale-----<BR>&gt; Da: Helena Mitasova [<A href="mailto:hmitaso@unity.ncsu.edu">mailto:hmitaso@unity.ncsu.edu</A>]<BR>&gt; Inviato: mercoledì 7 maggio 2008 18.25<BR>&gt; A: marco.pasetti@alice.it<BR>&gt; Oggetto: Re: [GRASS-dev] Reproject, change resolution and patch:&nbsp;<BR>&gt; doubts....<BR>&gt;<BR>&gt;<BR>&gt; Marko,<BR>&gt;<BR>&gt; just a few notes. If you set the resolution to 20m, GRASS will&nbsp;<BR>&gt; resample your<BR>&gt; 90m SRTM to 20m using nearest neighbor, creating a DEM with "steps" -<BR>&gt; something line this (a) is automatic nn resampling, b) is&nbsp;<BR>&gt; reinterpolation by<BR>&gt; rst) <A href="http://www.grassbook.org/gallery/chapters/s050303f010_resamp.jpg">http://www.grassbook.org/gallery/chapters/s050303f010_resamp.jpg</A><BR>&gt; Dylan has a nice comparison of effects of different resampling and<BR>&gt; reinterpolation&nbsp; methods on his web site, if you want to learn more.<BR>&gt;<BR>&gt; If you have a GRASS book and the nc_spm data set - it has both SRTM&nbsp;<BR>&gt; data and<BR>&gt; lidar based 10m and 1m resolution DEMs so you can see how SRTM&nbsp;<BR>&gt; works, there<BR>&gt; are several examples in the book - e.g. SRTM is consistently higher&nbsp;<BR>&gt; and I<BR>&gt; did viewshed from 30m SRTM and lidar-based 30m DEM - same&nbsp;<BR>&gt; resolution but the<BR>&gt; results were quite different. You need to keep in mind that SRTM&nbsp;<BR>&gt; maps the<BR>&gt; surface with vegetation on it while your 20m DEM is probably bare&nbsp;<BR>&gt; earth<BR>&gt; surface. Also look at the metadata for both to compare their vertical<BR>&gt; accuracy, some smoothing of SRTM may actually be justified (unless&nbsp;<BR>&gt; you want<BR>&gt; the vegetation and have some means to add it to your 20m DEM). When&nbsp;<BR>&gt; you<BR>&gt; decide to reinterpolate you can compare your re-interpolated DEM&nbsp;<BR>&gt; with the<BR>&gt; original data (e.g. the 90m grid centers) and make sure that any&nbsp;<BR>&gt; smoothing<BR>&gt; does not exceed the accuracy of your original data.<BR>&gt;<BR>&gt; Just for illustration: here is a stream network derived from 10m&nbsp;<BR>&gt; resolution<BR>&gt; IFSARE patched with 90m SRTM where IFSARE data were missing, all<BR>&gt; reinterpolated to 30m resolution to get the river flow seamlessly<BR>&gt; back-and-forth along the patch line.<BR>&gt; <A href="http://skagit.meas.ncsu.edu/~helena/measwork/panama/pacora30maccum.jpg">http://skagit.meas.ncsu.edu/~helena/measwork/panama/pacora30maccum.jpg</A><BR>&gt; some SRTM data can be pretty noisy:<BR>&gt; <A href="http://skagit.meas.ncsu.edu/~helena/measwork/nrc/mumbai_srtm.png">http://skagit.meas.ncsu.edu/~helena/measwork/nrc/mumbai_srtm.png</A><BR>&gt;<BR>&gt; Helena<BR>&gt;&gt;<BR>&gt;&gt; Do you agree?<BR>&gt;&gt;<BR>&gt;&gt; Thanks for all,<BR>&gt;&gt;<BR>&gt;&gt; Marco<BR>&gt;&gt; _______________________________________________<BR>&gt;&gt; grass-dev mailing list<BR>&gt;&gt; grass-dev@lists.osgeo.org<BR>&gt;&gt; <A href="http://lists.osgeo.org/mailman/listinfo/grass-dev">http://lists.osgeo.org/mailman/listinfo/grass-dev</A><BR>&gt;<BR><BR></FONT></P></DIV></BODY></HTML>