Geoscience Reference
In-Depth Information
Table 16.1 Land use class
names and associated label
Land-use class name
Code label
Grass_healthy
1
Grass_stressed
2
Grass_synthetic
3
Tree
4
Soil
5
Wa t er
6
Residential
7
Commercial
8
Road
9
Highway
10
Railway
11
Parking_lot1
12
Parking_lot2
13
Tennis_court
14
Running_track
15
#!/bin/bash
#add field area as float
ogrinfo -dialect SQLite -sql "ALTER TABLE temporaryplaces ADD
COLUMN Label INT" google_vector.sqlite
#create an array to store the different landuse class names
landuse_array=("grass healthy" "grass stressed" "grass
synthetic" "tree" "soil" "water" "residential"
"commercial" "road" "highway" "railway" "parking lot1"
"parking lot2" "tennis court" "running track")
i=1
for landuse in "${landuse_array[@]}"
do
echo ${landuse}
ogrinfo -dialect SQLite -sql "UPDATE temporaryplaces SET
Label = $i WHERE name LIKE '$landuse
i=+1
done
Once the above lines arewritten, you can save the script as landuse_array.sh
and then from the command line you can issue the command chmod +x landuse
_array.sh to make the script executable. You can then launch the script by typing
./landuse_array.sh .
 
Search WWH ::




Custom Search