@@ -6,22 +6,22 @@ <h2>DESCRIPTION</h2>
66labels.
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
1616href ="https://gdal.org/api/python/utilities.html#osgeo.gdal.Rasterize "> gdal.rasterize</ a > )
1717and 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 >
2727Setting 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 >
4342Alternatively, use the < b > -v</ b > flag to import the entire vector extent,
@@ -48,32 +47,33 @@ <h2>Notes</h2>
4847with 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>
101101memory=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>
210203href ="https://www.has.nl/en/research/professorships/climate-robust-landscapes-professorship/ "> Climate-robust
211204Landscapes 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 >
0 commit comments