Professional Documents
Culture Documents
Expression List
Expression List
Expression List
12
IMPORTANT
1. Name given for field are suggestion only. For more details in naming Shapefiles please refer to GDB
guidelines.
2. All newly created field MUST provide description in the comment box.
3. All Shp must be in CRS 29873 , unless specified otherwise
4. all initial data (area, length, perimeter) are generated in meter.
A. CREATE NEW ATTRIBUTE DATA
Where to use : Attribute table.
NEW FIELD
Area in Ha
Shp : Polygon
ArGen_Ha=
$area /10000
Name : ArGen_Ha
Shp : Line
Dist_km =
$length in m , $length/1000 in km
Perimeter of coupe/Area
Shp : Poly
$perimeter in m , $perimeter/1000 in km
Name : Peri_km
Field: decimal, W20,P2
Get Easting
Shp : Point
Peri_km =
Easting =
$x
Name : Easting
Field: decimal, W20,P3
Get Northing
5
Northing =
$y
1 ha = 10,000 m2
NOTE
1km = 1000 m
1km = 1000 m
e.g. 818025.947
Shp : Point
Name : Northing
Field: decimal, W20,P3
e.g. 505015.934
Shp : Polygon
Name : Comt_Ha
Field: decimal, W20,P0
Shp : Line
Name : Bearing
Field: decimal, W20P5
NEW FIELD
Size of area
Shp : Poly
Name : L_ArGen
= 23,450 Ha
L_ArGen =
round(($area/10000),2) || ' Ha'
Shp : Poly
Name : L_%_ArGen
Field: text, W5
Shp : Point
Name : Latitude
Field: text, W20
3
Latitude
NOTE
Name : Latitude
Field: text, W20
Shp : Line
Create Bearing in DMS = 311 17' 43.19"
Name : L_Bearing
Field: text, W20
L_Bearing =
floor ((atan((xat(-1)-xat(0))/(yat(-1)-yat(0)))) * 180/3.14159 + (180 *(((yat(-1)-yat(0)) <
0) + (((xat(-1)-xat(0)) < 0 AND (yat(-1) - yat(0)) >0)*2)))) || ' ' ||
floor((((atan((xat(-1)-xat(0))/(yat(-1)-yat(0)))) * 180/3.14159 + (180 *(((yat(-1)-yat(0))
< 0) + (((xat(-1)-xat(0)) < 0 AND (yat(-1) - yat(0)) >0)*2)))) - floor ((atan((xat(-1)xat(0))/(yat(-1)-yat(0)))) * 180/3.14159 + (180 *(((yat(-1)-yat(0)) < 0) + (((xat(-1)xat(0)) < 0 AND (yat(-1) - yat(0)) >0)*2))))) * 60) ||'\'' || substr(
(tostring(((((atan((xat(-1)-xat(0))/(yat(-1)-yat(0)))) * 180/3.14159 + (180 *(((yat(-1)yat(0)) < 0) + (((xat(-1)-xat(0)) < 0 AND (yat(-1) - yat(0)) >0)*2)))) - floor
((atan((xat(-1)-xat(0))/(yat(-1)-yat(0)))) * 180/3.14159 + (180 *(((yat(-1)-yat(0)) < 0) +
(((xat(-1)-xat(0)) < 0 AND (yat(-1) - yat(0)) >0)*2))))) * 60) - floor((((atan((xat(-1)xat(0))/(yat(-1)-yat(0)))) * 180/3.14159 + (180 *(((yat(-1)-yat(0)) < 0) + (((xat(-1)xat(0)) < 0 AND (yat(-1) - yat(0)) >0)*2)))) - floor ((atan((xat(-1)-xat(0))/(yat(-1)yat(0)))) * 180/3.14159 + (180 *(((yat(-1)-yat(0)) < 0) + (((xat(-1)-xat(0)) < 0 AND (yat(1) - yat(0)) >0)*2))))) * 60)) * 60),1,5) || '"'
2/4
2
FIELD DATA
Roadname =
CASE WHEN "RoadName is NULL THEN '' ELSE "
RoadName " END || '\n' || CASE WHEN "
Dist_km" is NULL THEN '' ELSE (" L_Dist_km"
) END
NEW FIELD
NOTE
Name : No.
Field: text, W <5
Name : Code
Field: text, W <255
Code =
poly||$rownum
Convert text in ProjName and write to
L_Prjnm =
upper("ProjName)
Name : L_Prjnm
Field: text, W <255
Fields : ProjName
E. FOR QUERY
Where to use : Attribute table.
1
FIELD DATA
TreeType =
TreeType IN ( Acacia, Albizia,
Belian)
%eraya%
3/4
3
FIELD DATA
Printed [% now() %]
Printed 2015-11-03T11:59:14
date and time will be updated everytime map is
reprinted
4/4
4