[GRASS-dev] weird boundary box appears around reprojected raster map

Hi all, I’m attching to png’s of a wierd phenomenon that just occured to me when reprojecting a couple of stream segment maps (produced by r.watershed) from a UTM location ot a longlat location (so I can export to kml for use in GE). The maps reprojected okay, but there is a 1-2 pixel wide “border” around the reprojected maps that is approximately the same size as the original map’s boundary. These particular maps are mostly NULL values, so the border shows up very conspicuously. It is possible then that this happens every time, but no one has noticed the small “border” being produced. I used all default values in r.proj (using nearest neighbor interpolation, and not checking any flags), and replicated the fault multiple times. I’m using last weeks source for GRASS6.4 compiled on ubunut 8.10. FWIW, querying the “boundary” cells yields all value 18.

Cheers,

Isaac I Ullah, M.A.

Archaeology PhD Student,
ASU School of Evolution and Social Change

Research Assistant,
Mediterranean Landscape Dynamics Project


isaac.ullah@asu.edu
ullah@archaeologist.com

http://www.public.asu.edu/~iullah


(attachments)


Isaac Ullah wrote:

Hi all, I'm attching to png's of a wierd phenomenon that just occured to me
when reprojecting a couple of stream segment maps (produced by r.watershed)
from a UTM location ot a longlat location (so I can export to kml for use in
GE). The maps reprojected okay, but there is a 1-2 pixel wide "border"
around the reprojected maps that is approximately the same size as the
original map's boundary.

What do you mean by "the original map's boundary"?

If the source map has a border embedded in its data, it will get
re-projected along with the rest of the map.

--
Glynn Clements <glynn@gclements.plus.com>

Sorry to have been unclear. It seems that the new “boundary” pixels are created at the what seems to be edge of the input map’s regional extents. To clarify, there is no “boundary of pixels” (eg. “frame”) in the original raster stream seg maps produced by r.watershed, but r.proj creates a one to two pixel wide “frame” that outlines the reprojected maps. to repeat, there is NO boundary in the origianl maps, but there IS a boundary after reprojection. Why is this happening?

On Tue, Nov 18, 2008 at 11:59 AM, Glynn Clements <glynn@gclements.plus.com> wrote:

Isaac Ullah wrote:

Hi all, I’m attching to png’s of a wierd phenomenon that just occured to me
when reprojecting a couple of stream segment maps (produced by r.watershed)
from a UTM location ot a longlat location (so I can export to kml for use in
GE). The maps reprojected okay, but there is a 1-2 pixel wide “border”
around the reprojected maps that is approximately the same size as the
original map’s boundary.

What do you mean by “the original map’s boundary”?

If the source map has a border embedded in its data, it will get
re-projected along with the rest of the map.


Glynn Clements <glynn@gclements.plus.com>

Isaac I Ullah, M.A.

Archaeology PhD Student,
ASU School of Evolution and Social Change

Research Assistant,
Mediterranean Landscape Dynamics Project


isaac.ullah@asu.edu
ullah@archaeologist.com

http://www.public.asu.edu/~iullah


I just tried reinstalling with newest GRASS 6.4 binary snapshot (grass-6.4.svn-i686-pc-linux-gnu-11_10_2008.tar.gz), and trying r.proj with a different map. I am trying to reproject from a WGS84, UTM Z36N location (that I know is correct) to a wgs84 Longlat location I created “interactively” in the shell with the “projection values” option at GRASS start up. The first image linked below is the original map. You can see that it is of a single watershed with all values outside the watershed as NULL, and is the flowacc map produced by r.watershed. The second map shows the result of running r.proj to reproject the map from the UTM location into the latlong location. You can see that now not only is there a small one pixel border at what was the extents of the original map layer, bu there is a wierd “rainbow” of valued pixels forming around the edge of the watershed, and two “rainbow” bars shooting off towards the nw and se corners. FYI, I get the same effect whether I choose “nearest”, “bilinear”, or “bicubic” for the interpolation procedure. IMO, something is fundamentally broken in r.proj but I can’t think of what could be causing such wierd errors other than an interpolation problem…

Original Map:
http://www.public.asu.edu/~iullah/files/MEDLAND/original_map.png

Reprojected_map:
http://www.public.asu.edu/~iullah/files/MEDLAND/more_wierd_rproj_effects.png

On Tue, Nov 18, 2008 at 1:35 PM, Isaac Ullah <isaac.ullah@asu.edu> wrote:

Sorry to have been unclear. It seems that the new “boundary” pixels are created at the what seems to be edge of the input map’s regional extents. To clarify, there is no “boundary of pixels” (eg. “frame”) in the original raster stream seg maps produced by r.watershed, but r.proj creates a one to two pixel wide “frame” that outlines the reprojected maps. to repeat, there is NO boundary in the origianl maps, but there IS a boundary after reprojection. Why is this happening?

On Tue, Nov 18, 2008 at 11:59 AM, Glynn Clements <glynn@gclements.plus.com> wrote:

Isaac Ullah wrote:

Hi all, I’m attching to png’s of a wierd phenomenon that just occured to me
when reprojecting a couple of stream segment maps (produced by r.watershed)
from a UTM location ot a longlat location (so I can export to kml for use in
GE). The maps reprojected okay, but there is a 1-2 pixel wide “border”
around the reprojected maps that is approximately the same size as the
original map’s boundary.

What do you mean by “the original map’s boundary”?

If the source map has a border embedded in its data, it will get
re-projected along with the rest of the map.


Glynn Clements <glynn@gclements.plus.com>

Isaac I Ullah, M.A.

Archaeology PhD Student,
ASU School of Evolution and Social Change

Research Assistant,
Mediterranean Landscape Dynamics Project


isaac.ullah@asu.edu
ullah@archaeologist.com

http://www.public.asu.edu/~iullah


Isaac I Ullah, M.A.

Archaeology PhD Student,
ASU School of Evolution and Social Change

Research Assistant,
Mediterranean Landscape Dynamics Project


isaac.ullah@asu.edu
ullah@archaeologist.com

http://www.public.asu.edu/~iullah