Skip to content

Commit 4e7a605

Browse files
committed
end of line and end of file issues
1 parent 19d322c commit 4e7a605

File tree

2 files changed

+106
-119
lines changed

2 files changed

+106
-119
lines changed

src/raster/r.in.vect/r.in.vect.html

Lines changed: 67 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ <h2>DESCRIPTION</h2>
66
labels.
77

88
<p>
9-
When users have a vector file that they want to convert to a raster
10-
map, they would normally import the vector map into GRASS GIS using,
11-
e.g., <em>v.in.ogr</em>, and subsequently convert the resulting vector
12-
into a raster map using <em>v.to.rast</em>. Because of the topological
13-
vector format of GRASS GIS, importing large complex vector maps can be
14-
slow. To speed up the process, <em>r.in.vect</em> converts the
15-
user-defined vector file to an intermediate geoTIF file (using <a
9+
When users have a vector file that they want to convert to a raster map, they
10+
would normally import the vector map into GRASS GIS using, e.g.,
11+
<em>v.in.ogr</em>, and subsequently convert the resulting vector into a raster
12+
map using <em>v.to.rast</em>. Because of the topological vector format of GRASS
13+
GIS, importing large complex vector maps can be slow. To speed up the process,
14+
<em>r.in.vect</em> converts the user-defined vector file to an intermediate
15+
geoTIF file (using <a
1616
href="https://gdal.org/api/python/utilities.html#osgeo.gdal.Rasterize">gdal.rasterize</a>)
1717
and imports it into GRASS GIS.
1818

1919
<p>
20-
The objects in the vector map will be assigned an user-defined value
21-
using the <b>value</b> parameter. Alternatively, the user can use the
22-
<b>attribute_column</b> to specify the name of an existing column from
23-
the vector map's attribute table. The values in that column will be
24-
used as raster values in the output raster map.
20+
The objects in the vector map will be assigned an user-defined value using the
21+
<b>value</b> parameter. Alternatively, the user can use the
22+
<b>attribute_column</b> to specify the name of an existing column from the
23+
vector map's attribute table. The values in that column will be used as raster
24+
values in the output raster map.
2525

2626
<p>
2727
Setting the <b>-c</b> flag counts the number of overlapping features per pixel
@@ -33,11 +33,10 @@ <h2>DESCRIPTION</h2>
3333

3434
<h2>Notes</h2>
3535

36-
By default, <em>r.in.vect</em> will only affect data in areas lying
37-
inside the boundaries of the current computational region. Before
38-
running the function, users should therefore ensure that the
39-
computational region is correctly set, and that the region's resolution
40-
is at the desired level.
36+
By default, <em>r.in.vect</em> will only affect data in areas lying inside the
37+
boundaries of the current computational region. Before running the function,
38+
users should therefore ensure that the computational region is correctly set,
39+
and that the region's resolution is at the desired level.
4140

4241
<p>
4342
Alternatively, use the <b>-v</b> flag to import the entire vector extent,
@@ -48,32 +47,33 @@ <h2>Notes</h2>
4847
with the existing resolution.
4948

5049
<p>
51-
If the coordinate reference system (CRS) of the vector file differs
52-
from that of the mapset in which users want to import the raster, the
53-
vector file will be first reprojected using <em>ogr2ogr</em>.
50+
51+
If the coordinate reference system (CRS) of the vector file differs from that of
52+
the mapset in which users want to import the raster, the vector file will be
53+
first reprojected using <em>ogr2ogr</em>.
5454

5555
<p>
56-
The <b>label_column</b> parameter can be used to assign raster category
57-
labels. Users should check if each unique value from the category
58-
column has one corresponding label in the label column. If there are
59-
categories with more than one label, the first from the label column
60-
will be used (and a warning will be printed).
56+
The <b>label_column</b> parameter can be used to assign raster category labels.
57+
Users should check if each unique value from the category column has one
58+
corresponding label in the label column. If there are categories with more than
59+
one label, the first from the label column will be used (and a warning will be
60+
printed).
6161

6262
<p>
63-
With the <b>-d</b> flag, all pixels touched by lines or polygons will
64-
be updated, not just those on the line render path, or which center
65-
point is within the polygon. For lines, this is similar to setting the
66-
<b>-d</b> flag in <em>v.to.rast</em>.
63+
With the <b>-d</b> flag, all pixels touched by lines or polygons will be
64+
updated, not just those on the line render path, or which center point is within
65+
the polygon. For lines, this is similar to setting the <b>-d</b> flag in
66+
<em>v.to.rast</em>.
6767

6868
<p>
69-
For simple and small vector layers, it is probably faster to
70-
import the vector layer first and converting it to a raster in GRASS.
69+
For simple and small vector layers, it is probably faster to import the vector
70+
layer first and converting it to a raster in GRASS.
7171

7272
<h2>EXAMPLE</h2>
7373

74-
The examples of <em>r.in.vect</em> use vector maps from the
75-
<a href="https://grass.osgeo.org/download/data/">North Carolina sample
76-
data set</a>.
74+
The examples of <em>r.in.vect</em> use vector maps from the <a
75+
href="https://grass.osgeo.org/download/data/">North Carolina sample data
76+
set</a>.
7777

7878
<h3>Example 1</h3>
7979

@@ -101,24 +101,22 @@ <h3>Example 1</h3>
101101
memory=2000
102102
</pre></div>
103103

104-
<div align="left" style="margin: 10px"> <a href="r_in_vect_im01.png">
105-
<img src="r_in_vect_im01.png" alt="The geology vector file converted
106-
to, and imported as raster in GRASS. Example 1" border="0">
107-
</a><br><i>Figure 1: The geology vector file was converted to, and
108-
imported as a raster into GRASS GIS, using the default settings.</i>
109-
</div>
104+
<p>
105+
<div align="left" style="margin: 10px"> <a href="r_in_vect_im01.png"> <img
106+
src="r_in_vect_im01.png" alt="The geology vector file converted to, and imported
107+
as raster in GRASS. Example 1" border="0"> </a><br><i>Figure 1: The geology
108+
vector file was converted to, and imported as a raster into GRASS GIS, using the
109+
default settings.</i> </div>
110110

111111
<p>
112-
If the GeoPackage file (or any other data source) has
113-
multiple layers, users need to specify which layer to use with
114-
the <b>layer</b> parameter. Otherwise, the first layer will be
115-
selected.
112+
If the GeoPackage file (or any other data source) has multiple layers, users
113+
need to specify which layer to use with the <b>layer</b> parameter. Otherwise,
114+
the first layer will be selected.
116115

117116
<h3>Example 2</h3>
118117

119-
Import the geology.gpkg as raster. Specify the column holding the
120-
values to use as raster values and the column holding the labels for
121-
the raster values.
118+
Import the geology.gpkg as raster. Specify the column holding the values to use
119+
as raster values and the column holding the labels for the raster values.
122120

123121
<div class="code"><pre>
124122
# Import the layer
@@ -133,21 +131,19 @@ <h3>Example 2</h3>
133131
</pre></div>
134132

135133
<p>
136-
<div align="left" style="margin: 10px"> <a href="r_in_vect_im02.png">
137-
<img src="r_in_vect_im02.png" alt="The geology vector file converted
138-
to, and imported as raster in GRASS GIS. Example 2" border="0">
139-
</a><br><i>Figure 2: The geology vector file converted to raster and
140-
imported into GRASS GIS using the values from the vector attribute
141-
column GEOL250_ as raster values.</i> </div>
134+
<div align="left" style="margin: 10px"> <a href="r_in_vect_im02.png"> <img
135+
src="r_in_vect_im02.png" alt="The geology vector file converted to, and imported
136+
as raster in GRASS GIS. Example 2" border="0"> </a><br><i>Figure 2: The geology
137+
vector file converted to raster and imported into GRASS GIS using the values
138+
from the vector attribute column GEOL250_ as raster values.</i> </div>
142139

143140

144141
<h3>Example 3</h3>
145142

146-
First, set the resolution to 1 meter. Next, export the busroute6 vector
147-
map as GeoPackage, and import it as a raster. Use the <b>-v</b>
148-
flag to ensure the extent of the raster matches that of the
149-
vector (by default, the bounding box of the raster map will
150-
match that of the current computational region).
143+
First, set the resolution to 1 meter. Next, export the busroute6 vector map as
144+
GeoPackage, and import it as a raster. Use the <b>-v</b> flag to ensure the
145+
extent of the raster matches that of the vector (by default, the bounding box of
146+
the raster map will match that of the current computational region).
151147

152148
<div class="code"><pre>
153149
# Set the resolution to 1 m
@@ -167,17 +163,15 @@ <h3>Example 3</h3>
167163
</pre></div>
168164

169165
<p>
170-
<div align="left" style="margin: 10px"> <a href="r_in_vect_im03.png">
171-
<img src="r_in_vect_im03.png" alt="The busroute6 vector file converted
172-
to raster and imported into GRASS GIS. Example 3" border="0">
173-
</a><br><i>Figure 3: The busroute6 vector file converted to raster and
174-
imported into GRASS GIS using the extent of the vector map.</i> </div>
175-
166+
<div align="left" style="margin: 10px"> <a href="r_in_vect_im03.png"> <img
167+
src="r_in_vect_im03.png" alt="The busroute6 vector file converted to raster and
168+
imported into GRASS GIS. Example 3" border="0"> </a><br><i>Figure 3: The
169+
busroute6 vector file converted to raster and imported into GRASS GIS using the
170+
extent of the vector map.</i> </div>
176171

177172
<h3>Example 4</h3>
178173

179-
The same as above, but using the <b>-d</b> flag to create densified
180-
lines.
174+
The same as above, but using the <b>-d</b> flag to create densified lines.
181175

182176
<div class="code"><pre>
183177
# Import vector as a raster map, using the extent of the vector
@@ -189,13 +183,12 @@ <h3>Example 4</h3>
189183
</pre></div>
190184

191185
<p>
192-
<div align="left" style="margin: 10px"> <a href="r_in_vect_im04.png">
193-
<img src="r_in_vect_im04.png" alt="The busroute6 vector file converted
194-
to raster and imported into GRASS GIS. Example 4" border="0">
195-
</a><br><i>Figure 4: Rasterize the busroute 6 vector map using the
196-
<b>-d</b> flag to create densified lines by adding extra cells (shown
197-
in red). This avoids gaps or lines that consist of cells that are only
198-
diagonally connected.</i> </div>
186+
<div align="left" style="margin: 10px"> <a href="r_in_vect_im04.png"> <img
187+
src="r_in_vect_im04.png" alt="The busroute6 vector file converted to raster and
188+
imported into GRASS GIS. Example 4" border="0"> </a><br><i>Figure 4: Rasterize
189+
the busroute 6 vector map using the <b>-d</b> flag to create densified lines by
190+
adding extra cells (shown in red). This avoids gaps or lines that consist of
191+
cells that are only diagonally connected.</i> </div>
199192

200193
<h2>SEE ALSO</h2>
201194

@@ -210,4 +203,4 @@ <h2>AUTHORS</h2>
210203
href="https://www.has.nl/en/research/professorships/climate-robust-landscapes-professorship/">Climate-robust
211204
Landscapes research group</a> |
212205
<a href="https://www.has.nl/en/research/professorships/innovative-bio-monitoring-professorship/">Innovative Bio-Monitoring research group</a> |
213-
Contact: <a href="https://ecodiv.earth">Ecodiv.earth</a>
206+
Contact: <a href="https://ecodiv.earth">Ecodiv.earth</a>

src/raster/r.in.vect/r.in.vect.md

Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
## DESCRIPTION
22

3-
*r.in.vect* transforms an external vector file (like GeoPackage) into a
4-
raster file and imports it into GRASS GIS. Optionally, attributes from
5-
the vector layer can be converted to raster category labels.
6-
7-
When users have a vector file that they want to convert to a raster map,
8-
they would normally import the vector map into GRASS GIS using, e.g.,
9-
*v.in.ogr*, and subsequently convert the resulting vector into a raster
10-
map using *v.to.rast*. Because of the topological vector format of GRASS
11-
GIS, importing large complex vector maps can be slow. To speed up the
12-
process, *r.in.vect* converts the user-defined vector file to an
13-
intermediate geoTIF file (using
3+
*r.in.vect* transforms an external vector file (like GeoPackage) into a raster
4+
file and imports it into GRASS GIS. Optionally, attributes from the vector layer
5+
can be converted to raster category labels.
6+
7+
When users have a vector file that they want to convert to a raster map, they
8+
would normally import the vector map into GRASS GIS using, e.g., *v.in.ogr*, and
9+
subsequently convert the resulting vector into a raster map using *v.to.rast*.
10+
Because of the topological vector format of GRASS GIS, importing large complex
11+
vector maps can be slow. To speed up the process, *r.in.vect* converts the
12+
user-defined vector file to an intermediate geoTIF file (using
1413
[gdal.rasterize](https://gdal.org/api/python/utilities.html#osgeo.gdal.Rasterize))
1514
and imports it into GRASS GIS.
1615

@@ -60,8 +59,8 @@ layer first and converting it to a raster in GRASS.
6059

6160
## EXAMPLE
6261

63-
The examples of *r.in.vect* use vector maps from the [North Carolina
64-
sample data set](https://grass.osgeo.org/download/data/).
62+
The examples of *r.in.vect* use vector maps from the [North Carolina sample data
63+
set](https://grass.osgeo.org/download/data/).
6564

6665
### Example 1
6766

@@ -72,10 +71,9 @@ First, export a vector layer as a GeoPackage.
7271
v.out.ogr input=geology@PERMANENT output=geology.gpkg format=GPKG
7372
```
7473

75-
Import the geology.gpkg as raster. Raster cells overlapping with the
76-
vector features will be assigned a value of 1, and the other raster
77-
cells null. If you have RAM to spare, increase the memory to speed up
78-
the import.
74+
Import the geology.gpkg as raster. Raster cells overlapping with the vector
75+
features will be assigned a value of 1, and the other raster cells null. If you
76+
have RAM to spare, increase the memory to speed up the import.
7977

8078
```sh
8179
# Set the region
@@ -88,19 +86,18 @@ value=1 \
8886
memory=2000
8987
```
9088

91-
[![image-alt](r_in_vect_im01.png)](r_in_vect_im01.png)
92-
*Figure 1: The geology vector file was converted to, and imported as a
93-
raster into GRASS GIS, using the default settings.*
89+
[![image-alt](r_in_vect_im01.png)](r_in_vect_im01.png) *Figure 1: The geology
90+
vector file was converted to, and imported as a raster into GRASS GIS, using the
91+
default settings.*
9492

95-
If the GeoPackage file (or any other data source) has multiple layers,
96-
users need to specify which layer to use with the **layer** parameter.
97-
Otherwise, the first layer will be selected.
93+
If the GeoPackage file (or any other data source) has multiple layers, users
94+
need to specify which layer to use with the **layer** parameter. Otherwise, the
95+
first layer will be selected.
9896

9997
### Example 2
10098

101-
Import the geology.gpkg as raster. Specify the column holding the values
102-
to use as raster values and the column holding the labels for the raster
103-
values.
99+
Import the geology.gpkg as raster. Specify the column holding the values to use
100+
as raster values and the column holding the labels for the raster values.
104101

105102
```sh
106103
# Import the layer
@@ -114,18 +111,16 @@ memory=2000
114111
r.colors map=geology_rast2 color=random
115112
```
116113

117-
[![image-alt](r_in_vect_im02.png)](r_in_vect_im02.png)
118-
*Figure 2: The geology vector file converted to raster and imported into
119-
GRASS GIS using the values from the vector attribute column GEOL250\_ as
120-
raster values.*
114+
[![image-alt](r_in_vect_im02.png)](r_in_vect_im02.png) *Figure 2: The geology
115+
vector file converted to raster and imported into GRASS GIS using the values
116+
from the vector attribute column GEOL250\_ as raster values.*
121117

122118
### Example 3
123119

124-
First, set the resolution to 1 meter. Next, export the busroute6 vector
125-
map as GeoPackage, and import it as a raster. Use the **-v** flag to
126-
ensure the extent of the raster matches that of the vector (by default,
127-
the bounding box of the raster map will match that of the current
128-
computational region).
120+
First, set the resolution to 1 meter. Next, export the busroute6 vector map as
121+
GeoPackage, and import it as a raster. Use the **-v** flag to ensure the extent
122+
of the raster matches that of the vector (by default, the bounding box of the
123+
raster map will match that of the current computational region).
129124

130125
```sh
131126
# Set the resolution to 1 m
@@ -144,9 +139,9 @@ value=1 \
144139
memory=2000
145140
```
146141

147-
[![image-alt](r_in_vect_im03.png)](r_in_vect_im03.png)
148-
*Figure 3: The busroute6 vector file converted to raster and imported
149-
into GRASS GIS using the extent of the vector map.*
142+
[![image-alt](r_in_vect_im03.png)](r_in_vect_im03.png) *Figure 3: The busroute6
143+
vector file converted to raster and imported into GRASS GIS using the extent of
144+
the vector map.*
150145

151146
### Example 4
152147

@@ -161,21 +156,20 @@ value=1 \
161156
memory=2000
162157
```
163158

164-
[![image-alt](r_in_vect_im04.png)](r_in_vect_im04.png)
165-
*Figure 4: Rasterize the busroute 6 vector map using the **-d** flag to
166-
create densified lines by adding extra cells (shown in red). This avoids
167-
gaps or lines that consist of cells that are only diagonally connected.*
159+
[![image-alt](r_in_vect_im04.png)](r_in_vect_im04.png) *Figure 4: Rasterize the
160+
busroute 6 vector map using the **-d** flag to create densified lines by adding
161+
extra cells (shown in red). This avoids gaps or lines that consist of cells that
162+
are only diagonally connected.*
168163

169164
## SEE ALSO
170165

171166
*[v.to.rast](https://grass.osgeo.org/grass-stable/manuals/v.to.rast.html)*
172167

173168
## AUTHORS
174169

175-
Paulo van Breugel | [HAS green academy](https://has.nl), University of
176-
Applied Sciences | [Climate-robust Landscapes research
170+
Paulo van Breugel | [HAS green academy](https://has.nl), University of Applied
171+
Sciences | [Climate-robust Landscapes research
177172
group](https://www.has.nl/en/research/professorships/climate-robust-landscapes-professorship/)
178173
| [Innovative Bio-Monitoring research
179174
group](https://www.has.nl/en/research/professorships/innovative-bio-monitoring-professorship/)
180175
| Contact: [Ecodiv.earth](https://ecodiv.earth)
181-

0 commit comments

Comments
 (0)