[GRASS-user] Re: Importing Dems with r.in.xyz

Hanlie Pretorius hanlie.pretorius at gmail.com
Mon Jun 7 02:37:40 EDT 2010


2010/6/5, Hamish <hamish_b at yahoo.com>:
> Hanlie wrote:
>> >> At this point, g.region reports 1146474 cells in the region, while I
>> >> have 1146370 lines of coordinates in my file.
> ...
>> > So it looks like there are about 100 coordinates missing from the ASCII
>> > ASCII file.
>
> 0.01% ..
>
>> Maybe "holes" in the data?
>
> perhaps this:  https://trac.osgeo.org/grass/ticket/123
> ??

I don't think it's this bug because this bug discards only one line of
data. I don't get any data in because the number of coordinate pairs
in the file is less than the number of cells in the defined region.

>
>
>> I was thinking perhaps importing the points as vectors, converting
>> them to raster and then doing a nearest neighbour or IDW interpolation
>> to fill the gaps. At least then I'll be able to see where the gaps are
>> and limit the interpolated pixels using a mask?
>
> No need to do anything different to find the missing pixels. Inspecting
> the output of r.univar with r.in.xyz's method=n maps can be very useful
> for troubleshooting.
>
>
> from the help page:
>
>    Gridded data
>        If data is known to be on a regular grid  r.in.xyz  can
>        reconstruct  the  map perfectly as long as some care is
>        taken to set up  the  region  correctly  and  that  the
>        data's  native map projection is used. A typical method
>        would involve determining the grid resolution either by
>        examining  the  data's  associated  documentation or by
>        studying  the  text  file.  Next  scan  the  data  with
>        r.in.xyz's  -s  (or  -g)  flag to find the input data's
>        bounds. GRASS uses the  cell-center  raster  convention
>        where  data points fall within the center of a cell, as
>        opposed to the grid-node convention. Therefore you will
>        need  to  grow  the  region  out  by half a cell in all
>        directions beyond what the  scan  found  in  the  file.
>        After  the  region  bounds  and resolution are set cor-
>        rectly with g.region, run r.in.xyz using the  n  method
>        and  verify that n=1 at all places.  r.univar can help.
>        Once you are confident that the region exactly  matches
>        the data proceed to run r.in.xyz using one of the mean,
>        min, max, or median methods. With n=1  throughout,  the
>        result should be identical regardless of which of those
>        methods are used.
>
>
> with the "n" map you might use r.mapcalc to extract the NULL cells
> as some value, then r.out.xyz or r.to.vect on th extracts to highlight
> where they are. Or maybe you get lucky with r.colors with "nv" set to
> bright magenta on the original data.

Thanks, I'll try this to find where the holes in the data are.

>
>
>
> Hamish
>
>
>
>
>


More information about the grass-user mailing list