[GRASS-user] v.to.rast gives empty raster layer

Hanlie Pretorius hanlie.pretorius at gmail.com
Wed May 4 04:38:59 EDT 2011


Oh, I see, thanks.

r.stats input=contours_20m at CDNGI_DEM
1620-1623.294118
1639.764706-1643.058824
1659.529412-1662.823529
1679.294118-1682.588235
1699.058824-1702.352941
1718.823529-1722.117647
1738.588235-1741.882353
1758.352941-1761.647059
1778.117647-1781.411765
1797.882353-1801.176471
1817.647059-1820.941176
1837.411765-1840.705882
1857.176471-1860.470588
1876.941176-1880.235294
1900-1903.294118
1919.764706-1923.058824
1939.529412-1942.823529
1959.294118-1962.588235
1979.058824-1982.352941
1998.823529-2002.117647
2018.588235-2021.882353
2038.352941-2041.647059
2058.117647-2061.411765
2077.882353-2081.176471
2097.647059-2100.941176
2117.411765-2120.705882
2137.176471-2140.470588
2156.941176-2160.235294
2180-2183.294118
2199.764706-2203.058824
2219.529412-2222.823529
2239.294118-2242.588235
2259.058824-2262.352941
2278.823529-2282.117647
2298.588235-2301.882353
2318.352941-2321.647059
2338.117647-2341.411765
2357.882353-2361.176471
2377.647059-2380.941176
2397.411765-2400.705882
2417.176471-2420.470588
2436.941176-2440.235294
2456.705882-2460
*
(Wed May 04 10:35:47 2011) Command finished (0 sec)

For some reason I couldn't get the raster contours to display
yesterday - another reason why I though the layer was empty. I
adjusted the colour table an re-rendered the map with no effect.
Today, however, it works and I can see it.

Sorry about the confusion.

2011/5/4, Moritz Lennert <mlennert at club.worldonline.be>:
> On 04/05/11 08:42, Hanlie Pretorius wrote:
>  > Hi Moritz,
>  >
>  > I'm not sure what you mean by 'Maris' first part of the solution'. I
>  > saw only one part to Maris's suggestion (refining the region's
>  > resolution) because I said in my initial mail that I had set extents
>  > of the region to the contours_20m vector layer. Initially I did have a
>  > resolution of 20m and got an empty raster layer as a result.
>  >
>  > I share Micha's confusion about this. Although it doesn't make much
>  > sense to have a 20m cell size (my bad) I would have thought that
>  > v.to.rast would still have given me an output.
>
> Rereading the original mail I see this:
>
>>>> 2011/5/2, Hanlie Pretorius<hanlie.pretorius at gmail.com>:
>>>>> r.info for the result is:
>>>>> | Layer: contours_20m at CDNGI_DEM Date: Mon May 02 14:18:00 2011
>>>>> | Mapset: CDNGI_DEM Login of Creator: hanlie
>>>>> | Location: SA_Lo_29E
>>>>> | DataBase: F:\grassdata
>>>>> | Title: Labels ( contours_20m at CDNGI_DEM )
>>>>> | Timestamp: none
>>>>> |----------------------------------------------------------------------------
>>>>>
>>>>> |
>>>>> | Type of Map: raster Number of Categories: 0
> [snip]
>>>>> | Rows: 1772
>>>>> | Columns: 1750
>>>>> | Total Cells: 3101000
>>>>> | Projection: Transverse Mercator
>>>>> | N: -3121229.69982072 S: -3156672.30728643 Res:
>>>>> 20.00147148
>>>>> | E: -32474.90929218 W: -67483.27873573 Res: 20.00478254
>>>>> | Range of data: min = 1620 max = 2460
> [snip]       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>
>>>>> As you can see from the number of categories (0), there is no
>>>>> information in this raster file.
>
> There are no category values, but there are data values, so your map
> actually is not empty.
>
> What does r.stats contours_20m at CDNGI_DEM give you ?
>
> 1) v.to.rast does create category labels by default. If you use the
> 'labelcol' parameter, then you get category values.
>
> Example in the NC demo dataset:
>
> v.to.rast elev_ned10m_cont10m out=contours col=level
>
> r.info contours:
>
> Number of Categories: 0
> Range of data:    min = 60.000000  max = 150.000000
>
> 2) v.to.rast elev_ned10m_cont10m out=contours col=level labelcol=cat
>
> r.info contours:
>
> Number of Categories: 150
> Range of data:    min = 60.000000  max = 150.000000
>
> Moritz
>


More information about the grass-user mailing list