Hi,
I'm working in GRASS 6.4.1 on Windows XP.
I want to use r.surf.contour to convert contour lines into a DEM.
However, I first need to convert my vector contour lines into raster
contour lines. My region is set to the contours_20m vector layer, with
a 20m resolution.
v.to.rast --overwrite input=contours_20m output=contours_20m use=attr
column=HEIGHT
Loading data...
Reading features...
Writing raster map...
Converted areas: 0 of 0
Converted points/lines: 1593 of 1593
v.to.rast complete.
r.info for the result is:
| Layer: contours_20m@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@CDNGI_DEM )
| Timestamp: none
|----------------------------------------------------------------------------
|
| Type of Map: raster Number of Categories: 0
| Data Type: DCELL
| 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
| Data Source:
| Vector Map: contours_20m@CDNGI_DEM in mapset CDNGI_DEM
| Original scale from vector map: 1:1
|
| Data Description:
| generated by v.to.rast
|
| Comments:
| v.to.rast input="contours_20m@CDNGI_DEM" layer=1 type="point,line,ar\
| ea" output="contours_20m@CDNGI_DEM" use="attr" column="HEIGHT" value\
| =1 rows=4096
As you can see from the number of categories (0), there is no
information in this raster file.
Can someone perhaps help me figure out why this happens?
Thanks
Hanlie
g.region vect=contours_20m
Also 20x20m cells wouldn't be too large?!?
Maris.
2011/5/2, Hanlie Pretorius <hanlie.pretorius@gmail.com>:
Hi,
I'm working in GRASS 6.4.1 on Windows XP.
I want to use r.surf.contour to convert contour lines into a DEM.
However, I first need to convert my vector contour lines into raster
contour lines. My region is set to the contours_20m vector layer, with
a 20m resolution.
v.to.rast --overwrite input=contours_20m output=contours_20m use=attr
column=HEIGHT
Loading data...
Reading features...
Writing raster map...
Converted areas: 0 of 0
Converted points/lines: 1593 of 1593
v.to.rast complete.
r.info for the result is:
| Layer: contours_20m@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@CDNGI_DEM )
| Timestamp: none
|----------------------------------------------------------------------------
|
| Type of Map: raster Number of Categories: 0
| Data Type: DCELL
| 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
| Data Source:
| Vector Map: contours_20m@CDNGI_DEM in mapset CDNGI_DEM
| Original scale from vector map: 1:1
|
| Data Description:
| generated by v.to.rast
|
| Comments:
| v.to.rast input="contours_20m@CDNGI_DEM" layer=1 type="point,line,ar\
| ea" output="contours_20m@CDNGI_DEM" use="attr" column="HEIGHT" value\
| =1 rows=4096
As you can see from the number of categories (0), there is no
information in this raster file.
Can someone perhaps help me figure out why this happens?
Thanks
Hanlie
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Hi Maris,
Thanks, your suggestion worked. With the region's resolution set to
5m, I got some output.
Regards
Hanlie
2011/5/2, Maris Nartiss <maris.gis@gmail.com>:
g.region vect=contours_20m
Also 20x20m cells wouldn't be too large?!?
Maris.
2011/5/2, Hanlie Pretorius <hanlie.pretorius@gmail.com>:
Hi,
I'm working in GRASS 6.4.1 on Windows XP.
I want to use r.surf.contour to convert contour lines into a DEM.
However, I first need to convert my vector contour lines into raster
contour lines. My region is set to the contours_20m vector layer, with
a 20m resolution.
v.to.rast --overwrite input=contours_20m output=contours_20m use=attr
column=HEIGHT
Loading data...
Reading features...
Writing raster map...
Converted areas: 0 of 0
Converted points/lines: 1593 of 1593
v.to.rast complete.
r.info for the result is:
| Layer: contours_20m@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@CDNGI_DEM )
| Timestamp: none
|----------------------------------------------------------------------------
|
| Type of Map: raster Number of Categories: 0
| Data Type: DCELL
| 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
| Data Source:
| Vector Map: contours_20m@CDNGI_DEM in mapset CDNGI_DEM
| Original scale from vector map: 1:1
|
| Data Description:
| generated by v.to.rast
|
| Comments:
| v.to.rast input="contours_20m@CDNGI_DEM" layer=1
type="point,line,ar\
| ea" output="contours_20m@CDNGI_DEM" use="attr" column="HEIGHT"
value\
| =1 rows=4096
As you can see from the number of categories (0), there is no
information in this raster file.
Can someone perhaps help me figure out why this happens?
Thanks
Hanlie
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
On 05/03/2011 09:11 AM, Hanlie Pretorius wrote:
Hi Maris,
Thanks, your suggestion worked. With the region's resolution set to
5m, I got some output.
Hi Maris:
Sorry for butting in on this, but I don't understand why the region resolution should make any difference to v.to.rast??
Would you mind to explain?
Thanks,
Micha
Regards
Hanlie
2011/5/2, Maris Nartiss<maris.gis@gmail.com>:
g.region vect=contours_20m
Also 20x20m cells wouldn't be too large?!?
Maris.
2011/5/2, Hanlie Pretorius<hanlie.pretorius@gmail.com>:
Hi,
I'm working in GRASS 6.4.1 on Windows XP.
I want to use r.surf.contour to convert contour lines into a DEM.
However, I first need to convert my vector contour lines into raster
contour lines. My region is set to the contours_20m vector layer, with
a 20m resolution.
v.to.rast --overwrite input=contours_20m output=contours_20m use=attr
column=HEIGHT
Loading data...
Reading features...
Writing raster map...
Converted areas: 0 of 0
Converted points/lines: 1593 of 1593
v.to.rast complete.
r.info for the result is:
| Layer: contours_20m@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@CDNGI_DEM )
| Timestamp: none
|----------------------------------------------------------------------------
|
| Type of Map: raster Number of Categories: 0
| Data Type: DCELL
| 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
| Data Source:
| Vector Map: contours_20m@CDNGI_DEM in mapset CDNGI_DEM
| Original scale from vector map: 1:1
|
| Data Description:
| generated by v.to.rast
|
| Comments:
| v.to.rast input="contours_20m@CDNGI_DEM" layer=1
type="point,line,ar\
| ea" output="contours_20m@CDNGI_DEM" use="attr" column="HEIGHT"
value\
| =1 rows=4096
As you can see from the number of categories (0), there is no
information in this raster file.
Can someone perhaps help me figure out why this happens?
Thanks
Hanlie
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
This mail was received via Mail-SeCure System.
--
Micha Silver
Arava Development Co. +972-52-3665918
http://www.surfaces.co.il
On 03/05/11 10:20, Micha Silver wrote:
On 05/03/2011 09:11 AM, Hanlie Pretorius wrote:
Hi Maris,
Thanks, your suggestion worked. With the region's resolution set to
5m, I got some output.
Hi Maris:
Sorry for butting in on this, but I don't understand why the region
resolution should make any difference to v.to.rast??
Would you mind to explain?
From the v.to.rast manual:
"v.to.rast will only affect data in areas lying inside the boundaries of the current geographic region. Before running v.to.rast, the user should therefore ensure that the current geographic region is correctly set and that the region resolution is at the desired level."
And, more generally, from the Raster data processing intro page:
"As a general rule in GRASS:
1. Raster output maps have their bounds and resolution equal to those of the current computational region."
Moritz
On 05/03/2011 04:34 PM, Moritz Lennert wrote:
On 03/05/11 10:20, Micha Silver wrote:
On 05/03/2011 09:11 AM, Hanlie Pretorius wrote:
Hi Maris,
Thanks, your suggestion worked. With the region's resolution set to
5m, I got some output.
Hi Maris:
Sorry for butting in on this, but I don't understand why the region
resolution should make any difference to v.to.rast??
Would you mind to explain?
From the v.to.rast manual:
"v.to.rast will only affect data in areas lying inside the boundaries of the current geographic region. Before running v.to.rast, the user should therefore ensure that the current geographic region is correctly set and that the region resolution is at the desired level."
Thanks, Moritz
What I'm trying to understand is the question about resolution. Would you expect, as
Hanlie indicted, to get *no output* in the raster because of too course resolution?
He claims that at 20m x 20m v.to.rast of a line feature created all NULL cells, but at 5m x 5m the lines did appear in the raster.
??
And, more generally, from the Raster data processing intro page:
"As a general rule in GRASS:
1. Raster output maps have their bounds and resolution equal to those of the current computational region."
Moritz
This mail was received via Mail-SeCure System.
--
Micha Silver
Arava Development Co. +972-52-3665918
http://www.surfaces.co.il
On 03/05/11 15:47, Micha Silver wrote:
On 05/03/2011 04:34 PM, Moritz Lennert wrote:
On 03/05/11 10:20, Micha Silver wrote:
On 05/03/2011 09:11 AM, Hanlie Pretorius wrote:
Hi Maris,
Thanks, your suggestion worked. With the region's resolution set to
5m, I got some output.
Hi Maris:
Sorry for butting in on this, but I don't understand why the region
resolution should make any difference to v.to.rast??
Would you mind to explain?
From the v.to.rast manual:
"v.to.rast will only affect data in areas lying inside the boundaries
of the current geographic region. Before running v.to.rast, the user
should therefore ensure that the current geographic region is
correctly set and that the region resolution is at the desired level."
Thanks, Moritz
What I'm trying to understand is the question about resolution. Would
you expect, as
Hanlie indicted, to get *no output* in the raster because of too course
resolution?
He claims that at 20m x 20m v.to.rast of a line feature created all NULL
cells, but at 5m x 5m the lines did appear in the raster.
??
Hanlie didn't tell us whether he applied Maris' first part of the solution as well (but I guess he did):
g.region vect=contours_20m
I agree with you that resolution does not make the difference. However, I guess that Maris meant that having a 20m resolution seems too coarse for 20m contour lines, but even that is not clear as all depends on the topography of the region in question. If you have 100m altitude change for 50m horizontal change, then 20m is a bad choice of resolution, but if you have 100m altitude change for 1km horizontal change, it should be more than enough.
So, in conclusion, the region's resolution setting can make a huge difference in v.to.rast, but in this particular case does not explain why there was no output. This is certainly linked to the region's extension.
Moritz
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.
Regards
Hanlie
2011/5/3, Moritz Lennert <mlennert@club.worldonline.be>:
On 03/05/11 15:47, Micha Silver wrote:
On 05/03/2011 04:34 PM, Moritz Lennert wrote:
On 03/05/11 10:20, Micha Silver wrote:
On 05/03/2011 09:11 AM, Hanlie Pretorius wrote:
Hi Maris,
Thanks, your suggestion worked. With the region's resolution set to
5m, I got some output.
Hi Maris:
Sorry for butting in on this, but I don't understand why the region
resolution should make any difference to v.to.rast??
Would you mind to explain?
From the v.to.rast manual:
"v.to.rast will only affect data in areas lying inside the boundaries
of the current geographic region. Before running v.to.rast, the user
should therefore ensure that the current geographic region is
correctly set and that the region resolution is at the desired level."
Thanks, Moritz
What I'm trying to understand is the question about resolution. Would
you expect, as
Hanlie indicted, to get *no output* in the raster because of too course
resolution?
He claims that at 20m x 20m v.to.rast of a line feature created all NULL
cells, but at 5m x 5m the lines did appear in the raster.
??
Hanlie didn't tell us whether he applied Maris' first part of the
solution as well (but I guess he did):
g.region vect=contours_20m
I agree with you that resolution does not make the difference. However,
I guess that Maris meant that having a 20m resolution seems too coarse
for 20m contour lines, but even that is not clear as all depends on the
topography of the region in question. If you have 100m altitude change
for 50m horizontal change, then 20m is a bad choice of resolution, but
if you have 100m altitude change for 1km horizontal change, it should be
more than enough.
So, in conclusion, the region's resolution setting can make a huge
difference in v.to.rast, but in this particular case does not explain
why there was no output. This is certainly linked to the region's extension.
Moritz
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@gmail.com>:
r.info for the result is:
| Layer: contours_20m@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@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@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
Oh, I see, thanks.
r.stats input=contours_20m@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@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@gmail.com>:
r.info for the result is:
| Layer: contours_20m@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@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@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