labeling “ chemboxes ” in arcgis
DESCRIPTION
Labeling “ Chemboxes ” in ArcGIS. Automating Sampling D ata L abels. Problem. We needed constantly updated maps of groundwater well sampling results. The n eed for maps showing one year of data or three years of data. Not too many examples of this on the Internet. Solution. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/1.jpg)
Labeling “Chemboxes” in ArcGISAutomating Sampling Data Labels
![Page 2: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/2.jpg)
Problem• We needed constantly updated maps of
groundwater well sampling results.• The need for maps showing one year of data or
three years of data.• Not too many examples of this on the Internet.
Solution• Automate labeling using VBScript Expression
![Page 3: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/3.jpg)
Benefits of Scripting
• Easy to update data on the map• Time frame of data shown can easily be
changed• Results above an action level can be shown in
bold to stand out.• Avoid typos and incorrect data. Data errors
can be blamed on the lab.• Data is presented uniformly.
![Page 4: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/4.jpg)
One Year sample of Data
![Page 5: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/5.jpg)
Three years of sample data
![Page 6: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/6.jpg)
Process
Dim ww = 2b o ld =" <_B O L>"u n b o l d = " </_B OL> "Dim Th eLab e l
If I n Str ([R es _resu l ts 2 .N 2 0 0 9 _0 1 ], "<") Th e n [R es_re su l t s2 .N 2 0 0 9 _ 0 1 ] = R ep la ce([R es_re su l ts2 . N2 0 0 9 _0 1 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 0 9 _ 0 1 ] = [R es_r esu l t s2 .N 2 0 0 9 _0 1 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 0 9 _ 0 1 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 0 9 _0 1 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 0 9 _0 1 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 0 9 _0 1 ] & " (1 /0 9 )" & u n b o ldb o ld =" <_B O L>"u n b o l d = " </_B OL> "En d i f
If I n Str ([R es _resu l ts 2 .N 2 0 0 9 _0 2 ], "<") Th e n [R es_re su l t s2 .N 2 0 0 9 _ 0 2 ] = R ep la ce([R es_re su l ts2 . N2 0 0 9 _0 2 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 0 9 _ 0 2 ] = [R es_r esu l t s2 .N 2 0 0 9 _0 2 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 0 9 _ 0 2 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 0 9 _0 2 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i f
En d i f If trim ([R es _resu l ts2 .N 2 0 0 9 _0 2 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 0 9 _0 2 ] & " (2 /0 9 )" & u n b o lden d i f
b o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 0 9 _0 3 ], "<") Th e n [R es_re su l t s2 .N 2 0 0 9 _ 0 3 ] = R ep la ce([R es_re su l ts2 . N2 0 0 9 _0 3 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 0 9 _ 0 3 ] = [R es_r esu l t s2 .N 2 0 0 9 _0 3 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 0 9 _ 0 3 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 0 9 _0 3 ])) > w Th en b o ld = "<B OL>"
u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 0 9 _0 3 ]) <> "" Th e n
Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 0 9 _0 3 ] & " (3 /0 9 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .A 2 0 0 9 _0 4 ], "<") Th e n [R es_re su l t s2 .A 2 0 0 9 _ 0 4 ] = R ep la ce([R es_re su l ts2 . A2 0 0 9 _0 4 ] , "<" , "& lt;" )
Else [R es_re su l t s2 .A 2 0 0 9 _ 0 4 ] = [R es_r esu l t s2 .A 2 0 0 9 _0 4 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . A2 0 0 9 _ 0 4 ])) T h en
If c in t( trim( [R es _res u l ts 2 .A 2 0 0 9 _0 4 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>"
En d i fEn d i f If trim ([R es _resu l ts2 .A 2 0 0 9 _0 4 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .A 2 0 0 9 _0 4 ] & " (4 /0 9 )" & u n b o ld
En d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 0 9 _0 6 ], "<") Th e n [R es_re su l t s2 .N 2 0 0 9 _ 0 6 ] = R ep la ce([R es_re su l ts2 . N2 0 0 9 _0 6 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 0 9 _ 0 6 ] = [R es_r esu l t s2 .N 2 0 0 9 _0 6 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 0 9 _ 0 6 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 0 9 _0 6 ])) > w Th en b o ld = "<B OL>"
u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 0 9 _0 6 ]) <> "" Th e n
Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 0 9 _0 6 ] & " (6 /0 9 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 0 9 _0 7 ], "<") Th e n [R es_re su l t s2 .N 2 0 0 9 _ 0 7 ] = R ep la ce([R es_re su l ts2 . N2 0 0 9 _0 7 ] , "<" , "& lt;" )Else
[R es_re su l t s2 .N 2 0 0 9 _ 0 7 ] = [R es_r esu l t s2 .N 2 0 0 9 _0 7 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 0 9 _ 0 7 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 0 9 _0 7 ])) > w Th en
b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f
If trim ([R es _resu l ts2 .N 2 0 0 9 _0 7 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 0 9 _0 7 ] & " (7 /0 9 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 0 9 _0 8 ], "<") Th e n [R es_re su l t s2 .N 2 0 0 9 _ 0 8 ] = R ep la ce([R es_re su l ts2 . N2 0 0 9 _0 8 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 0 9 _ 0 8 ] = [R es_r esu l t s2 .N 2 0 0 9 _0 8 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 0 9 _ 0 8 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 0 9 _0 8 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 0 9 _0 8 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 0 9 _0 8 ] & " (8 /0 9 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .A 2 0 0 9 _0 9 ], "<") Th e n [R es_re su l t s2 .A 2 0 0 9 _ 0 9 ] = R ep la ce([R es_re su l ts2 . A2 0 0 9 _0 9 ] , "<" , "& lt;" )Else [R es_re su l t s2 .A 2 0 0 9 _ 0 9 ] = [R es_r esu l t s2 .A 2 0 0 9 _0 9 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . A2 0 0 9 _ 0 9 ])) T h enIf c in t( trim( [R es _res u l ts 2 .A 2 0 0 9 _0 9 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .A 2 0 0 9 _0 9 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .A 2 0 0 9 _0 9 ] & " (9 /0 9 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 0 9 _1 1 ], "<") Th e n [R es_re su l t s2 .N 2 0 0 9 _ 1 1 ] = R ep la ce([R es_re su l ts2 . N2 0 0 9 _1 1 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 0 9 _ 1 1 ] = [R es_r esu l t s2 .N 2 0 0 9 _1 1 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 0 9 _ 1 1 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 0 9 _1 1 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 0 9 _1 1 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 0 9 _1 1 ] & " (1 1 /0 9 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 0 9 _1 2 ], "<") Th e n [R es_re su l t s2 .N 2 0 0 9 _ 1 2 ] = R ep la ce([R es_re su l ts2 . N2 0 0 9 _1 2 ] , "<" , "& lt;" )Else
[R es_re su l t s2 .N 2 0 0 9 _ 1 2 ] = [R es_r esu l t s2 .N 2 0 0 9 _1 2 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 0 9 _ 1 2 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 0 9 _1 2 ])) > w Th en
b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f
If trim ([R es _resu l ts2 .N 2 0 0 9 _1 2 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 0 9 _1 2 ] & " (1 2 /0 9 )" & u n b o ldEn d i fb o ld =" <_B O L>"
u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 0 _0 3 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 0 _ 0 3 ] = R ep la ce([R es_re su l ts2 . N2 0 1 0 _0 3 ] , "<" , "& lt;" )
Else [R es_re su l t s2 .N 2 0 1 0 _ 0 3 ] = [R es_r esu l t s2 .N 2 0 1 0 _0 3 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 0 _ 0 3 ])) T h en
If c in t( trim( [R es _res u l ts 2 .N 2 0 1 0 _0 3 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i f
En d i f If trim ([R es _resu l ts2 .N 2 0 1 0 _0 3 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 1 0 _0 3 ] & " (3 /1 0 )" & u n b o ldEn d i f
b o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 0 _0 6 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 0 _ 0 6 ] = R ep la ce([R es_re su l ts2 . N2 0 1 0 _0 6 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 0 _ 0 6 ] = [R es_r esu l t s2 .N 2 0 1 0 _0 6 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 0 _ 0 6 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 0 _0 6 ])) > w Th en b o ld = "<B OL>"
u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 1 0 _0 6 ]) <> "" Th e n
Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 1 0 _0 6 ] & " (6 /1 0 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 0 _0 7 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 0 _ 0 7 ] = R ep la ce([R es_re su l ts2 . N2 0 1 0 _0 7 ] , "<" , "& lt;" )Else
[R es_re su l t s2 .N 2 0 1 0 _ 0 7 ] = [R es_r esu l t s2 .N 2 0 1 0 _0 7 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 0 _ 0 7 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 0 _0 7 ])) > w Th en
b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f
If trim ([R es _resu l ts2 .N 2 0 1 0 _0 7 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 1 0 _0 7 ] & " (7 /1 0 )" & u n b o ldEn d i fb o ld =" <_B O L>"
u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 0 _0 9 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 0 _ 0 9 ] = R ep la ce([R es_re su l ts2 . N2 0 1 0 _0 9 ] , "<" , "& lt;" )
Else [R es_re su l t s2 .N 2 0 1 0 _ 0 9 ] = [R es_r esu l t s2 .N 2 0 1 0 _0 9 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 0 _ 0 9 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 0 _0 9 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 1 0 _0 9 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 1 0 _0 9 ] & " (9 /1 0 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 0 _1 0 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 0 _ 1 0 ] = R ep la ce([R es_re su l ts2 . N2 0 1 0 _1 0 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 0 _ 1 0 ] = [R es_r esu l t s2 .N 2 0 1 0 _1 0 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 0 _ 1 0 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 0 _1 0 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 1 0 _1 0 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 1 0 _1 0 ] & " (1 0 /1 0 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 0 _1 1 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 0 _ 1 1 ] = R ep la ce([R es_re su l ts2 . N2 0 1 0 _1 1 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 0 _ 1 1 ] = [R es_r esu l t s2 .N 2 0 1 0 _1 1 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 0 _ 1 1 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 0 _1 1 ])) > w Th en b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 1 0 _1 1 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 1 0 _1 1 ] & " (1 1 /1 0 )" & u n b o ldEn d i fb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 0 _1 2 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 0 _ 1 2 ] = R ep la ce([R es_re su l ts2 . N2 0 1 0 _1 2 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 0 _ 1 2 ] = [R es_r esu l t s2 .N 2 0 1 0 _1 2 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 0 _ 1 2 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 0 _1 2 ])) > w Th en
b o ld = "<B OL>" u n b o ld = " </B O L>" En d i fEn d i f
If trim ([R es _resu l ts2 .N 2 0 1 0 _1 2 ]) <> "" Th e n Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 1 0 _1 2 ] & " (1 2 /1 0 )" & u n b o ldEn d i fb o ld =" <_B O L>"
u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 1 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 0 1 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 1 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 1 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 1 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 1 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 1 _0 1 ])) > w Th en b o ld = "<B OL>"
u n b o ld = " </B O L>" En d i fEn d i f If trim ([R es _resu l ts2 .N 2 0 1 1 _0 1 ]) <> "" Th e n
Th eLab el = T h eLa b el & v b n e wl in e & b o l d & [R es_re su l t s2 .N 2 0 1 1 _0 1 ] & " (1 /1 1 )" & u n b o ldb o ld =" <_B O L>"u n b o l d = " </_B OL> "En d i f
If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 2 ], "<") Th e n
[R es_re su l t s2 .N 2 0 1 1 _ 0 2 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 2 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 2 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 2 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 2 ])) T h en If c in t( trim( [R es _res u l ts 2 .N 2 0 1 1 _0 2 ])) > w Th en b o l d = "<B O L>"
u n b o ld = " </B O L>" En d i fEn d IF If tri m([R es_ resu l ts2 .N2 0 1 1 _0 2 ]) <> "" Th e n
Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_res u l ts 2 .N 2 0 1 1 _ 0 2 ] & " (2 / 1 1 ) "& u n b o ld En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 3 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 0 3 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 3 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 3 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 3 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 3 ])) T h en If cin t (trim ([R e s_res u l t s2 .N 2 0 1 1 _0 3 ]) ) > w Th en b o l d = "<B O L>"
u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 1 _0 3 ]) < > "" Th en
Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_re su l t s2 .N 2 0 1 1 _0 3 ] & " (3 /1 1 )" & u n b o ld En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 4 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 0 4 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 4 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 4 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 4 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 4 ])) T h en If cin t (trim ([R e s_res u l t s2 .N 2 0 1 1 _0 4 ]) ) > w Th en b o l d = "<B O L>"
u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 1 _0 4 ]) < > "" Th en Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_res u l ts 2 .N 2 0 1 1 _ 0 4 ] & " (4 / 1 1 ) " & u n b o l d En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 5 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 0 5 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 5 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 5 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 5 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 5 ])) T h en If c in t( trim( [R es _res u l ts 2 .N 2 0 1 1 _0 5 ])) > w Th en b o l d = "<B O L>" u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 1 _0 5 ]) < > "" Th en Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_res u l ts 2 .N 2 0 1 1 _ 0 5 ] & " (5 / 1 1 ) " & u n b o l d En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 6 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 0 6 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 6 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 6 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 6 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 6 ])) T h en If cin t (trim ([R e s_res u l t s2 .N 2 0 1 1 _0 6 ]) ) > w Th en b o l d = "<B O L>" u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 1 _0 6 ]) < > "" Th en Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_res u l ts 2 .N 2 0 1 1 _ 0 6 ] & " (6 / 1 1 ) " & u n b o l d En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 7 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 0 7 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 7 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 7 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 7 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 7 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 1 _0 7 ])) > w Th en b o l d = "<B O L>" u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 1 _0 7 ]) < > "" Th en Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o ld & [R es_re su l t s2 .N 2 0 1 1 _0 7 ] & " (7 /1 1 )" & u n b o ld En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 8 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 0 8 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 8 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 8 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 8 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 8 ])) T h enIf c in t( trim( [R es _res u l ts 2 .N 2 0 1 1 _0 8 ])) > w Th en b o l d = "<B O L>"
u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 1 _0 8 ]) < > "" Th en
Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_res u l ts 2 .N 2 0 1 1 _ 0 8 ] & " (8 / 1 1 ) " & u n b o l d En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _0 9 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 0 9 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _0 9 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 1 _ 0 9 ] = [R es_r esu l t s2 .N 2 0 1 1 _0 9 ]
En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 0 9 ])) T h en If cin t (trim ([R e s_res u l t s2 .N 2 0 1 1 _0 9 ]) ) > w Th en b o l d = "<B O L>"
u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 1 _0 9 ]) < > "" Th en
Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_re su l t s2 .N 2 0 1 1 _0 9 ] & " (9 /1 1 )" & u n b o ld En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "
If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _1 0 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 1 0 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _1 0 ] , "<" , "& lt;" )Else
[R es_re su l t s2 .N 2 0 1 1 _ 1 0 ] = [R es_r esu l t s2 .N 2 0 1 1 _1 0 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 1 0 ])) T h en If cin t (trim ([R e s_res u l t s2 .N 2 0 1 1 _1 0 ]) ) > w Th en
b o l d = "<B O L>" u n b o ld = " </B O L>" En d i fEn d i f
If tri m([R es_ resu l ts2 .N2 0 1 1 _1 0 ]) < > "" Th en Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_res u l ts 2 .N 2 0 1 1 _ 1 0 ] & " (1 0 /1 1 )" & u n b o ld En d Ifb o ld =" <_B O L>"
u n b o l d = " </_B OL> "If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _1 1 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 1 1 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _1 1 ] , "<" , "& lt;" )Else
[R es_re su l t s2 .N 2 0 1 1 _ 1 1 ] = [R es_r esu l t s2 .N 2 0 1 1 _1 1 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 1 1 ])) T h en If cin t (trim ([R e s_res u l t s2 .N 2 0 1 1 _1 1 ]) ) > w Th en
b o l d = "<B O L>" u n b o ld = " </B O L>" En d i fEn d i f
If tri m([R es_ resu l ts2 .N2 0 1 1 _1 1 ]) < > "" Th en Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_re su l t s2 .N 2 0 1 1 _1 1 ] & " (1 1 /1 1 )" & u n b o ld En d Ifb o ld =" <_B O L>"
u n b o l d = " </_B OL> "If I n Str ([R es _resu l ts 2 .N 2 0 1 1 _1 2 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 1 _ 1 2 ] = R ep la ce([R es_re su l ts2 . N2 0 1 1 _1 2 ] , "<" , "& lt;" )Else
[R es_re su l t s2 .N 2 0 1 1 _ 1 2 ] = [R es_r esu l t s2 .N 2 0 1 1 _1 2 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 1 _ 1 2 ])) T h en If cin t (trim ([R e s_res u l t s2 .N 2 0 1 1 _1 2 ]) ) > w Th en
b o l d = "<B O L>" u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 1 _1 2 ]) < > "" Th en Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_re su l t s2 .N 2 0 1 1 _1 2 ] & " (1 2 /1 1 )" & u n b o ld En d Ifb o ld =" <_B O L>"u n b o l d = " </_B OL> "If I n Str ([R es _resu l ts 2 .N 2 0 1 2 _0 2 ], "<") Th e n [R es_re su l t s2 .N 2 0 1 2 _ 0 2 ] = R ep la ce([R es_re su l ts2 . N2 0 1 2 _0 2 ] , "<" , "& lt;" )Else [R es_re su l t s2 .N 2 0 1 2 _ 0 2 ] = [R es_r esu l t s2 .N 2 0 1 2 _0 2 ] En d If If I sNu meric (trim ([R es_r esu l ts2 . N2 0 1 2 _ 0 2 ])) T h en If cin t (trim ([R e s_res u l t s2 .N 2 0 1 2 _0 2 ]) ) > w Th en b o l d = "<B O L>" u n b o ld = " </B O L>" En d i fEn d i f If tri m([R es_ resu l ts2 .N2 0 1 2 _0 2 ]) < > "" Th en Th eLab e l = T h eLa b el& vb n ew l in e & " " & b o l d & [R es_re su l t s2 .N 2 0 1 2 _0 2 ] & " (2 /1 2 )" & u n b o ld En d If
Th eLab el = R ep lace( [Per ch lo rate _M o n ito rin g_Lo cati o n s .WC _Lo c atio n ], "&" , "& amp ; ") & Th e Lab el
Fin d Lab e l = Th eL ab el En d Fu n ctio n
Flatten data tables (data from Lab or data validation)
Join data to shapefile containing sample locations
Write VBScript Expression
![Page 7: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/7.jpg)
Flatten data tables• Pivot Table in Excel• Or build a query to output a flattened table in
Microsoft Access• Also know as denormalizing a database
This makes it easier to join your Sample/Well Locations to your sample data.
Allows for simple access to data for scripting labels in ArcGIS.
No need for data arrays or FOR NEXT programming Loops.
![Page 8: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/8.jpg)
Create One to Many Relationship
One Location to many results.
![Page 9: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/9.jpg)
Building a VBScript Expression
![Page 10: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/10.jpg)
The Script
Function FindLabel ( [Sample_Monitoring_Locations.LOCATION], [Sample_Monitoring_Locations.WC_Location],[Sample_Monitoring_Locations.PARID],
[Res_results2.N2012_02] , [Res_results2.N2011_12] , [Res_results2.N2011_11] , [Res_results2.N2011_10] , [Res_results2.N2011_09] , [Res_results2.N2011_08]
…
Define and populate your variables with data from the table.
Sample_Monitoring_Locations shapefile joined with Res_Results2 (lab results) Table.
Lab Results Table Column in Table (August 2009)
Sample Location Shapefile
Parcel ID Column in Shapefile
![Page 11: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/11.jpg)
One routine per month If InStr([Res_results.N2009_01], "<") Then [Res_results2.N2009_01] = Replace([Res_results2.N2009_01], "<", "<")Else [Res_results2.N2009_01] = [Res_results2.N2009_01] End If
If IsNumeric(trim([Res_results2.N2009_01])) Then If cint(trim([Res_results2.N2009_01])) > w Then bold = "<BOL>" End ifEnd if
If trim([Res_results2.N2009_01]) <> "" Then TheLabel = TheLabel & vbnewline & bold & [Res_results2.N2009_01] & " (1/09)" & unboldEnd if
If results are not null then include label. Trim removes blank spaces.
If the string contains < “less than” swap it out with an equivalent character code.
Parse number fromString. If greater than MCL then Bold.
This routine is repeated for every month of dataChanging the date/Column name of course
![Page 12: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/12.jpg)
End the function and replace ‘&’
TheLabel =Replace([sample_Monitoring_Locations.WC_Loc
ation], "&", "&") & TheLabel
FindLabel = TheLabelEnd Function
![Page 13: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/13.jpg)
Displaying < > and & SymbolsUsing Equivalent Character Codes
I used this work around:
If InStr([Res_results.N2009_01], "<") Then [Res_results2.N2009_01] = Replace([Res_results2.N2009_01], "<", "<")TheLabel =Replace([sample_Monitoring_Locations.WC_Location], "&", "&") & TheLabel
ESRI Desktop Help mentions this work around:
Function FindLabel ([LABELFIELD]) NewString = Replace([LABELFIELD],"&","&") FindLabel = "<ITA>" & NewString & "</ITA>" End Function
![Page 14: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/14.jpg)
Balance text size to avoid overlap
![Page 15: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/15.jpg)
Resources
• “Using VBSript to Build Complex Labels in ArcGIS” Arcuser Magazine, Oct-Dec 2004
(deals mostly with text formatting)
• ESRI Help on building Label expressions
• “Advanced Labeling in ArcMap with VBScript Findlabel Functions” by Chad Cooper
• Note: Maplex was used mainly to stack label location name.
![Page 16: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/16.jpg)
![Page 17: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/17.jpg)
Query in Access to
![Page 18: Labeling “ Chemboxes ” in ArcGIS](https://reader035.vdocuments.mx/reader035/viewer/2022081503/568160fe550346895dd03d21/html5/thumbnails/18.jpg)