Geoscience Reference
In-Depth Information
ogr2ogr -update -f SQLite -nln noforest -where "natural in
('scrub','heath') OR landuse in ('grass','meadow')"
-select natural,type,landuse training.sqlite
vector_32629.sqlite
-update
Open existing output vector dataset in update mode rather than trying to create a
new one.
-f SQLite
Output vector type is SQLite.
-nln noforest
New layer name of the output vector dataset.
-where "natural in ..."
Select any of these subsets.
-select natural,type,landuse
Selection of attributes to copy from input to output vector dataset.
training.sqlite
Output vector dataset.
vector_32629.sqlite
Input vector dataset.
As a next step, we add a column for the labels in each of the layers and assign the
labels for forest (label
=
1) and non-forest (label
=
2) classes:
ogrinfo -dialect SQLite -sql "ALTER TABLE forest ADD COLUMN
label INT" training.sqlite
ogrinfo -dialect SQLite -sql "UPDATE forest SET label=1"
training.sqlite
ogrinfo -dialect SQLite -sql "ALTER TABLE noforest ADD COLUMN
label INT" training.sqlite
ogrinfo -dialect SQLite -sql "UPDATE noforest SET label=2"
training.sqlite
-dialect SQLite
Use the SQLite SQL engine (needed for some SQL statements such as UPDATE).
-sql "ALTER TABLE forest ADD COLUMN label INT"
Add an attribute named “label” of type integer to the forest layer.
-sql "UPDATE forest SET label=1"
Set all labels to 1 in the forest layer.
This provides the labeled training sample shown in Fig. 17.3 . In total the sample
contains 13,587 polygon, of which 4,621) are forest and 8,966 are non-forest.
 
Search WWH ::




Custom Search